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

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: Update Created 8 years, 8 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // KEY MARKERS 66 // KEY MARKERS
67 const char kKeyBeginHeaderMarker[] = "-----BEGIN"; 67 const char kKeyBeginHeaderMarker[] = "-----BEGIN";
68 const char kKeyBeginFooterMarker[] = "-----END"; 68 const char kKeyBeginFooterMarker[] = "-----END";
69 const char kKeyInfoEndMarker[] = "KEY-----"; 69 const char kKeyInfoEndMarker[] = "KEY-----";
70 const char kPublic[] = "PUBLIC"; 70 const char kPublic[] = "PUBLIC";
71 const char kPrivate[] = "PRIVATE"; 71 const char kPrivate[] = "PRIVATE";
72 72
73 const int kRSAKeySize = 1024; 73 const int kRSAKeySize = 1024;
74 74
75 const char kDefaultContentSecurityPolicy[] = 75 const char kDefaultContentSecurityPolicy[] =
76 "script-src 'self'; object-src 'self'"; 76 "script-src 'self' chrome-extension-resource:; object-src 'self'";
77 77
78 // Converts a normal hexadecimal string into the alphabet used by extensions. 78 // Converts a normal hexadecimal string into the alphabet used by extensions.
79 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a 79 // We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a
80 // completely numeric host, since some software interprets that as an IP 80 // completely numeric host, since some software interprets that as an IP
81 // address. 81 // address.
82 static void ConvertHexadecimalToIDAlphabet(std::string* id) { 82 static void ConvertHexadecimalToIDAlphabet(std::string* id) {
83 for (size_t i = 0; i < id->size(); ++i) { 83 for (size_t i = 0; i < id->size(); ++i) {
84 int val; 84 int val;
85 if (base::HexStringToInt(base::StringPiece(id->begin() + i, 85 if (base::HexStringToInt(base::StringPiece(id->begin() + i,
86 id->begin() + i + 1), 86 id->begin() + i + 1),
(...skipping 3618 matching lines...) Expand 10 before | Expand all | Expand 10 after
3705 already_disabled(false), 3705 already_disabled(false),
3706 extension(extension) {} 3706 extension(extension) {}
3707 3707
3708 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 3708 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
3709 const Extension* extension, 3709 const Extension* extension,
3710 const ExtensionPermissionSet* permissions, 3710 const ExtensionPermissionSet* permissions,
3711 Reason reason) 3711 Reason reason)
3712 : reason(reason), 3712 : reason(reason),
3713 extension(extension), 3713 extension(extension),
3714 permissions(permissions) {} 3714 permissions(permissions) {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698