Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Side by Side Diff: content/renderer/shared_worker/embedded_shared_worker_permission_client_proxy.cc

Issue 318013002: Implement EmbeddedSharedWorkerPermissionClientProxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/renderer/shared_worker/embedded_shared_worker_permission_clien t_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 EmbeddedSharedWorkerPermissionClientProxy::
15 const GURL& origin_url, 15 EmbeddedSharedWorkerPermissionClientProxy(
16 bool is_unique_origin, 16 const GURL& origin_url,
17 int routing_id, 17 bool is_unique_origin,
18 ThreadSafeSender* thread_safe_sender) 18 int routing_id,
19 ThreadSafeSender* thread_safe_sender)
19 : origin_url_(origin_url), 20 : origin_url_(origin_url),
20 is_unique_origin_(is_unique_origin), 21 is_unique_origin_(is_unique_origin),
21 routing_id_(routing_id), 22 routing_id_(routing_id),
22 thread_safe_sender_(thread_safe_sender) { 23 thread_safe_sender_(thread_safe_sender) {
23 } 24 }
24 25
25 SharedWorkerPermissionClientProxy::~SharedWorkerPermissionClientProxy() { 26 EmbeddedSharedWorkerPermissionClientProxy::
27 ~EmbeddedSharedWorkerPermissionClientProxy() {
26 } 28 }
27 29
28 bool SharedWorkerPermissionClientProxy::allowDatabase( 30 bool EmbeddedSharedWorkerPermissionClientProxy::allowDatabase(
29 const blink::WebString& name, 31 const blink::WebString& name,
30 const blink::WebString& display_name, 32 const blink::WebString& display_name,
31 unsigned long estimated_size) { 33 unsigned long estimated_size) {
32 if (is_unique_origin_) 34 if (is_unique_origin_)
33 return false; 35 return false;
34 bool result = false; 36 bool result = false;
35 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowDatabase( 37 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowDatabase(
36 routing_id_, origin_url_, name, display_name, 38 routing_id_, origin_url_, name, display_name, estimated_size, &result));
37 estimated_size, &result));
38 return result; 39 return result;
39 } 40 }
40 41
41 bool SharedWorkerPermissionClientProxy::requestFileSystemAccessSync() { 42 bool EmbeddedSharedWorkerPermissionClientProxy::requestFileSystemAccessSync() {
42 if (is_unique_origin_) 43 if (is_unique_origin_)
43 return false; 44 return false;
44 bool result = false; 45 bool result = false;
45 thread_safe_sender_->Send( 46 thread_safe_sender_->Send(
46 new WorkerProcessHostMsg_RequestFileSystemAccessSync( 47 new WorkerProcessHostMsg_RequestFileSystemAccessSync(
47 routing_id_, origin_url_, &result)); 48 routing_id_, origin_url_, &result));
48 return result; 49 return result;
49 } 50 }
50 51
51 bool SharedWorkerPermissionClientProxy::allowIndexedDB( 52 bool EmbeddedSharedWorkerPermissionClientProxy::allowIndexedDB(
52 const blink::WebString& name) { 53 const blink::WebString& name) {
53 if (is_unique_origin_) 54 if (is_unique_origin_)
54 return false; 55 return false;
55 bool result = false; 56 bool result = false;
56 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowIndexedDB( 57 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowIndexedDB(
57 routing_id_, origin_url_, name, &result)); 58 routing_id_, origin_url_, name, &result));
58 return result; 59 return result;
59 } 60 }
60 61
61 } // namespace content 62 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698