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

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

Issue 10545127: Added asserts to track crbug.com/124695 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_process_host.h" 5 #include "content/browser/worker_host/worker_process_host.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 Send(new WorkerProcessMsg_CreateWorker(params)); 303 Send(new WorkerProcessMsg_CreateWorker(params));
304 304
305 UpdateTitle(); 305 UpdateTitle();
306 306
307 // Walk all pending filters and let them know the worker has been created 307 // Walk all pending filters and let them know the worker has been created
308 // (could be more than one in the case where we had to queue up worker 308 // (could be more than one in the case where we had to queue up worker
309 // creation because the worker process limit was reached). 309 // creation because the worker process limit was reached).
310 for (WorkerInstance::FilterList::const_iterator i = 310 for (WorkerInstance::FilterList::const_iterator i =
311 instance.filters().begin(); 311 instance.filters().begin();
312 i != instance.filters().end(); ++i) { 312 i != instance.filters().end(); ++i) {
313 CHECK(i->first);
313 i->first->Send(new ViewMsg_WorkerCreated(i->second)); 314 i->first->Send(new ViewMsg_WorkerCreated(i->second));
314 } 315 }
315 } 316 }
316 317
317 bool WorkerProcessHost::FilterMessage(const IPC::Message& message, 318 bool WorkerProcessHost::FilterMessage(const IPC::Message& message,
318 WorkerMessageFilter* filter) { 319 WorkerMessageFilter* filter) {
319 for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) { 320 for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) {
320 if (!i->closed() && i->HasFilter(filter, message.routing_id())) { 321 if (!i->closed() && i->HasFilter(filter, message.routing_id())) {
321 RelayMessage(message, worker_message_filter_, i->worker_route_id()); 322 RelayMessage(message, worker_message_filter_, i->worker_route_id());
322 return true; 323 return true;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 return false; 629 return false;
629 630
630 if (name_.empty() && match_name.empty()) 631 if (name_.empty() && match_name.empty())
631 return url_ == match_url; 632 return url_ == match_url;
632 633
633 return name_ == match_name; 634 return name_ == match_name;
634 } 635 }
635 636
636 void WorkerProcessHost::WorkerInstance::AddFilter(WorkerMessageFilter* filter, 637 void WorkerProcessHost::WorkerInstance::AddFilter(WorkerMessageFilter* filter,
637 int route_id) { 638 int route_id) {
639 CHECK(filter);
638 if (!HasFilter(filter, route_id)) { 640 if (!HasFilter(filter, route_id)) {
639 FilterInfo info(filter, route_id); 641 FilterInfo info(filter, route_id);
640 filters_.push_back(info); 642 filters_.push_back(info);
641 } 643 }
642 } 644 }
643 645
644 void WorkerProcessHost::WorkerInstance::RemoveFilter( 646 void WorkerProcessHost::WorkerInstance::RemoveFilter(
645 WorkerMessageFilter* filter, int route_id) { 647 WorkerMessageFilter* filter, int route_id) {
646 for (FilterList::iterator i = filters_.begin(); i != filters_.end();) { 648 for (FilterList::iterator i = filters_.begin(); i != filters_.end();) {
647 if (i->first == filter && i->second == route_id) 649 if (i->first == filter && i->second == route_id)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 } 688 }
687 } 689 }
688 return false; 690 return false;
689 } 691 }
690 692
691 WorkerProcessHost::WorkerInstance::FilterInfo 693 WorkerProcessHost::WorkerInstance::FilterInfo
692 WorkerProcessHost::WorkerInstance::GetFilter() const { 694 WorkerProcessHost::WorkerInstance::GetFilter() const {
693 DCHECK(NumFilters() == 1); 695 DCHECK(NumFilters() == 1);
694 return *filters_.begin(); 696 return *filters_.begin();
695 } 697 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698