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

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

Issue 10828067: Extension resources should only load in contexts the extension has permission to access. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: NaCl Created 8 years, 4 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 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <iosfwd> 9 #include <iosfwd>
10 #include <map> 10 #include <map>
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 return GetResourceURL(url(), relative_path); 347 return GetResourceURL(url(), relative_path);
348 } 348 }
349 349
350 // Returns true if the resource matches a pattern in the pattern_set. 350 // Returns true if the resource matches a pattern in the pattern_set.
351 bool ResourceMatches(const URLPatternSet& pattern_set, 351 bool ResourceMatches(const URLPatternSet& pattern_set,
352 const std::string& resource) const; 352 const std::string& resource) const;
353 353
354 // Returns true if the specified resource is web accessible. 354 // Returns true if the specified resource is web accessible.
355 bool IsResourceWebAccessible(const std::string& relative_path) const; 355 bool IsResourceWebAccessible(const std::string& relative_path) const;
356 356
357 // Returns true if the specified resource is a NaCl module.
358 bool IsResourceNaClModule(const std::string& resource) const;
Aaron Boodman 2012/08/01 21:56:54 IsResourceNaclManifest()? To distinguish from actu
359
357 // Returns true if the specified page is sandboxed (served in a unique 360 // Returns true if the specified page is sandboxed (served in a unique
358 // origin). 361 // origin).
359 bool IsSandboxedPage(const std::string& relative_path) const; 362 bool IsSandboxedPage(const std::string& relative_path) const;
360 363
361 // Returns the Content Security Policy that the specified resource should be 364 // Returns the Content Security Policy that the specified resource should be
362 // served with. 365 // served with.
363 std::string GetResourceContentSecurityPolicy(const std::string& relative_path) 366 std::string GetResourceContentSecurityPolicy(const std::string& relative_path)
364 const; 367 const;
365 368
366 // Returns true when 'web_accessible_resources' are defined for the extension. 369 // Returns true when 'web_accessible_resources' are defined for the extension.
367 bool HasWebAccessibleResources() const; 370 bool HasWebAccessibleResources() const;
368 371
372 // Returns true when 'nacl_modules' are defined for the extension.
373 bool HasNaClModules() const;
374
369 // Returns an extension resource object. |relative_path| should be UTF8 375 // Returns an extension resource object. |relative_path| should be UTF8
370 // encoded. 376 // encoded.
371 ExtensionResource GetResource(const std::string& relative_path) const; 377 ExtensionResource GetResource(const std::string& relative_path) const;
372 378
373 // As above, but with |relative_path| following the file system's encoding. 379 // As above, but with |relative_path| following the file system's encoding.
374 ExtensionResource GetResource(const FilePath& relative_path) const; 380 ExtensionResource GetResource(const FilePath& relative_path) const;
375 381
376 // |input| is expected to be the text of an rsa public or private key. It 382 // |input| is expected to be the text of an rsa public or private key. It
377 // tolerates the presence or absence of bracking header/footer like this: 383 // tolerates the presence or absence of bracking header/footer like this:
378 // -----(BEGIN|END) [RSA PUBLIC/PRIVATE] KEY----- 384 // -----(BEGIN|END) [RSA PUBLIC/PRIVATE] KEY-----
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 1186
1181 UpdatedExtensionPermissionsInfo( 1187 UpdatedExtensionPermissionsInfo(
1182 const Extension* extension, 1188 const Extension* extension,
1183 const PermissionSet* permissions, 1189 const PermissionSet* permissions,
1184 Reason reason); 1190 Reason reason);
1185 }; 1191 };
1186 1192
1187 } // namespace extensions 1193 } // namespace extensions
1188 1194
1189 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 1195 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698