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

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

Issue 309533007: Refactor PermissionsData pt1 (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 2491 matching lines...) Expand 10 before | Expand all | Expand 10 after
2502 } 2502 }
2503 } else { 2503 } else {
2504 // Access to public socket APIs is controlled by extension permissions. 2504 // Access to public socket APIs is controlled by extension permissions.
2505 if (url.is_valid() && url.SchemeIs(extensions::kExtensionScheme) && 2505 if (url.is_valid() && url.SchemeIs(extensions::kExtensionScheme) &&
2506 extension_set) { 2506 extension_set) {
2507 const Extension* extension = extension_set->GetByID(url.host()); 2507 const Extension* extension = extension_set->GetByID(url.host());
2508 if (extension) { 2508 if (extension) {
2509 if (params) { 2509 if (params) {
2510 extensions::SocketPermission::CheckParam check_params( 2510 extensions::SocketPermission::CheckParam check_params(
2511 params->type, params->host, params->port); 2511 params->type, params->host, params->port);
2512 if (extensions::PermissionsData::CheckAPIPermissionWithParam( 2512 if (extensions::PermissionsData::ForExtension(extension)
2513 extension, extensions::APIPermission::kSocket, 2513 ->CheckAPIPermissionWithParam(
2514 &check_params)) { 2514 extensions::APIPermission::kSocket, &check_params)) {
2515 return true; 2515 return true;
2516 } 2516 }
2517 } else { 2517 } else {
2518 if (extensions::PermissionsData::HasAPIPermission( 2518 if (extensions::PermissionsData::ForExtension(extension)
2519 extension, extensions::APIPermission::kSocket)) { 2519 ->HasAPIPermission(extensions::APIPermission::kSocket)) {
not at google - send to devlin 2014/06/02 23:20:06 it's true though; one of the advantages of extensi
Devlin 2014/06/03 15:28:21 Done.
2520 return true; 2520 return true;
2521 } 2521 }
2522 } 2522 }
2523 } 2523 }
2524 } 2524 }
2525 } 2525 }
2526 2526
2527 // Allow both public and private APIs if the command line says so. 2527 // Allow both public and private APIs if the command line says so.
2528 return IsHostAllowedByCommandLine(url, extension_set, 2528 return IsHostAllowedByCommandLine(url, extension_set,
2529 switches::kAllowNaClSocketAPI); 2529 switches::kAllowNaClSocketAPI);
(...skipping 226 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

Powered by Google App Engine
This is Rietveld 408576698