| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_WORKER_HOST_WORKER_DOCUMENT_SET_H_ | 5 #ifndef CONTENT_BROWSER_WORKER_HOST_WORKER_DOCUMENT_SET_H_ |
| 6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_DOCUMENT_SET_H_ | 6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_DOCUMENT_SET_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // communication with the parent tab for things like http auth dialogs. | 57 // communication with the parent tab for things like http auth dialogs. |
| 58 void Add(BrowserMessageFilter* parent, | 58 void Add(BrowserMessageFilter* parent, |
| 59 unsigned long long document_id, | 59 unsigned long long document_id, |
| 60 int render_process_id, | 60 int render_process_id, |
| 61 int render_frame_id); | 61 int render_frame_id); |
| 62 | 62 |
| 63 // Checks to see if a document is in a shared worker's document set. | 63 // Checks to see if a document is in a shared worker's document set. |
| 64 bool Contains(BrowserMessageFilter* parent, | 64 bool Contains(BrowserMessageFilter* parent, |
| 65 unsigned long long document_id) const; | 65 unsigned long long document_id) const; |
| 66 | 66 |
| 67 // Checks to see if the document set contains any documents which is |
| 68 // associated with other renderer process than worker_process_id. |
| 69 bool ContainsExternalRenderer(int worker_process_id) const; |
| 70 |
| 67 // Removes a specific document from a worker's document set when that document | 71 // Removes a specific document from a worker's document set when that document |
| 68 // is detached. | 72 // is detached. |
| 69 void Remove(BrowserMessageFilter* parent, unsigned long long document_id); | 73 void Remove(BrowserMessageFilter* parent, unsigned long long document_id); |
| 70 | 74 |
| 71 // Invoked when a render process exits, to remove all associated documents | 75 // Invoked when a render process exits, to remove all associated documents |
| 72 // from a worker's document set. | 76 // from a worker's document set. |
| 73 void RemoveAll(BrowserMessageFilter* parent); | 77 void RemoveAll(BrowserMessageFilter* parent); |
| 74 | 78 |
| 75 bool IsEmpty() const { return document_set_.empty(); } | 79 bool IsEmpty() const { return document_set_.empty(); } |
| 76 | 80 |
| 77 // Define a typedef for convenience here when declaring iterators, etc. | 81 // Define a typedef for convenience here when declaring iterators, etc. |
| 78 typedef std::set<DocumentInfo> DocumentInfoSet; | 82 typedef std::set<DocumentInfo> DocumentInfoSet; |
| 79 | 83 |
| 80 // Returns the set of documents associated with this worker. | 84 // Returns the set of documents associated with this worker. |
| 81 const DocumentInfoSet& documents() { return document_set_; } | 85 const DocumentInfoSet& documents() { return document_set_; } |
| 82 | 86 |
| 83 private: | 87 private: |
| 84 friend class base::RefCounted<WorkerDocumentSet>; | 88 friend class base::RefCounted<WorkerDocumentSet>; |
| 85 virtual ~WorkerDocumentSet(); | 89 virtual ~WorkerDocumentSet(); |
| 86 | 90 |
| 87 DocumentInfoSet document_set_; | 91 DocumentInfoSet document_set_; |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 } // namespace content | 94 } // namespace content |
| 91 | 95 |
| 92 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_DOCUMENT_SET_H_ | 96 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_DOCUMENT_SET_H_ |
| OLD | NEW |