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 |