OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2716 // Gets info about BrowserChildProcessHost. Must run on IO thread to | 2716 // Gets info about BrowserChildProcessHost. Must run on IO thread to |
2717 // honor the semantics of BrowserChildProcessHost. | 2717 // honor the semantics of BrowserChildProcessHost. |
2718 // Used by AutomationProvider::GetBrowserInfo(). | 2718 // Used by AutomationProvider::GetBrowserInfo(). |
2719 void GetChildProcessHostInfo(ListValue* child_processes) { | 2719 void GetChildProcessHostInfo(ListValue* child_processes) { |
2720 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2720 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
2721 for (BrowserChildProcessHost::Iterator iter; !iter.Done(); ++iter) { | 2721 for (BrowserChildProcessHost::Iterator iter; !iter.Done(); ++iter) { |
2722 // Only add processes which are already started, | 2722 // Only add processes which are already started, |
2723 // since we need their handle. | 2723 // since we need their handle. |
2724 if ((*iter)->handle() == base::kNullProcessHandle) | 2724 if ((*iter)->handle() == base::kNullProcessHandle) |
2725 continue; | 2725 continue; |
2726 ChildProcessInfo* info = *iter; | |
2727 DictionaryValue* item = new DictionaryValue; | 2726 DictionaryValue* item = new DictionaryValue; |
2728 item->SetString("name", info->name()); | 2727 item->SetString("name", iter->name()); |
2729 item->SetString("type", content::GetProcessTypeNameInEnglish(info->type())); | 2728 item->SetString("type", |
2730 item->SetInteger("pid", base::GetProcId(info->handle())); | 2729 content::GetProcessTypeNameInEnglish(iter->type())); |
| 2730 item->SetInteger("pid", base::GetProcId(iter->handle())); |
2731 child_processes->Append(item); | 2731 child_processes->Append(item); |
2732 } | 2732 } |
2733 } | 2733 } |
2734 | 2734 |
2735 } // namespace | 2735 } // namespace |
2736 | 2736 |
2737 // Sample json input: { "command": "GetBrowserInfo" } | 2737 // Sample json input: { "command": "GetBrowserInfo" } |
2738 // Refer to GetBrowserInfo() in chrome/test/pyautolib/pyauto.py for | 2738 // Refer to GetBrowserInfo() in chrome/test/pyautolib/pyauto.py for |
2739 // sample json output. | 2739 // sample json output. |
2740 void TestingAutomationProvider::GetBrowserInfo( | 2740 void TestingAutomationProvider::GetBrowserInfo( |
(...skipping 3690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6431 | 6431 |
6432 Send(reply_message_); | 6432 Send(reply_message_); |
6433 redirect_query_ = 0; | 6433 redirect_query_ = 0; |
6434 reply_message_ = NULL; | 6434 reply_message_ = NULL; |
6435 } | 6435 } |
6436 | 6436 |
6437 void TestingAutomationProvider::OnRemoveProvider() { | 6437 void TestingAutomationProvider::OnRemoveProvider() { |
6438 if (g_browser_process) | 6438 if (g_browser_process) |
6439 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6439 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6440 } | 6440 } |
OLD | NEW |