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

Side by Side Diff: content/child/permissions/permission_dispatcher_thread_proxy.cc

Issue 1240783002: content: permissions: add plumbing to request permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissions-content-blink
Patch Set: Fix build Created 5 years, 4 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
« no previous file with comments | « content/child/permissions/permission_dispatcher_thread_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/child/permissions/permission_dispatcher_thread_proxy.h" 5 #include "content/child/permissions/permission_dispatcher_thread_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 main_thread_task_runner_->PostTask( 61 main_thread_task_runner_->PostTask(
62 FROM_HERE, 62 FROM_HERE,
63 base::Bind(&PermissionDispatcher::QueryPermissionForWorker, 63 base::Bind(&PermissionDispatcher::QueryPermissionForWorker,
64 base::Unretained(permission_dispatcher_), 64 base::Unretained(permission_dispatcher_),
65 type, 65 type,
66 origin.string().utf8(), 66 origin.string().utf8(),
67 base::Unretained(callback), 67 base::Unretained(callback),
68 WorkerTaskRunner::Instance()->CurrentWorkerId())); 68 WorkerTaskRunner::Instance()->CurrentWorkerId()));
69 } 69 }
70 70
71 void PermissionDispatcherThreadProxy::requestPermission(
72 blink::WebPermissionType type,
73 const blink::WebURL& origin,
74 blink::WebPermissionCallback* callback) {
75 main_thread_task_runner_->PostTask(
76 FROM_HERE,
77 base::Bind(&PermissionDispatcher::RequestPermissionForWorker,
78 base::Unretained(permission_dispatcher_),
79 type,
80 origin.string().utf8(),
81 base::Unretained(callback),
82 WorkerTaskRunner::Instance()->CurrentWorkerId()));
83 }
84
71 void PermissionDispatcherThreadProxy::revokePermission( 85 void PermissionDispatcherThreadProxy::revokePermission(
72 blink::WebPermissionType type, 86 blink::WebPermissionType type,
73 const blink::WebURL& origin, 87 const blink::WebURL& origin,
74 blink::WebPermissionCallback* callback) { 88 blink::WebPermissionCallback* callback) {
75 main_thread_task_runner_->PostTask( 89 main_thread_task_runner_->PostTask(
76 FROM_HERE, 90 FROM_HERE,
77 base::Bind(&PermissionDispatcher::RevokePermissionForWorker, 91 base::Bind(&PermissionDispatcher::RevokePermissionForWorker,
78 base::Unretained(permission_dispatcher_), 92 base::Unretained(permission_dispatcher_),
79 type, 93 type,
80 origin.string().utf8(), 94 origin.string().utf8(),
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 type, 145 type,
132 origin, 146 origin,
133 base::Unretained(observer)))); 147 base::Unretained(observer))));
134 } 148 }
135 149
136 void PermissionDispatcherThreadProxy::OnWorkerRunLoopStopped() { 150 void PermissionDispatcherThreadProxy::OnWorkerRunLoopStopped() {
137 delete this; 151 delete this;
138 } 152 }
139 153
140 } // namespace content 154 } // namespace content
OLDNEW
« no previous file with comments | « content/child/permissions/permission_dispatcher_thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698