[email protected] | f44f18c | 2010-07-31 15:33:32 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
[email protected] | ab350536 | 2009-10-30 18:11:47 | [diff] [blame] | 4 | |
[email protected] | 6f51608 | 2011-03-17 19:15:35 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_WEBSHAREDWORKERREPOSITORY_IMPL_H_ |
6 | #define CONTENT_RENDERER_WEBSHAREDWORKERREPOSITORY_IMPL_H_ | ||||
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 7 | #pragma once |
[email protected] | ab350536 | 2009-10-30 18:11:47 | [diff] [blame] | 8 | |
[email protected] | 8bd0fe6 | 2011-01-17 06:44:37 | [diff] [blame] | 9 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorkerRepository.h" |
[email protected] | ab350536 | 2009-10-30 18:11:47 | [diff] [blame] | 10 | |
[email protected] | 30447b6 | 2009-11-13 01:13:37 | [diff] [blame] | 11 | #include "base/hash_tables.h" |
12 | |||||
[email protected] | 30a7187 | 2009-10-31 16:09:21 | [diff] [blame] | 13 | namespace WebKit { |
[email protected] | f44f18c | 2010-07-31 15:33:32 | [diff] [blame] | 14 | class WebSharedWorker; |
[email protected] | 30a7187 | 2009-10-31 16:09:21 | [diff] [blame] | 15 | } |
[email protected] | ab350536 | 2009-10-30 18:11:47 | [diff] [blame] | 16 | |
17 | class WebSharedWorkerRepositoryImpl : public WebKit::WebSharedWorkerRepository { | ||||
[email protected] | 30447b6 | 2009-11-13 01:13:37 | [diff] [blame] | 18 | public: |
[email protected] | 38e0898 | 2010-10-22 17:28:43 | [diff] [blame] | 19 | WebSharedWorkerRepositoryImpl(); |
20 | virtual ~WebSharedWorkerRepositoryImpl(); | ||||
[email protected] | 8e4f010 | 2010-07-30 23:42:43 | [diff] [blame] | 21 | |
[email protected] | f44f18c | 2010-07-31 15:33:32 | [diff] [blame] | 22 | virtual void addSharedWorker(WebKit::WebSharedWorker*, DocumentID document); |
23 | virtual void documentDetached(DocumentID document); | ||||
[email protected] | 30447b6 | 2009-11-13 01:13:37 | [diff] [blame] | 24 | |
[email protected] | f44f18c | 2010-07-31 15:33:32 | [diff] [blame] | 25 | // Returns true if the document has created a SharedWorker (used by the |
26 | // WebKit code to determine if the document can be suspended). | ||||
27 | virtual bool hasSharedWorkers(DocumentID document); | ||||
[email protected] | 8e4f010 | 2010-07-30 23:42:43 | [diff] [blame] | 28 | |
[email protected] | 30447b6 | 2009-11-13 01:13:37 | [diff] [blame] | 29 | private: |
[email protected] | f44f18c | 2010-07-31 15:33:32 | [diff] [blame] | 30 | // The set of documents that have created a SharedWorker. |
31 | typedef base::hash_set<DocumentID> DocumentSet; | ||||
32 | DocumentSet shared_worker_parents_; | ||||
[email protected] | ab350536 | 2009-10-30 18:11:47 | [diff] [blame] | 33 | }; |
34 | |||||
[email protected] | 6f51608 | 2011-03-17 19:15:35 | [diff] [blame] | 35 | #endif // CONTENT_RENDERER_WEBSHAREDWORKERREPOSITORY_IMPL_H_ |