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

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

Issue 1260193009: renderer: implement multiple permission requesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissions-request-multiple
Patch Set: Fix review comments Created 5 years, 3 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
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 main_thread_task_runner_->PostTask( 75 main_thread_task_runner_->PostTask(
76 FROM_HERE, 76 FROM_HERE,
77 base::Bind(&PermissionDispatcher::RequestPermissionForWorker, 77 base::Bind(&PermissionDispatcher::RequestPermissionForWorker,
78 base::Unretained(permission_dispatcher_), 78 base::Unretained(permission_dispatcher_),
79 type, 79 type,
80 origin.string().utf8(), 80 origin.string().utf8(),
81 base::Unretained(callback), 81 base::Unretained(callback),
82 WorkerTaskRunner::Instance()->CurrentWorkerId())); 82 WorkerTaskRunner::Instance()->CurrentWorkerId()));
83 } 83 }
84 84
85 void PermissionDispatcherThreadProxy::requestPermissions(
86 const blink::WebVector<blink::WebPermissionType>& types,
87 const blink::WebURL& origin,
88 blink::WebPermissionsCallback* callback) {
89 main_thread_task_runner_->PostTask(
90 FROM_HERE,
91 base::Bind(&PermissionDispatcher::RequestPermissionsForWorker,
92 base::Unretained(permission_dispatcher_),
93 types,
94 origin.string().utf8(),
95 base::Unretained(callback),
96 WorkerTaskRunner::Instance()->CurrentWorkerId()));
97 }
98
85 void PermissionDispatcherThreadProxy::revokePermission( 99 void PermissionDispatcherThreadProxy::revokePermission(
86 blink::WebPermissionType type, 100 blink::WebPermissionType type,
87 const blink::WebURL& origin, 101 const blink::WebURL& origin,
88 blink::WebPermissionCallback* callback) { 102 blink::WebPermissionCallback* callback) {
89 main_thread_task_runner_->PostTask( 103 main_thread_task_runner_->PostTask(
90 FROM_HERE, 104 FROM_HERE,
91 base::Bind(&PermissionDispatcher::RevokePermissionForWorker, 105 base::Bind(&PermissionDispatcher::RevokePermissionForWorker,
92 base::Unretained(permission_dispatcher_), 106 base::Unretained(permission_dispatcher_),
93 type, 107 type,
94 origin.string().utf8(), 108 origin.string().utf8(),
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 type, 159 type,
146 origin, 160 origin,
147 base::Unretained(observer)))); 161 base::Unretained(observer))));
148 } 162 }
149 163
150 void PermissionDispatcherThreadProxy::OnWorkerRunLoopStopped() { 164 void PermissionDispatcherThreadProxy::OnWorkerRunLoopStopped() {
151 delete this; 165 delete this;
152 } 166 }
153 167
154 } // namespace content 168 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698