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_RENDERER_WEBSHAREDWORKERREPOSITORY_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_WEBSHAREDWORKERREPOSITORY_IMPL_H_ |
6 #define CONTENT_RENDERER_WEBSHAREDWORKERREPOSITORY_IMPL_H_ | 6 #define CONTENT_RENDERER_WEBSHAREDWORKERREPOSITORY_IMPL_H_ |
7 | 7 |
| 8 #include "base/containers/hash_tables.h" |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorkerReposi
tory.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorkerReposi
tory.h" |
9 | 10 |
10 #include "base/hash_tables.h" | |
11 | |
12 namespace WebKit { | 11 namespace WebKit { |
13 class WebSharedWorker; | 12 class WebSharedWorker; |
14 } | 13 } |
15 | 14 |
16 namespace content { | 15 namespace content { |
17 | 16 |
18 class WebSharedWorkerRepositoryImpl : public WebKit::WebSharedWorkerRepository { | 17 class WebSharedWorkerRepositoryImpl : public WebKit::WebSharedWorkerRepository { |
19 public: | 18 public: |
20 WebSharedWorkerRepositoryImpl(); | 19 WebSharedWorkerRepositoryImpl(); |
21 virtual ~WebSharedWorkerRepositoryImpl(); | 20 virtual ~WebSharedWorkerRepositoryImpl(); |
22 | 21 |
23 virtual void addSharedWorker(WebKit::WebSharedWorker*, DocumentID document); | 22 virtual void addSharedWorker(WebKit::WebSharedWorker*, DocumentID document); |
24 virtual void documentDetached(DocumentID document); | 23 virtual void documentDetached(DocumentID document); |
25 | 24 |
26 // Returns true if the document has created a SharedWorker (used by the | 25 // Returns true if the document has created a SharedWorker (used by the |
27 // WebKit code to determine if the document can be suspended). | 26 // WebKit code to determine if the document can be suspended). |
28 virtual bool hasSharedWorkers(DocumentID document); | 27 virtual bool hasSharedWorkers(DocumentID document); |
29 | 28 |
30 private: | 29 private: |
31 // The set of documents that have created a SharedWorker. | 30 // The set of documents that have created a SharedWorker. |
32 typedef base::hash_set<DocumentID> DocumentSet; | 31 typedef base::hash_set<DocumentID> DocumentSet; |
33 DocumentSet shared_worker_parents_; | 32 DocumentSet shared_worker_parents_; |
34 }; | 33 }; |
35 | 34 |
36 } // namespace content | 35 } // namespace content |
37 | 36 |
38 #endif // CONTENT_RENDERER_WEBSHAREDWORKERREPOSITORY_IMPL_H_ | 37 #endif // CONTENT_RENDERER_WEBSHAREDWORKERREPOSITORY_IMPL_H_ |
OLD | NEW |