OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #ifndef CHROME_RENDERER_WEB_SHARED_WORKER_REPOSITORY_IMPL_H_ | 5 #ifndef CHROME_RENDERER_WEB_SHARED_WORKER_REPOSITORY_IMPL_H_ |
6 #define CHROME_RENDERER_WEB_SHARED_WORKER_REPOSITORY_IMPL_H_ | 6 #define CHROME_RENDERER_WEB_SHARED_WORKER_REPOSITORY_IMPL_H_ |
7 | 7 |
8 #include "third_party/WebKit/WebKit/chromium/public/WebSharedWorkerRepository.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebSharedWorkerRepository.h" |
9 | 9 |
| 10 #include "base/hash_tables.h" |
| 11 |
10 namespace WebKit { | 12 namespace WebKit { |
11 class WebSharedWorker; | 13 class WebSharedWorker; |
12 } | 14 } |
13 | 15 |
14 class WebSharedWorkerRepositoryImpl : public WebKit::WebSharedWorkerRepository { | 16 class WebSharedWorkerRepositoryImpl : public WebKit::WebSharedWorkerRepository { |
| 17 public: |
15 virtual void addSharedWorker(WebKit::WebSharedWorker*, DocumentID document); | 18 virtual void addSharedWorker(WebKit::WebSharedWorker*, DocumentID document); |
16 virtual void documentDetached(DocumentID document); | 19 virtual void documentDetached(DocumentID document); |
| 20 |
| 21 // Returns true if the document has created a SharedWorker (used by the |
| 22 // WebKit code to determine if the document can be suspended). |
17 virtual bool hasSharedWorkers(DocumentID document); | 23 virtual bool hasSharedWorkers(DocumentID document); |
| 24 private: |
| 25 // The set of documents that have created a SharedWorker. |
| 26 typedef base::hash_set<DocumentID> DocumentSet; |
| 27 DocumentSet shared_worker_parents_; |
18 }; | 28 }; |
19 | 29 |
20 #endif // CHROME_RENDERER_WEB_SHARED_WORKER_REPOSITORY_IMPL_H_ | 30 #endif // CHROME_RENDERER_WEB_SHARED_WORKER_REPOSITORY_IMPL_H_ |
OLD | NEW |