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

Side by Side Diff: content/browser/worker_host/worker_service_impl.cc

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix chromeos ui_tests 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/worker_host/worker_service_impl.h" 5 #include "content/browser/worker_host/worker_service_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 iter->GetFilter(); 277 iter->GetFilter();
278 instance.AddFilter(filter_info.first, filter_info.second); 278 instance.AddFilter(filter_info.first, filter_info.second);
279 iter = queued_workers_.erase(iter); 279 iter = queued_workers_.erase(iter);
280 } else { 280 } else {
281 ++iter; 281 ++iter;
282 } 282 }
283 } 283 }
284 284
285 if (!worker) { 285 if (!worker) {
286 WorkerMessageFilter* first_filter = instance.filters().begin()->first; 286 WorkerMessageFilter* first_filter = instance.filters().begin()->first;
287 worker = new WorkerProcessHost( 287 worker = new WorkerProcessHost(instance.resource_context());
288 instance.resource_context(),
289 first_filter->resource_dispatcher_host());
290 // TODO(atwilson): This won't work if the message is from a worker process. 288 // TODO(atwilson): This won't work if the message is from a worker process.
291 // We don't support that yet though (this message is only sent from 289 // We don't support that yet though (this message is only sent from
292 // renderers) but when we do, we'll need to add code to pass in the current 290 // renderers) but when we do, we'll need to add code to pass in the current
293 // worker's document set for nested workers. 291 // worker's document set for nested workers.
294 if (!worker->Init(first_filter->render_process_id())) { 292 if (!worker->Init(first_filter->render_process_id())) {
295 delete worker; 293 delete worker;
296 return false; 294 return false;
297 } 295 }
298 } 296 }
299 297
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 if (instance) 553 if (instance)
556 return instance; 554 return instance;
557 555
558 // No existing pending worker - create a new one. 556 // No existing pending worker - create a new one.
559 WorkerProcessHost::WorkerInstance pending(url, true, name, resource_context); 557 WorkerProcessHost::WorkerInstance pending(url, true, name, resource_context);
560 pending_shared_workers_.push_back(pending); 558 pending_shared_workers_.push_back(pending);
561 return &pending_shared_workers_.back(); 559 return &pending_shared_workers_.back();
562 } 560 }
563 561
564 } // namespace content 562 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698