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

Unified Diff: chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc

Issue 325893002: Bluetooth: add socket & low_energy manifest check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add permission denied tests Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc
diff --git a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc
index 49143d4e081da560a6e801d19d88d018d62b216c..1005cc07879507aea6ea2d46d79c174a1e1d4263 100644
--- a/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc
+++ b/chrome/browser/extensions/api/bluetooth_socket/bluetooth_socket_api.cc
@@ -97,6 +97,11 @@ bool BluetoothSocketAsyncApiFunction::RunAsync() {
}
bool BluetoothSocketAsyncApiFunction::PrePrepare() {
+ if (!BluetoothManifestData::CheckSocketPermitted(GetExtension())) {
+ error_ = kPermissionDeniedError;
+ return false;
+ }
+
manager_ = ApiResourceManager<BluetoothApiSocket>::Get(browser_context());
DCHECK(manager_)
<< "There is no socket manager. "

Powered by Google App Engine
This is Rietveld 408576698