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

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

Issue 10828033: Fix crash in WorkerTest.MultipleTabsQueuedSharedWorker. I could get this consistently when running … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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_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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 for (WorkerProcessHost::Instances::iterator i = queued_workers_.begin(); 55 for (WorkerProcessHost::Instances::iterator i = queued_workers_.begin();
56 i != queued_workers_.end();) { 56 i != queued_workers_.end();) {
57 i->RemoveFilters(filter); 57 i->RemoveFilters(filter);
58 if (i->NumFilters() == 0) { 58 if (i->NumFilters() == 0) {
59 i = queued_workers_.erase(i); 59 i = queued_workers_.erase(i);
60 } else { 60 } else {
61 ++i; 61 ++i;
62 } 62 }
63 } 63 }
64 64
65 for (WorkerProcessHost::Instances::iterator i =
Andrew T Wilson (Slow) 2012/07/26 17:20:40 Can we clarify what this is doing? Looks like we'r
jam 2012/07/26 17:26:59 I don't claim to understand the worker document se
66 pending_shared_workers_.begin();
67 i != pending_shared_workers_.end(); ) {
68 i->RemoveFilters(filter);
69 if (i->NumFilters() == 0) {
70 i = pending_shared_workers_.erase(i);
71 } else {
72 ++i;
73 }
74 }
75
65 // Also, see if that process had any pending shared workers. 76 // Also, see if that process had any pending shared workers.
66 for (WorkerProcessHost::Instances::iterator iter = 77 for (WorkerProcessHost::Instances::iterator iter =
67 pending_shared_workers_.begin(); 78 pending_shared_workers_.begin();
68 iter != pending_shared_workers_.end(); ) { 79 iter != pending_shared_workers_.end(); ) {
69 iter->worker_document_set()->RemoveAll(filter); 80 iter->worker_document_set()->RemoveAll(filter);
70 if (iter->worker_document_set()->IsEmpty()) { 81 if (iter->worker_document_set()->IsEmpty()) {
71 iter = pending_shared_workers_.erase(iter); 82 iter = pending_shared_workers_.erase(iter);
72 } else { 83 } else {
73 ++iter; 84 ++iter;
74 } 85 }
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 if (instance) 573 if (instance)
563 return instance; 574 return instance;
564 575
565 // No existing pending worker - create a new one. 576 // No existing pending worker - create a new one.
566 WorkerProcessHost::WorkerInstance pending(url, true, name, resource_context); 577 WorkerProcessHost::WorkerInstance pending(url, true, name, resource_context);
567 pending_shared_workers_.push_back(pending); 578 pending_shared_workers_.push_back(pending);
568 return &pending_shared_workers_.back(); 579 return &pending_shared_workers_.back();
569 } 580 }
570 581
571 } // namespace content 582 } // namespace content
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