5092e0c6a96903fe116a8bb3405fd29f182764e0
[platform/framework/web/crosswalk.git] / src / content / renderer / shared_worker_repository.h
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_SHARED_WORKER_REPOSITORY_H_
6 #define CONTENT_RENDERER_SHARED_WORKER_REPOSITORY_H_
7
8 #include <set>
9
10 #include "base/basictypes.h"
11 #include "content/public/renderer/render_frame_observer.h"
12 #include "third_party/WebKit/public/web/WebContentSecurityPolicy.h"
13 #include "third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h"
14
15 namespace content {
16
17 class RenderFrameImpl;
18
19 class SharedWorkerRepository : public RenderFrameObserver,
20                                public blink::WebSharedWorkerRepositoryClient {
21  public:
22   explicit SharedWorkerRepository(RenderFrameImpl* render_frame);
23   ~SharedWorkerRepository() override;
24
25   // WebSharedWorkerRepositoryClient overrides.
26   virtual blink::WebSharedWorkerConnector* createSharedWorkerConnector(
27       const blink::WebURL& url,
28       const blink::WebString& name,
29       DocumentID document_id,
30       const blink::WebString& content_security_policy,
31       blink::WebContentSecurityPolicyType) override;
32   virtual void documentDetached(DocumentID document_id) override;
33
34  private:
35   std::set<DocumentID> documents_with_workers_;
36
37   DISALLOW_COPY_AND_ASSIGN(SharedWorkerRepository);
38 };
39
40 }  // namespace content
41
42 #endif  // CONTENT_RENDERER_SHARED_WORKER_REPOSITORY_H_