| 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 CHROME_RENDERER_WORKER_CONTENT_SETTINGS_CLIENT_H_ | 5 #ifndef CHROME_RENDERER_WORKER_CONTENT_SETTINGS_CLIENT_H_ |
| 6 #define CHROME_RENDERER_WORKER_CONTENT_SETTINGS_CLIENT_H_ | 6 #define CHROME_RENDERER_WORKER_CONTENT_SETTINGS_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "third_party/WebKit/public/platform/WebContentSettingsClient.h" | 10 #include "third_party/WebKit/public/platform/WebContentSettingsClient.h" |
| 11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 12 | 12 |
| 13 namespace IPC { | 13 namespace IPC { |
| 14 class SyncMessageFilter; | 14 class SyncMessageFilter; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class RenderFrame; | 18 class RenderFrame; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 class WebFrame; | |
| 23 class WebSecurityOrigin; | 22 class WebSecurityOrigin; |
| 24 } | 23 } |
| 25 | 24 |
| 26 // This client is created on the main renderer thread then passed onto the | 25 // This client is created on the main renderer thread then passed onto the |
| 27 // blink's worker thread. | 26 // blink's worker thread. |
| 28 class WorkerContentSettingsClient : public blink::WebContentSettingsClient { | 27 class WorkerContentSettingsClient : public blink::WebContentSettingsClient { |
| 29 public: | 28 public: |
| 30 WorkerContentSettingsClient(content::RenderFrame* render_frame, | 29 explicit WorkerContentSettingsClient(content::RenderFrame* render_frame); |
| 31 blink::WebFrame* frame); | |
| 32 ~WorkerContentSettingsClient() override; | 30 ~WorkerContentSettingsClient() override; |
| 33 | 31 |
| 34 // WebContentSettingsClient overrides. | 32 // WebContentSettingsClient overrides. |
| 35 bool RequestFileSystemAccessSync() override; | 33 bool RequestFileSystemAccessSync() override; |
| 36 bool AllowIndexedDB(const blink::WebString& name, | 34 bool AllowIndexedDB(const blink::WebString& name, |
| 37 const blink::WebSecurityOrigin&) override; | 35 const blink::WebSecurityOrigin&) override; |
| 38 | 36 |
| 39 private: | 37 private: |
| 40 // Loading document context for this worker. | 38 // Loading document context for this worker. |
| 41 const int routing_id_; | 39 const int routing_id_; |
| 42 bool is_unique_origin_; | 40 bool is_unique_origin_; |
| 43 GURL document_origin_url_; | 41 GURL document_origin_url_; |
| 44 GURL top_frame_origin_url_; | 42 GURL top_frame_origin_url_; |
| 45 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 43 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
| 46 | 44 |
| 47 DISALLOW_COPY_AND_ASSIGN(WorkerContentSettingsClient); | 45 DISALLOW_COPY_AND_ASSIGN(WorkerContentSettingsClient); |
| 48 }; | 46 }; |
| 49 | 47 |
| 50 #endif // CHROME_RENDERER_WORKER_CONTENT_SETTINGS_CLIENT_H_ | 48 #endif // CHROME_RENDERER_WORKER_CONTENT_SETTINGS_CLIENT_H_ |
| OLD | NEW |