| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SHARED_WORKER_SHARED_WORKER_REPOSITORY_H_ | 5 #ifndef CONTENT_RENDERER_SHARED_WORKER_SHARED_WORKER_REPOSITORY_H_ |
| 6 #define CONTENT_RENDERER_SHARED_WORKER_SHARED_WORKER_REPOSITORY_H_ | 6 #define CONTENT_RENDERER_SHARED_WORKER_SHARED_WORKER_REPOSITORY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "third_party/WebKit/public/platform/WebAddressSpace.h" | 12 #include "third_party/WebKit/public/platform/WebAddressSpace.h" |
| 13 #include "third_party/WebKit/public/web/WebContentSecurityPolicy.h" | 13 #include "third_party/WebKit/public/web/WebContentSecurityPolicy.h" |
| 14 #include "third_party/WebKit/public/web/WebSharedWorkerCreationContextType.h" | 14 #include "third_party/WebKit/public/web/WebSharedWorkerCreationContextType.h" |
| 15 #include "third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h" | 15 #include "third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 class RenderFrameImpl; | 19 class RenderFrameImpl; |
| 20 | 20 |
| 21 class SharedWorkerRepository final | 21 class SharedWorkerRepository final |
| 22 : public blink::WebSharedWorkerRepositoryClient { | 22 : public blink::WebSharedWorkerRepositoryClient { |
| 23 public: | 23 public: |
| 24 explicit SharedWorkerRepository(RenderFrameImpl* render_frame); | 24 explicit SharedWorkerRepository(RenderFrameImpl* render_frame); |
| 25 ~SharedWorkerRepository(); | 25 ~SharedWorkerRepository(); |
| 26 | 26 |
| 27 // WebSharedWorkerRepositoryClient overrides. | 27 // WebSharedWorkerRepositoryClient overrides. |
| 28 std::unique_ptr<blink::WebSharedWorkerConnector> createSharedWorkerConnector( | 28 void connect( |
| 29 const blink::WebURL& url, | 29 const blink::WebURL& url, |
| 30 const blink::WebString& name, | 30 const blink::WebString& name, |
| 31 DocumentID document_id, | 31 DocumentID document_id, |
| 32 const blink::WebString& content_security_policy, | 32 const blink::WebString& content_security_policy, |
| 33 blink::WebContentSecurityPolicyType, | 33 blink::WebContentSecurityPolicyType, |
| 34 blink::WebAddressSpace, | 34 blink::WebAddressSpace, |
| 35 blink::WebSharedWorkerCreationContextType, | 35 blink::WebSharedWorkerCreationContextType, |
| 36 blink::WebWorkerCreationError* error) override; | 36 blink::WebMessagePortChannel* channel, |
| 37 std::unique_ptr<blink::WebSharedWorkerConnectListener> listener) override; |
| 37 void documentDetached(DocumentID document_id) override; | 38 void documentDetached(DocumentID document_id) override; |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 RenderFrameImpl* render_frame_; | 41 RenderFrameImpl* render_frame_; |
| 41 std::set<DocumentID> documents_with_workers_; | 42 std::set<DocumentID> documents_with_workers_; |
| 42 | 43 |
| 43 DISALLOW_COPY_AND_ASSIGN(SharedWorkerRepository); | 44 DISALLOW_COPY_AND_ASSIGN(SharedWorkerRepository); |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 } // namespace content | 47 } // namespace content |
| 47 | 48 |
| 48 #endif // CONTENT_RENDERER_SHARED_WORKER_SHARED_WORKER_REPOSITORY_H_ | 49 #endif // CONTENT_RENDERER_SHARED_WORKER_SHARED_WORKER_REPOSITORY_H_ |
| OLD | NEW |