Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2734)

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 9193024: [Mac] Add a perf test that counts the number of Mach ports in the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/testing_automation_provider.cc
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index eb69fb14bb6f9eee4340049a6ecef8eece107503..5bfdceb96e4a852dddd6e2b4cdb2915aab086c9f 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -152,6 +152,10 @@
#include "chrome/browser/download/download_shelf.h"
#endif
+#if defined(OS_MACOSX)
+#include "base/mach_ipc_mac.h"
+#endif
+
using automation::Error;
using automation::ErrorCode;
using automation_util::SendErrorIfModalDialogActive;
@@ -319,6 +323,7 @@ bool TestingAutomationProvider::OnMessageReceived(
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_AppendTab, AppendTab)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_AppendBackgroundTab,
AppendBackgroundTab)
+ IPC_MESSAGE_HANDLER(AutomationMsg_GetMachPortCount, GetMachPortCount)
IPC_MESSAGE_HANDLER(AutomationMsg_ActiveTabIndex, GetActiveTabIndex)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_CloseTab, CloseTab)
IPC_MESSAGE_HANDLER(AutomationMsg_GetCookies, GetCookies)
@@ -599,6 +604,14 @@ void TestingAutomationProvider::AppendBackgroundTab(
}
}
+void TestingAutomationProvider::GetMachPortCount(int* port_count) {
+#if defined(OS_MACOSX)
+ base::mac::GetNumberOfMachPorts(mach_task_self(), port_count);
+#else
+ *port_count = 0
+#endif
+}
+
void TestingAutomationProvider::GetActiveTabIndex(int handle,
int* active_tab_index) {
*active_tab_index = -1; // -1 is the error code

Powered by Google App Engine
This is Rietveld 408576698