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

Unified Diff: content/browser/worker_host/worker_process_host.cc

Issue 9317026: Hide WorkerProcessHost from chrome. (Closed) Base URL: svn://chrome-svn/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: content/browser/worker_host/worker_process_host.cc
===================================================================
--- content/browser/worker_host/worker_process_host.cc (revision 119868)
+++ content/browser/worker_host/worker_process_host.cc (working copy)
@@ -18,6 +18,7 @@
#include "content/browser/appcache/appcache_dispatcher_host.h"
#include "content/browser/browser_child_process_host_impl.h"
#include "content/browser/child_process_security_policy.h"
+#include "content/browser/debugger/worker_devtools_manager.h"
#include "content/browser/debugger/worker_devtools_message_filter.h"
#include "content/browser/file_system/file_system_dispatcher_host.h"
#include "content/browser/mime_registry_message_filter.h"
@@ -52,6 +53,7 @@
using content::ChildProcessData;
using content::ChildProcessHost;
using content::UserMetricsAction;
+using content::WorkerDevToolsManager;
using content::WorkerServiceImpl;
namespace {
@@ -373,14 +375,16 @@
unsigned long estimated_size,
bool* result) {
*result = content::GetContentClient()->browser()->AllowWorkerDatabase(
- worker_route_id, url, name, display_name, estimated_size, this);
+ url, name, display_name, estimated_size, *resource_context_,
+ GetRenderViewIDsForWorker(worker_route_id));
}
void WorkerProcessHost::OnAllowFileSystem(int worker_route_id,
const GURL& url,
bool* result) {
*result = content::GetContentClient()->browser()->AllowWorkerFileSystem(
- worker_route_id, url, this);
+ url, *resource_context_,
+ GetRenderViewIDsForWorker(worker_route_id));
}
void WorkerProcessHost::RelayMessage(
@@ -440,7 +444,7 @@
new_message->set_routing_id(route_id);
filter->Send(new_message);
if (message.type() == WorkerMsg_StartWorkerContext::ID) {
- WorkerServiceImpl::GetInstance()->NotifyWorkerContextStarted(
+ WorkerDevToolsManager::GetInstance()->WorkerContextStarted(
this, route_id);
}
return;
@@ -525,6 +529,25 @@
return process_->GetData();
}
+std::vector<std::pair<int, int> > WorkerProcessHost::GetRenderViewIDsForWorker(
+ int worker_route_id) {
+ std::vector<std::pair<int, int> > result;
+ WorkerProcessHost::Instances::const_iterator i;
+ for (i = instances_.begin(); i != instances_.end(); ++i) {
+ if (i->worker_route_id() != worker_route_id)
+ continue;
+ const WorkerDocumentSet::DocumentInfoSet& documents =
+ i->worker_document_set()->documents();
+ for (WorkerDocumentSet::DocumentInfoSet::const_iterator doc =
+ documents.begin(); doc != documents.end(); ++doc) {
+ result.push_back(
+ std::make_pair(doc->render_process_id(), doc->render_view_id()));
+ }
+ break;
+ }
+ return result;
+}
+
WorkerProcessHost::WorkerInstance::WorkerInstance(
const GURL& url,
const string16& name,
« no previous file with comments | « content/browser/worker_host/worker_process_host.h ('k') | content/browser/worker_host/worker_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698