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

Side by Side Diff: chrome/browser/worker_host/worker_process_host.cc

Issue 1719007: Initializing an appcache host in a worker process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/worker_host/worker_process_host.h" 5 #include "chrome/browser/worker_host/worker_process_host.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 switches::kEnableNativeWebWorkers)) { 110 switches::kEnableNativeWebWorkers)) {
111 cmd_line->AppendSwitch(switches::kEnableNativeWebWorkers); 111 cmd_line->AppendSwitch(switches::kEnableNativeWebWorkers);
112 } 112 }
113 113
114 if (CommandLine::ForCurrentProcess()->HasSwitch( 114 if (CommandLine::ForCurrentProcess()->HasSwitch(
115 switches::kWebWorkerShareProcesses)) { 115 switches::kWebWorkerShareProcesses)) {
116 cmd_line->AppendSwitch(switches::kWebWorkerShareProcesses); 116 cmd_line->AppendSwitch(switches::kWebWorkerShareProcesses);
117 } 117 }
118 118
119 if (CommandLine::ForCurrentProcess()->HasSwitch( 119 if (CommandLine::ForCurrentProcess()->HasSwitch(
120 switches::kDisableApplicationCache)) {
121 cmd_line->AppendSwitch(switches::kDisableApplicationCache);
122 }
123
124 if (CommandLine::ForCurrentProcess()->HasSwitch(
120 switches::kDisableDatabases)) { 125 switches::kDisableDatabases)) {
121 cmd_line->AppendSwitch(switches::kDisableDatabases); 126 cmd_line->AppendSwitch(switches::kDisableDatabases);
122 } 127 }
123 128
124 if (CommandLine::ForCurrentProcess()->HasSwitch( 129 if (CommandLine::ForCurrentProcess()->HasSwitch(
125 switches::kEnableLogging)) { 130 switches::kEnableLogging)) {
126 cmd_line->AppendSwitch(switches::kEnableLogging); 131 cmd_line->AppendSwitch(switches::kEnableLogging);
127 } 132 }
128 if (CommandLine::ForCurrentProcess()->HasSwitch( 133 if (CommandLine::ForCurrentProcess()->HasSwitch(
129 switches::kLoggingLevel)) { 134 switches::kLoggingLevel)) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 ChildProcessSecurityPolicy::GetInstance()->Add(id()); 194 ChildProcessSecurityPolicy::GetInstance()->Add(id());
190 195
191 return true; 196 return true;
192 } 197 }
193 198
194 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) { 199 void WorkerProcessHost::CreateWorker(const WorkerInstance& instance) {
195 ChildProcessSecurityPolicy::GetInstance()->GrantRequestURL( 200 ChildProcessSecurityPolicy::GetInstance()->GrantRequestURL(
196 id(), instance.url()); 201 id(), instance.url());
197 202
198 instances_.push_back(instance); 203 instances_.push_back(instance);
199 Send(new WorkerProcessMsg_CreateWorker(instance.url(), 204
200 instance.shared(), 205 WorkerProcessMsg_CreateWorker_Params params;
201 instance.name(), 206 params.url = instance.url();
202 instance.worker_route_id())); 207 params.is_shared = instance.shared();
208 params.name = instance.name();
209 params.route_id = instance.worker_route_id();
210 params.creator_process_id = 0; // TODO(michaeln): Set these param values.
211 params.creator_appcache_host_id = 0;
212 params.shared_worker_appcache_id = 0;
213 Send(new WorkerProcessMsg_CreateWorker(params));
203 214
204 UpdateTitle(); 215 UpdateTitle();
205 216
206 // Walk all pending senders and let them know the worker has been created 217 // Walk all pending senders and let them know the worker has been created
207 // (could be more than one in the case where we had to queue up worker 218 // (could be more than one in the case where we had to queue up worker
208 // creation because the worker process limit was reached). 219 // creation because the worker process limit was reached).
209 for (WorkerInstance::SenderList::const_iterator i = 220 for (WorkerInstance::SenderList::const_iterator i =
210 instance.senders().begin(); 221 instance.senders().begin();
211 i != instance.senders().end(); ++i) { 222 i != instance.senders().end(); ++i) {
212 i->first->Send(new ViewMsg_WorkerCreated(i->second)); 223 i->first->Send(new ViewMsg_WorkerCreated(i->second));
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 } 597 }
587 } 598 }
588 return false; 599 return false;
589 } 600 }
590 601
591 WorkerProcessHost::WorkerInstance::SenderInfo 602 WorkerProcessHost::WorkerInstance::SenderInfo
592 WorkerProcessHost::WorkerInstance::GetSender() const { 603 WorkerProcessHost::WorkerInstance::GetSender() const {
593 DCHECK(NumSenders() == 1); 604 DCHECK(NumSenders() == 1);
594 return *senders_.begin(); 605 return *senders_.begin();
595 } 606 }
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698