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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 315573003: Remove PermissionsData::ForExtension() completely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after
2501 allowed_socket_origins_)) { 2501 allowed_socket_origins_)) {
2502 return true; 2502 return true;
2503 } 2503 }
2504 } else { 2504 } else {
2505 // Access to public socket APIs is controlled by extension permissions. 2505 // Access to public socket APIs is controlled by extension permissions.
2506 if (url.is_valid() && url.SchemeIs(extensions::kExtensionScheme) && 2506 if (url.is_valid() && url.SchemeIs(extensions::kExtensionScheme) &&
2507 extension_set) { 2507 extension_set) {
2508 const Extension* extension = extension_set->GetByID(url.host()); 2508 const Extension* extension = extension_set->GetByID(url.host());
2509 if (extension) { 2509 if (extension) {
2510 const extensions::PermissionsData* permissions_data = 2510 const extensions::PermissionsData* permissions_data =
2511 extensions::PermissionsData::ForExtension(extension); 2511 extension->permissions_data();
2512 if (params) { 2512 if (params) {
2513 extensions::SocketPermission::CheckParam check_params( 2513 extensions::SocketPermission::CheckParam check_params(
2514 params->type, params->host, params->port); 2514 params->type, params->host, params->port);
2515 if (permissions_data->CheckAPIPermissionWithParam( 2515 if (permissions_data->CheckAPIPermissionWithParam(
2516 extensions::APIPermission::kSocket, &check_params)) { 2516 extensions::APIPermission::kSocket, &check_params)) {
2517 return true; 2517 return true;
2518 } 2518 }
2519 } else if (permissions_data->HasAPIPermission( 2519 } else if (permissions_data->HasAPIPermission(
2520 extensions::APIPermission::kSocket)) { 2520 extensions::APIPermission::kSocket)) {
2521 return true; 2521 return true;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
2756 switches::kDisableWebRtcEncryption, 2756 switches::kDisableWebRtcEncryption,
2757 }; 2757 };
2758 to_command_line->CopySwitchesFrom(from_command_line, 2758 to_command_line->CopySwitchesFrom(from_command_line,
2759 kWebRtcDevSwitchNames, 2759 kWebRtcDevSwitchNames,
2760 arraysize(kWebRtcDevSwitchNames)); 2760 arraysize(kWebRtcDevSwitchNames));
2761 } 2761 }
2762 } 2762 }
2763 #endif // defined(ENABLE_WEBRTC) 2763 #endif // defined(ENABLE_WEBRTC)
2764 2764
2765 } // namespace chrome 2765 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/apps/ephemeral_app_launcher.cc ('k') | chrome/browser/extensions/active_script_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698