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"
14 SharedWorkerPermissionClientProxy::SharedWorkerPermissionClientProxy(
15 const GURL& origin_url,
17 ThreadSafeSender* thread_safe_sender)
18 : origin_url_(origin_url),
19 routing_id_(routing_id),
20 thread_safe_sender_(thread_safe_sender) {
23 SharedWorkerPermissionClientProxy::~SharedWorkerPermissionClientProxy() {
26 bool SharedWorkerPermissionClientProxy::allowDatabase(
27 const WebKit::WebString& name,
28 const WebKit::WebString& display_name,
29 unsigned long estimated_size) {
31 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowDatabase(
32 routing_id_, origin_url_, name, display_name,
33 estimated_size, &result));
37 bool SharedWorkerPermissionClientProxy::allowFileSystem() {
39 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowFileSystem(
40 routing_id_, origin_url_, &result));
44 bool SharedWorkerPermissionClientProxy::allowIndexedDB(
45 const WebKit::WebString& name) {
47 thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowIndexedDB(
48 routing_id_, origin_url_, name, &result));
52 } // namespace content