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

Unified Diff: chrome/browser/debugger/devtools_sanity_unittest.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/browser_process_impl.cc ('k') | chrome/browser/extensions/extension_tabs_module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/debugger/devtools_sanity_unittest.cc
===================================================================
--- chrome/browser/debugger/devtools_sanity_unittest.cc (revision 118420)
+++ chrome/browser/debugger/devtools_sanity_unittest.cc (working copy)
@@ -25,6 +25,8 @@
#include "chrome/test/base/ui_test_utils.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/worker_host/worker_process_host.h"
+#include "content/public/browser/browser_child_process_host_iterator.h"
+#include "content/public/browser/child_process_data.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/devtools_agent_host_registry.h"
#include "content/public/browser/devtools_client_host.h"
@@ -292,7 +294,7 @@
virtual void WorkerCreated (
WorkerProcessHost* process,
const WorkerProcessHost::WorkerInstance& instance) OVERRIDE {
- worker_data_->worker_process_id = process->data().id;
+ worker_data_->worker_process_id = process->GetData().id;
worker_data_->worker_route_id = instance.worker_route_id();
WorkerService::GetInstance()->RemoveObserver(this);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
@@ -323,7 +325,7 @@
virtual void WorkerDestroyed(
WorkerProcessHost* process,
int worker_route_id) OVERRIDE {
- ASSERT_EQ(worker_data_->worker_process_id, process->data().id);
+ ASSERT_EQ(worker_data_->worker_process_id, process->GetData().id);
ASSERT_EQ(worker_data_->worker_route_id, worker_route_id);
WorkerService::GetInstance()->RemoveObserver(this);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
@@ -349,11 +351,9 @@
static void TerminateWorkerOnIOThread(
scoped_refptr<WorkerData> worker_data) {
- for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
- !iter.Done(); ++iter) {
- if (iter->data().id == worker_data->worker_process_id) {
- WorkerProcessHost* host = static_cast<WorkerProcessHost*>(*iter);
- host->TerminateWorker(worker_data->worker_route_id);
+ for (WorkerProcessHostIterator iter; !iter.Done(); ++iter) {
+ if (iter.GetData().id == worker_data->worker_process_id) {
+ iter->TerminateWorker(worker_data->worker_route_id);
WorkerService::GetInstance()->AddObserver(
new WorkerTerminationObserver(worker_data));
return;
@@ -371,14 +371,12 @@
static void WaitForFirstSharedWorkerOnIOThread(
scoped_refptr<WorkerData> worker_data) {
- BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_WORKER);
- for (; !iter.Done(); ++iter) {
- WorkerProcessHost* worker = static_cast<WorkerProcessHost*>(*iter);
- const WorkerProcessHost::Instances& instances = worker->instances();
+ for (WorkerProcessHostIterator iter; !iter.Done(); ++iter) {
+ const WorkerProcessHost::Instances& instances = iter->instances();
for (WorkerProcessHost::Instances::const_iterator i = instances.begin();
i != instances.end(); ++i) {
- worker_data->worker_process_id = worker->data().id;
+ worker_data->worker_process_id = iter.GetData().id;
worker_data->worker_route_id = i->worker_route_id();
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
MessageLoop::QuitClosure());
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/extensions/extension_tabs_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698