Chromium Code Reviews| Index: content/browser/cache_storage/cache_storage_dispatcher_host.cc |
| diff --git a/content/browser/cache_storage/cache_storage_dispatcher_host.cc b/content/browser/cache_storage/cache_storage_dispatcher_host.cc |
| index b53495c37c4221df7c36aad4719b3541d435402e..89e9bde49b6cc9dc1e5cb5dba63127d70089147b 100644 |
| --- a/content/browser/cache_storage/cache_storage_dispatcher_host.cc |
| +++ b/content/browser/cache_storage/cache_storage_dispatcher_host.cc |
| @@ -22,6 +22,7 @@ |
| #include "content/public/common/origin_util.h" |
| #include "storage/browser/blob/blob_data_handle.h" |
| #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerCacheError.h" |
| +#include "url/gurl.h" |
| namespace content { |
| @@ -52,8 +53,8 @@ blink::WebServiceWorkerCacheError ToWebServiceWorkerCacheError( |
| return blink::WebServiceWorkerCacheErrorNotImplemented; |
| } |
| -bool OriginCanAccessCacheStorage(const GURL& url) { |
| - return IsOriginSecure(url); |
| +bool OriginCanAccessCacheStorage(const url::Origin& origin) { |
| + return IsOriginSecure(GURL(origin.Serialize())); |
|
Mike West
2016/03/24 14:29:23
Hrm. We should make this take an origin at some po
jsbell
2016/03/24 16:31:57
Yep. I'll tackle that in an upcoming CL.
|
| } |
| } // namespace |
| @@ -114,7 +115,7 @@ void CacheStorageDispatcherHost::CreateCacheListener( |
| void CacheStorageDispatcherHost::OnCacheStorageHas( |
| int thread_id, |
| int request_id, |
| - const GURL& origin, |
| + const url::Origin& origin, |
| const base::string16& cache_name) { |
| TRACE_EVENT0("CacheStorage", "CacheStorageDispatcherHost::OnCacheStorageHas"); |
| if (!OriginCanAccessCacheStorage(origin)) { |
| @@ -122,7 +123,7 @@ void CacheStorageDispatcherHost::OnCacheStorageHas( |
| return; |
| } |
| context_->cache_manager()->HasCache( |
| - origin, base::UTF16ToUTF8(cache_name), |
| + GURL(origin.Serialize()), base::UTF16ToUTF8(cache_name), |
| base::Bind(&CacheStorageDispatcherHost::OnCacheStorageHasCallback, this, |
| thread_id, request_id)); |
| } |
| @@ -130,7 +131,7 @@ void CacheStorageDispatcherHost::OnCacheStorageHas( |
| void CacheStorageDispatcherHost::OnCacheStorageOpen( |
| int thread_id, |
| int request_id, |
| - const GURL& origin, |
| + const url::Origin& origin, |
| const base::string16& cache_name) { |
| TRACE_EVENT0("CacheStorage", |
| "CacheStorageDispatcherHost::OnCacheStorageOpen"); |
| @@ -139,7 +140,7 @@ void CacheStorageDispatcherHost::OnCacheStorageOpen( |
| return; |
| } |
| context_->cache_manager()->OpenCache( |
| - origin, base::UTF16ToUTF8(cache_name), |
| + GURL(origin.Serialize()), base::UTF16ToUTF8(cache_name), |
| base::Bind(&CacheStorageDispatcherHost::OnCacheStorageOpenCallback, this, |
| thread_id, request_id)); |
| } |
| @@ -147,7 +148,7 @@ void CacheStorageDispatcherHost::OnCacheStorageOpen( |
| void CacheStorageDispatcherHost::OnCacheStorageDelete( |
| int thread_id, |
| int request_id, |
| - const GURL& origin, |
| + const url::Origin& origin, |
| const base::string16& cache_name) { |
| TRACE_EVENT0("CacheStorage", |
| "CacheStorageDispatcherHost::OnCacheStorageDelete"); |
| @@ -156,14 +157,14 @@ void CacheStorageDispatcherHost::OnCacheStorageDelete( |
| return; |
| } |
| context_->cache_manager()->DeleteCache( |
| - origin, base::UTF16ToUTF8(cache_name), |
| + GURL(origin.Serialize()), base::UTF16ToUTF8(cache_name), |
| base::Bind(&CacheStorageDispatcherHost::OnCacheStorageDeleteCallback, |
| this, thread_id, request_id)); |
| } |
| void CacheStorageDispatcherHost::OnCacheStorageKeys(int thread_id, |
| int request_id, |
| - const GURL& origin) { |
| + const url::Origin& origin) { |
| TRACE_EVENT0("CacheStorage", |
| "CacheStorageDispatcherHost::OnCacheStorageKeys"); |
| if (!OriginCanAccessCacheStorage(origin)) { |
| @@ -171,7 +172,7 @@ void CacheStorageDispatcherHost::OnCacheStorageKeys(int thread_id, |
| return; |
| } |
| context_->cache_manager()->EnumerateCaches( |
| - origin, |
| + GURL(origin.Serialize()), |
| base::Bind(&CacheStorageDispatcherHost::OnCacheStorageKeysCallback, this, |
| thread_id, request_id)); |
| } |
| @@ -179,7 +180,7 @@ void CacheStorageDispatcherHost::OnCacheStorageKeys(int thread_id, |
| void CacheStorageDispatcherHost::OnCacheStorageMatch( |
| int thread_id, |
| int request_id, |
| - const GURL& origin, |
| + const url::Origin& origin, |
| const ServiceWorkerFetchRequest& request, |
| const CacheStorageCacheQueryParams& match_params) { |
| TRACE_EVENT0("CacheStorage", |
| @@ -195,13 +196,13 @@ void CacheStorageDispatcherHost::OnCacheStorageMatch( |
| if (match_params.cache_name.empty()) { |
| context_->cache_manager()->MatchAllCaches( |
| - origin, std::move(scoped_request), |
| + GURL(origin.Serialize()), std::move(scoped_request), |
| base::Bind(&CacheStorageDispatcherHost::OnCacheStorageMatchCallback, |
| this, thread_id, request_id)); |
| return; |
| } |
| context_->cache_manager()->MatchCache( |
| - origin, base::UTF16ToUTF8(match_params.cache_name), |
| + GURL(origin.Serialize()), base::UTF16ToUTF8(match_params.cache_name), |
| std::move(scoped_request), |
| base::Bind(&CacheStorageDispatcherHost::OnCacheStorageMatchCallback, this, |
| thread_id, request_id)); |