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

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

Issue 9150017: Add a Content API around BrowserChildProcessHost, similar to what was done with ChildProcessHost.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix?! 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
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/testing_automation_provider.cc
===================================================================
--- chrome/browser/automation/testing_automation_provider.cc (revision 118420)
+++ chrome/browser/automation/testing_automation_provider.cc (working copy)
@@ -117,6 +117,8 @@
#include "chrome/common/url_constants.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/interstitial_page.h"
+#include "content/public/browser/browser_child_process_host_iterator.h"
+#include "content/public/browser/child_process_data.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
@@ -151,6 +153,7 @@
using automation::Error;
using automation::ErrorCode;
using automation_util::SendErrorIfModalDialogActive;
+using content::BrowserChildProcessHostIterator;
using content::BrowserThread;
using content::ChildProcessHost;
using content::DownloadItem;
@@ -2773,20 +2776,18 @@
namespace {
// Gets info about BrowserChildProcessHost. Must run on IO thread to
-// honor the semantics of BrowserChildProcessHost.
+// honor the semantics of BrowserChildProcessHostIterator.
// Used by AutomationProvider::GetBrowserInfo().
void GetChildProcessHostInfo(ListValue* child_processes) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- for (BrowserChildProcessHost::Iterator iter; !iter.Done(); ++iter) {
- // Only add processes which are already started,
- // since we need their handle.
- if ((*iter)->data().handle == base::kNullProcessHandle)
+ for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) {
+ // Only add processes which are already started, since we need their handle.
+ if (iter.GetData().handle == base::kNullProcessHandle)
continue;
DictionaryValue* item = new DictionaryValue;
- item->SetString("name", iter->data().name);
+ item->SetString("name", iter.GetData().name);
item->SetString("type",
- content::GetProcessTypeNameInEnglish(iter->data().type));
- item->SetInteger("pid", base::GetProcId(iter->data().handle));
+ content::GetProcessTypeNameInEnglish(iter.GetData().type));
+ item->SetInteger("pid", base::GetProcId(iter.GetData().handle));
child_processes->Append(item);
}
}
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698