OLD | NEW |
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 "content/browser/worker_host/worker_document_set.h" | 5 #include "content/browser/worker_host/worker_document_set.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 bool WorkerDocumentSet::Contains(BrowserMessageFilter* parent, | 22 bool WorkerDocumentSet::Contains(BrowserMessageFilter* parent, |
23 unsigned long long document_id) const { | 23 unsigned long long document_id) const { |
24 for (DocumentInfoSet::const_iterator i = document_set_.begin(); | 24 for (DocumentInfoSet::const_iterator i = document_set_.begin(); |
25 i != document_set_.end(); ++i) { | 25 i != document_set_.end(); ++i) { |
26 if (i->filter() == parent && i->document_id() == document_id) | 26 if (i->filter() == parent && i->document_id() == document_id) |
27 return true; | 27 return true; |
28 } | 28 } |
29 return false; | 29 return false; |
30 } | 30 } |
31 | 31 |
| 32 bool WorkerDocumentSet::ContainsExternalRenderer( |
| 33 int worker_process_id) const { |
| 34 for (DocumentInfoSet::const_iterator i = document_set_.begin(); |
| 35 i != document_set_.end(); ++i) { |
| 36 if (i->render_process_id() != worker_process_id) |
| 37 return true; |
| 38 } |
| 39 return false; |
| 40 } |
| 41 |
32 void WorkerDocumentSet::Remove(BrowserMessageFilter* parent, | 42 void WorkerDocumentSet::Remove(BrowserMessageFilter* parent, |
33 unsigned long long document_id) { | 43 unsigned long long document_id) { |
34 for (DocumentInfoSet::iterator i = document_set_.begin(); | 44 for (DocumentInfoSet::iterator i = document_set_.begin(); |
35 i != document_set_.end(); i++) { | 45 i != document_set_.end(); i++) { |
36 if (i->filter() == parent && i->document_id() == document_id) { | 46 if (i->filter() == parent && i->document_id() == document_id) { |
37 document_set_.erase(i); | 47 document_set_.erase(i); |
38 break; | 48 break; |
39 } | 49 } |
40 } | 50 } |
41 // Should not be duplicate copies in the document set. | 51 // Should not be duplicate copies in the document set. |
(...skipping 22 matching lines...) Expand all Loading... |
64 : filter_(filter), | 74 : filter_(filter), |
65 document_id_(document_id), | 75 document_id_(document_id), |
66 render_process_id_(render_process_id), | 76 render_process_id_(render_process_id), |
67 render_frame_id_(render_frame_id) { | 77 render_frame_id_(render_frame_id) { |
68 } | 78 } |
69 | 79 |
70 WorkerDocumentSet::~WorkerDocumentSet() { | 80 WorkerDocumentSet::~WorkerDocumentSet() { |
71 } | 81 } |
72 | 82 |
73 } // namespace content | 83 } // namespace content |
OLD | NEW |