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 #include "content/worker/shared_worker_permission_client_proxy.h" | 5 #include "content/worker/shared_worker_permission_client_proxy.h" |
6 | 6 |
7 #include "content/child/thread_safe_sender.h" | 7 #include "content/child/thread_safe_sender.h" |
8 #include "content/common/worker_messages.h" | 8 #include "content/common/worker_messages.h" |
9 #include "third_party/WebKit/public/platform/WebString.h" | 9 #include "third_party/WebKit/public/platform/WebString.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 SharedWorkerPermissionClientProxy::SharedWorkerPermissionClientProxy( | 14 SharedWorkerPermissionClientProxy::SharedWorkerPermissionClientProxy( |
15 const GURL& origin_url, | 15 const GURL& origin_url, |
16 bool is_unique_origin, | 16 bool is_unique_origin, |
17 int routing_id, | 17 int routing_id, |
18 ThreadSafeSender* thread_safe_sender) | 18 ThreadSafeSender* thread_safe_sender) |
19 : origin_url_(origin_url), | 19 : origin_url_(origin_url), |
20 is_unique_origin_(is_unique_origin), | 20 is_unique_origin_(is_unique_origin), |
21 routing_id_(routing_id), | 21 routing_id_(routing_id), |
22 thread_safe_sender_(thread_safe_sender) { | 22 thread_safe_sender_(thread_safe_sender) { |
23 } | 23 } |
24 | 24 |
25 SharedWorkerPermissionClientProxy::~SharedWorkerPermissionClientProxy() { | 25 SharedWorkerPermissionClientProxy::~SharedWorkerPermissionClientProxy() { |
26 } | 26 } |
27 | 27 |
28 bool SharedWorkerPermissionClientProxy::allowDatabase( | 28 bool SharedWorkerPermissionClientProxy::allowDatabase( |
29 const WebKit::WebString& name, | 29 const blink::WebString& name, |
30 const WebKit::WebString& display_name, | 30 const blink::WebString& display_name, |
31 unsigned long estimated_size) { | 31 unsigned long estimated_size) { |
32 if (is_unique_origin_) | 32 if (is_unique_origin_) |
33 return false; | 33 return false; |
34 bool result = false; | 34 bool result = false; |
35 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowDatabase( | 35 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowDatabase( |
36 routing_id_, origin_url_, name, display_name, | 36 routing_id_, origin_url_, name, display_name, |
37 estimated_size, &result)); | 37 estimated_size, &result)); |
38 return result; | 38 return result; |
39 } | 39 } |
40 | 40 |
41 bool SharedWorkerPermissionClientProxy::allowFileSystem() { | 41 bool SharedWorkerPermissionClientProxy::allowFileSystem() { |
42 if (is_unique_origin_) | 42 if (is_unique_origin_) |
43 return false; | 43 return false; |
44 bool result = false; | 44 bool result = false; |
45 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowFileSystem( | 45 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowFileSystem( |
46 routing_id_, origin_url_, &result)); | 46 routing_id_, origin_url_, &result)); |
47 return result; | 47 return result; |
48 } | 48 } |
49 | 49 |
50 bool SharedWorkerPermissionClientProxy::allowIndexedDB( | 50 bool SharedWorkerPermissionClientProxy::allowIndexedDB( |
51 const WebKit::WebString& name) { | 51 const blink::WebString& name) { |
52 if (is_unique_origin_) | 52 if (is_unique_origin_) |
53 return false; | 53 return false; |
54 bool result = false; | 54 bool result = false; |
55 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowIndexedDB( | 55 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowIndexedDB( |
56 routing_id_, origin_url_, name, &result)); | 56 routing_id_, origin_url_, name, &result)); |
57 return result; | 57 return result; |
58 } | 58 } |
59 | 59 |
60 } // namespace content | 60 } // namespace content |
OLD | NEW |