diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-29 23:33:21 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-29 23:33:21 +0000 |
commit | b30e0dd091e4ebf974b50e4e5efded72662e0be8 (patch) | |
tree | 4fffe24fa8ecea272fa162de6b38c145c71e4c62 /chrome/browser/net | |
parent | 8c6c7b074616bbb5aac505bb5305777ea92ed9ad (diff) | |
download | chromium_src-b30e0dd091e4ebf974b50e4e5efded72662e0be8.zip chromium_src-b30e0dd091e4ebf974b50e4e5efded72662e0be8.tar.gz chromium_src-b30e0dd091e4ebf974b50e4e5efded72662e0be8.tar.bz2 |
Replace the "origins" key in the manifest with "extent". The items in the extent are URLPatterns, like other parts of the extension system.
Review URL: http://codereview.chromium.org/552209
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r-- | chrome/browser/net/chrome_url_request_context.cc | 10 | ||||
-rw-r--r-- | chrome/browser/net/chrome_url_request_context.h | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index a50013d..4e9b0ec 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -690,10 +690,10 @@ bool ChromeURLRequestContext::CheckURLAccessToExtensionPermission( } // Check that the extension declares the source URL in its extent. - std::vector<GURL>& origins = info->second->web_origins; - for (std::vector<GURL>::iterator origin = origins.begin(); - origin != origins.end(); ++origin) { - if (url.GetOrigin() == *origin) + Extension::URLPatternList& extent = info->second->extent; + for (Extension::URLPatternList::iterator pattern = extent.begin(); + pattern != extent.end(); ++pattern) { + if (pattern->MatchesUrl(url)) return true; } @@ -877,7 +877,7 @@ ChromeURLRequestContextFactory::ChromeURLRequestContextFactory(Profile* profile) new ChromeURLRequestContext::ExtensionInfo( (*iter)->path(), (*iter)->default_locale(), - (*iter)->app_origins(), + (*iter)->app_extent(), (*iter)->api_permissions())); } } diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h index d1953ef..f3d1a14 100644 --- a/chrome/browser/net/chrome_url_request_context.h +++ b/chrome/browser/net/chrome_url_request_context.h @@ -11,6 +11,7 @@ #include "chrome/browser/host_zoom_map.h" #include "chrome/browser/net/url_request_context_getter.h" #include "chrome/common/appcache/chrome_appcache_service.h" +#include "chrome/common/extensions/extension.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/pref_service.h" #include "net/url_request/url_request_context.h" @@ -40,14 +41,14 @@ class ChromeURLRequestContext : public URLRequestContext { // both threads. There is only a small amount of mutable state in Extension. struct ExtensionInfo { ExtensionInfo(const FilePath& path, const std::string& default_locale, - const std::vector<GURL>& web_origins, + const Extension::URLPatternList& extent, const std::vector<std::string>& api_permissions) : path(path), default_locale(default_locale), - web_origins(web_origins), api_permissions(api_permissions) { + extent(extent), api_permissions(api_permissions) { } FilePath path; std::string default_locale; - std::vector<GURL> web_origins; + Extension::URLPatternList extent; std::vector<std::string> api_permissions; }; |