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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 10828363: Improve error message for insecure 'content_security_policy' manifest entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Aaron's sentence. Created 8 years, 3 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/extensions/extension_manifest_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after
2717 &content_security_policy)) { 2717 &content_security_policy)) {
2718 *error = ASCIIToUTF16(errors::kInvalidContentSecurityPolicy); 2718 *error = ASCIIToUTF16(errors::kInvalidContentSecurityPolicy);
2719 return false; 2719 return false;
2720 } 2720 }
2721 if (!ContentSecurityPolicyIsLegal(content_security_policy)) { 2721 if (!ContentSecurityPolicyIsLegal(content_security_policy)) {
2722 *error = ASCIIToUTF16(errors::kInvalidContentSecurityPolicy); 2722 *error = ASCIIToUTF16(errors::kInvalidContentSecurityPolicy);
2723 return false; 2723 return false;
2724 } 2724 }
2725 if (manifest_version_ >= 2 && 2725 if (manifest_version_ >= 2 &&
2726 !ContentSecurityPolicyIsSecure(content_security_policy)) { 2726 !ContentSecurityPolicyIsSecure(content_security_policy)) {
2727 *error = ASCIIToUTF16(errors::kInvalidContentSecurityPolicy); 2727 *error = ASCIIToUTF16(errors::kInsecureContentSecurityPolicy);
2728 return false; 2728 return false;
2729 } 2729 }
2730 2730
2731 content_security_policy_ = content_security_policy; 2731 content_security_policy_ = content_security_policy;
2732 } else if (manifest_version_ >= 2) { 2732 } else if (manifest_version_ >= 2) {
2733 // Manifest version 2 introduced a default Content-Security-Policy. 2733 // Manifest version 2 introduced a default Content-Security-Policy.
2734 // TODO(abarth): Should we continue to let extensions override the 2734 // TODO(abarth): Should we continue to let extensions override the
2735 // default Content-Security-Policy? 2735 // default Content-Security-Policy?
2736 content_security_policy_ = is_platform_app() ? 2736 content_security_policy_ = is_platform_app() ?
2737 kDefaultPlatformAppContentSecurityPolicy : 2737 kDefaultPlatformAppContentSecurityPolicy :
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
3949 3949
3950 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 3950 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
3951 const Extension* extension, 3951 const Extension* extension,
3952 const PermissionSet* permissions, 3952 const PermissionSet* permissions,
3953 Reason reason) 3953 Reason reason)
3954 : reason(reason), 3954 : reason(reason),
3955 extension(extension), 3955 extension(extension),
3956 permissions(permissions) {} 3956 permissions(permissions) {}
3957 3957
3958 } // namespace extensions 3958 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/extensions/extension_manifest_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698