diff options
author | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 01:30:08 +0000 |
---|---|---|
committer | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 01:30:08 +0000 |
commit | 2b437e23748d7444f1698ae9242fabf0bc0730a7 (patch) | |
tree | 40a740c3f0a8032e30299d8724e54d9a269291af /chrome/browser/worker_host/worker_service.cc | |
parent | e0976a77dcc9be00485086b5b0e112fe6d159ff2 (diff) | |
download | chromium_src-2b437e23748d7444f1698ae9242fabf0bc0730a7.zip chromium_src-2b437e23748d7444f1698ae9242fabf0bc0730a7.tar.gz chromium_src-2b437e23748d7444f1698ae9242fabf0bc0730a7.tar.bz2 |
Changes to the Browser to support Database access from Workers.
This changelist should have no visible effect until the V8
bindings for the Database get added to the Worker context in WebKit.
BUG=none
TEST=webkit layout tests
Review URL: http://codereview.chromium.org/1387001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/worker_host/worker_service.cc')
-rw-r--r-- | chrome/browser/worker_host/worker_service.cc | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/chrome/browser/worker_host/worker_service.cc b/chrome/browser/worker_host/worker_service.cc index f021e24..6946427 100644 --- a/chrome/browser/worker_host/worker_service.cc +++ b/chrome/browser/worker_host/worker_service.cc @@ -9,6 +9,7 @@ #include "base/sys_info.h" #include "base/thread.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/host_content_settings_map.h" #include "chrome/browser/plugin_service.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/resource_message_filter.h" @@ -45,15 +46,18 @@ void WorkerService::Initialize(ResourceDispatcherHost* rdh) { WorkerService::~WorkerService() { } -bool WorkerService::CreateWorker(const GURL &url, - bool is_shared, - bool off_the_record, - const string16& name, - unsigned long long document_id, - int renderer_id, - int render_view_route_id, - IPC::Message::Sender* sender, - int sender_route_id) { +bool WorkerService::CreateWorker( + const GURL &url, + bool is_shared, + bool off_the_record, + const string16& name, + unsigned long long document_id, + int renderer_id, + int render_view_route_id, + IPC::Message::Sender* sender, + int sender_route_id, + webkit_database::DatabaseTracker* db_tracker, + HostContentSettingsMap* host_content_settings_map) { // Generate a unique route id for the browser-worker communication that's // unique among all worker processes. That way when the worker process sends // a wrapped IPC message through us, we know which WorkerProcessHost to give @@ -67,11 +71,14 @@ bool WorkerService::CreateWorker(const GURL &url, instance.worker_document_set()->Add( sender, document_id, renderer_id, render_view_route_id); - return CreateWorkerFromInstance(instance); + return CreateWorkerFromInstance(instance, db_tracker, + host_content_settings_map); } bool WorkerService::CreateWorkerFromInstance( - WorkerProcessHost::WorkerInstance instance) { + WorkerProcessHost::WorkerInstance instance, + webkit_database::DatabaseTracker* db_tracker, + HostContentSettingsMap* host_content_settings_map) { WorkerProcessHost* worker = NULL; if (CommandLine::ForCurrentProcess()->HasSwitch( @@ -152,7 +159,8 @@ bool WorkerService::CreateWorkerFromInstance( } if (!worker) { - worker = new WorkerProcessHost(resource_dispatcher_host_); + worker = new WorkerProcessHost(resource_dispatcher_host_, db_tracker, + host_content_settings_map); if (!worker->Init()) { delete worker; return false; @@ -440,7 +448,8 @@ void WorkerService::WorkerProcessDestroyed(WorkerProcessHost* process) { if (CanCreateWorkerProcess(*i)) { WorkerProcessHost::WorkerInstance instance = *i; queued_workers_.erase(i); - CreateWorkerFromInstance(instance); + CreateWorkerFromInstance(instance, process->database_tracker(), + process->GetHostContentSettingsMap()); // CreateWorkerFromInstance can modify the queued_workers_ list when it // coalesces queued instances after starting a shared worker, so we |