diff options
author | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-06 05:04:36 +0000 |
---|---|---|
committer | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-06 05:04:36 +0000 |
commit | a6910e7458ad8ce393b97696307230ceb12a6b77 (patch) | |
tree | 24afa5b7b8a8c41a24755007e747a67b084d744f /extensions/browser | |
parent | bebb1a87602202e572d4a817d5aa047d32a70cf0 (diff) | |
download | chromium_src-a6910e7458ad8ce393b97696307230ceb12a6b77.zip chromium_src-a6910e7458ad8ce393b97696307230ceb12a6b77.tar.gz chromium_src-a6910e7458ad8ce393b97696307230ceb12a6b77.tar.bz2 |
Remove PermissionsData::ForExtension() completely
There's no reason to have this. It was originally because PermissionsData
didn't really belong on Extension (and was to be taken off), but now that
PermissionsData is refactored to only include active permissions, it belongs
on the extension object.
TBR=ben@chromium.org (c/b/ui - simple refactor, no functional changes)
TBR=thestig@chromium.org (c/b/media_galleries - simple refactor, no functional changes)
BUG=379356
Review URL: https://codereview.chromium.org/315573003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275332 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/browser')
-rw-r--r-- | extensions/browser/api/socket/socket_api.cc | 28 | ||||
-rw-r--r-- | extensions/browser/api/usb/usb_api.cc | 12 |
2 files changed, 20 insertions, 20 deletions
diff --git a/extensions/browser/api/socket/socket_api.cc b/extensions/browser/api/socket/socket_api.cc index 62d7718..3225827 100644 --- a/extensions/browser/api/socket/socket_api.cc +++ b/extensions/browser/api/socket/socket_api.cc @@ -210,8 +210,8 @@ void SocketConnectFunction::AsyncWorkStart() { } SocketPermission::CheckParam param(operation_type, hostname_, port_); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kSocket, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kSocket, ¶m)) { error_ = kPermissionError; SetResult(new base::FundamentalValue(-1)); AsyncWorkCompleted(); @@ -275,8 +275,8 @@ void SocketBindFunction::Work() { if (socket->GetSocketType() == Socket::TYPE_UDP) { SocketPermission::CheckParam param( SocketPermissionRequest::UDP_BIND, address_, port_); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kSocket, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kSocket, ¶m)) { error_ = kPermissionError; SetResult(new base::FundamentalValue(result)); return; @@ -308,8 +308,8 @@ void SocketListenFunction::Work() { if (socket) { SocketPermission::CheckParam param( SocketPermissionRequest::TCP_LISTEN, params_->address, params_->port); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kSocket, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kSocket, ¶m)) { error_ = kPermissionError; SetResult(new base::FundamentalValue(result)); return; @@ -510,8 +510,8 @@ void SocketSendToFunction::AsyncWorkStart() { if (socket_->GetSocketType() == Socket::TYPE_UDP) { SocketPermission::CheckParam param( SocketPermissionRequest::UDP_SEND_TO, hostname_, port_); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kSocket, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kSocket, ¶m)) { error_ = kPermissionError; SetResult(new base::FundamentalValue(-1)); AsyncWorkCompleted(); @@ -724,8 +724,8 @@ void SocketJoinGroupFunction::Work() { kWildcardAddress, kWildcardPort); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kSocket, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kSocket, ¶m)) { error_ = kPermissionError; SetResult(new base::FundamentalValue(result)); return; @@ -768,8 +768,8 @@ void SocketLeaveGroupFunction::Work() { SocketPermissionRequest::UDP_MULTICAST_MEMBERSHIP, kWildcardAddress, kWildcardPort); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kSocket, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kSocket, ¶m)) { error_ = kPermissionError; SetResult(new base::FundamentalValue(result)); return; @@ -875,8 +875,8 @@ void SocketGetJoinedGroupsFunction::Work() { SocketPermissionRequest::UDP_MULTICAST_MEMBERSHIP, kWildcardAddress, kWildcardPort); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kSocket, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kSocket, ¶m)) { error_ = kPermissionError; SetResult(new base::FundamentalValue(result)); return; diff --git a/extensions/browser/api/usb/usb_api.cc b/extensions/browser/api/usb/usb_api.cc index 8bf2779..b888a2b 100644 --- a/extensions/browser/api/usb/usb_api.cc +++ b/extensions/browser/api/usb/usb_api.cc @@ -422,8 +422,8 @@ scoped_refptr<UsbDevice> UsbAsyncApiFunction::GetDeviceOrOrCompleteWithError( const uint16_t product_id = input_device.product_id; UsbDevicePermission::CheckParam param( vendor_id, product_id, UsbDevicePermissionData::UNSPECIFIED_INTERFACE); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kUsbDevice, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kUsbDevice, ¶m)) { LOG(WARNING) << "Insufficient permissions to access device."; CompleteWithError(kErrorPermissionDenied); return NULL; @@ -553,8 +553,8 @@ void UsbFindDevicesFunction::AsyncWorkStart() { ? *parameters_->options.interface_id.get() : UsbDevicePermissionData::ANY_INTERFACE; UsbDevicePermission::CheckParam param(vendor_id, product_id, interface_id); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kUsbDevice, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kUsbDevice, ¶m)) { LOG(WARNING) << "Insufficient permissions to access device."; CompleteWithError(kErrorPermissionDenied); return; @@ -629,8 +629,8 @@ void UsbGetDevicesFunction::AsyncWorkStart() { const uint16_t product_id = parameters_->options.product_id; UsbDevicePermission::CheckParam param( vendor_id, product_id, UsbDevicePermissionData::UNSPECIFIED_INTERFACE); - if (!PermissionsData::ForExtension(GetExtension()) - ->CheckAPIPermissionWithParam(APIPermission::kUsbDevice, ¶m)) { + if (!GetExtension()->permissions_data()->CheckAPIPermissionWithParam( + APIPermission::kUsbDevice, ¶m)) { LOG(WARNING) << "Insufficient permissions to access device."; CompleteWithError(kErrorPermissionDenied); return; |