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