OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_SHARED_WORKER_WORKER_DOCUMENT_SET_H_ | 5 #ifndef CONTENT_BROWSER_SHARED_WORKER_WORKER_DOCUMENT_SET_H_ |
6 #define CONTENT_BROWSER_SHARED_WORKER_WORKER_DOCUMENT_SET_H_ | 6 #define CONTENT_BROWSER_SHARED_WORKER_WORKER_DOCUMENT_SET_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool ContainsExternalRenderer(int worker_process_id) const; | 68 bool ContainsExternalRenderer(int worker_process_id) const; |
69 | 69 |
70 // Removes a specific document from a worker's document set when that document | 70 // Removes a specific document from a worker's document set when that document |
71 // is detached. | 71 // is detached. |
72 void Remove(BrowserMessageFilter* parent, unsigned long long document_id); | 72 void Remove(BrowserMessageFilter* parent, unsigned long long document_id); |
73 | 73 |
74 // Invoked when a render process exits, to remove all associated documents | 74 // Invoked when a render process exits, to remove all associated documents |
75 // from a worker's document set. | 75 // from a worker's document set. |
76 void RemoveAll(BrowserMessageFilter* parent); | 76 void RemoveAll(BrowserMessageFilter* parent); |
77 | 77 |
| 78 // Invoked when a render frame is deleted, to remove all associated documents |
| 79 // from a worker's document set. |
| 80 void RemoveRenderFrame(int render_process_id, int render_frame_id); |
| 81 |
78 bool IsEmpty() const { return document_set_.empty(); } | 82 bool IsEmpty() const { return document_set_.empty(); } |
79 | 83 |
80 // Define a typedef for convenience here when declaring iterators, etc. | 84 // Define a typedef for convenience here when declaring iterators, etc. |
81 using DocumentInfoSet = std::set<DocumentInfo>; | 85 using DocumentInfoSet = std::set<DocumentInfo>; |
82 | 86 |
83 // Returns the set of documents associated with this worker. | 87 // Returns the set of documents associated with this worker. |
84 const DocumentInfoSet& documents() { return document_set_; } | 88 const DocumentInfoSet& documents() { return document_set_; } |
85 | 89 |
86 private: | 90 private: |
87 friend class base::RefCounted<WorkerDocumentSet>; | 91 friend class base::RefCounted<WorkerDocumentSet>; |
88 virtual ~WorkerDocumentSet(); | 92 virtual ~WorkerDocumentSet(); |
89 | 93 |
90 DocumentInfoSet document_set_; | 94 DocumentInfoSet document_set_; |
91 }; | 95 }; |
92 | 96 |
93 } // namespace content | 97 } // namespace content |
94 | 98 |
95 #endif // CONTENT_BROWSER_SHARED_WORKER_WORKER_DOCUMENT_SET_H_ | 99 #endif // CONTENT_BROWSER_SHARED_WORKER_WORKER_DOCUMENT_SET_H_ |
OLD | NEW |