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

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

Issue 1238673002: content: permissions: add plumbing to revoke permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update entire histograms file Created 5 years, 5 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 g_permission_dispatcher_tls.Pointer()->Set(this); 50 g_permission_dispatcher_tls.Pointer()->Set(this);
51 } 51 }
52 52
53 PermissionDispatcherThreadProxy::~PermissionDispatcherThreadProxy() { 53 PermissionDispatcherThreadProxy::~PermissionDispatcherThreadProxy() {
54 g_permission_dispatcher_tls.Pointer()->Set(nullptr); 54 g_permission_dispatcher_tls.Pointer()->Set(nullptr);
55 } 55 }
56 56
57 void PermissionDispatcherThreadProxy::queryPermission( 57 void PermissionDispatcherThreadProxy::queryPermission(
58 blink::WebPermissionType type, 58 blink::WebPermissionType type,
59 const blink::WebURL& origin, 59 const blink::WebURL& origin,
60 blink::WebPermissionQueryCallback* callback) { 60 blink::WebPermissionCallback* callback) {
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::revokePermission(
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::RevokePermissionForWorker,
78 base::Unretained(permission_dispatcher_),
79 type,
80 origin.string().utf8(),
81 base::Unretained(callback),
82 WorkerTaskRunner::Instance()->CurrentWorkerId()));
83 }
84
71 void PermissionDispatcherThreadProxy::startListening( 85 void PermissionDispatcherThreadProxy::startListening(
72 blink::WebPermissionType type, 86 blink::WebPermissionType type,
73 const blink::WebURL& origin, 87 const blink::WebURL& origin,
74 blink::WebPermissionObserver* observer) { 88 blink::WebPermissionObserver* observer) {
75 if (!PermissionDispatcher::IsObservable(type)) 89 if (!PermissionDispatcher::IsObservable(type))
76 return; 90 return;
77 91
78 RegisterObserver(observer); 92 RegisterObserver(observer);
79 93
80 main_thread_task_runner_->PostTask(FROM_HERE, 94 main_thread_task_runner_->PostTask(FROM_HERE,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 type, 131 type,
118 origin, 132 origin,
119 base::Unretained(observer)))); 133 base::Unretained(observer))));
120 } 134 }
121 135
122 void PermissionDispatcherThreadProxy::OnWorkerRunLoopStopped() { 136 void PermissionDispatcherThreadProxy::OnWorkerRunLoopStopped() {
123 delete this; 137 delete this;
124 } 138 }
125 139
126 } // namespace content 140 } // namespace content
OLDNEW
« no previous file with comments | « content/child/permissions/permission_dispatcher_thread_proxy.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698