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

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

Issue 9909019: Add schema chrome-extension-resource:// for extension resources (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Make some test flaky for OSX Created 8 years, 7 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
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 "base/base64.h" 7 #include "base/base64.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // KEY MARKERS 67 // KEY MARKERS
68 const char kKeyBeginHeaderMarker[] = "-----BEGIN"; 68 const char kKeyBeginHeaderMarker[] = "-----BEGIN";
69 const char kKeyBeginFooterMarker[] = "-----END"; 69 const char kKeyBeginFooterMarker[] = "-----END";
70 const char kKeyInfoEndMarker[] = "KEY-----"; 70 const char kKeyInfoEndMarker[] = "KEY-----";
71 const char kPublic[] = "PUBLIC"; 71 const char kPublic[] = "PUBLIC";
72 const char kPrivate[] = "PRIVATE"; 72 const char kPrivate[] = "PRIVATE";
73 73
74 const int kRSAKeySize = 1024; 74 const int kRSAKeySize = 1024;
75 75
76 const char kDefaultContentSecurityPolicy[] = 76 const char kDefaultContentSecurityPolicy[] =
77 "script-src 'self'; object-src 'self'"; 77 "script-src 'self' chrome-extension-resource:; object-src 'self'";
78 78
79 // Converts a normal hexadecimal string into the alphabet used by extensions. 79 // Converts a normal hexadecimal string into the alphabet used by extensions.
80 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a 80 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a
81 // completely numeric host, since some software interprets that as an IP 81 // completely numeric host, since some software interprets that as an IP
82 // address. 82 // address.
83 static void ConvertHexadecimalToIDAlphabet(std::string* id) { 83 static void ConvertHexadecimalToIDAlphabet(std::string* id) {
84 for (size_t i = 0; i < id->size(); ++i) { 84 for (size_t i = 0; i < id->size(); ++i) {
85 int val; 85 int val;
86 if (base::HexStringToInt(base::StringPiece(id->begin() + i, 86 if (base::HexStringToInt(base::StringPiece(id->begin() + i,
87 id->begin() + i + 1), 87 id->begin() + i + 1),
(...skipping 3467 matching lines...) Expand 10 before | Expand all | Expand 10 after
3555 already_disabled(false), 3555 already_disabled(false),
3556 extension(extension) {} 3556 extension(extension) {}
3557 3557
3558 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 3558 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
3559 const Extension* extension, 3559 const Extension* extension,
3560 const ExtensionPermissionSet* permissions, 3560 const ExtensionPermissionSet* permissions,
3561 Reason reason) 3561 Reason reason)
3562 : reason(reason), 3562 : reason(reason),
3563 extension(extension), 3563 extension(extension),
3564 permissions(permissions) {} 3564 permissions(permissions) {}
OLDNEW
« no previous file with comments | « chrome/common/extensions/csp_validator_unittest.cc ('k') | chrome/common/extensions/extension_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698