diff options
author | jsbell <jsbell@chromium.org> | 2016-03-03 08:43:59 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-03 16:45:38 +0000 |
commit | d5f03152d47419ff779de8ad40a4ca997e430ebc (patch) | |
tree | 9f4f3d590c54ca6a6c3c4d33f4d6277f66a899bd | |
parent | d2f87840e21d49e5580d58dc0ecbf26bf0802a47 (diff) | |
download | chromium_src-d5f03152d47419ff779de8ad40a4ca997e430ebc.zip chromium_src-d5f03152d47419ff779de8ad40a4ca997e430ebc.tar.gz chromium_src-d5f03152d47419ff779de8ad40a4ca997e430ebc.tar.bz2 |
Cache API: Pass origin to platform, rather than DatabaseIdentifier
Don't convert an origin to a DatabaseIdentifier just to immediately
convert it back to an origin. Just pass the origin.
BUG=591240
R=mkwst@chromium.org
Review URL: https://codereview.chromium.org/1760673003
Cr-Commit-Position: refs/heads/master@{#379021}
5 files changed, 8 insertions, 11 deletions
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index a01e1d6..a5f1637 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc @@ -435,9 +435,8 @@ WebIDBFactory* RendererBlinkPlatformImpl::idbFactory() { //------------------------------------------------------------------------------ blink::WebServiceWorkerCacheStorage* RendererBlinkPlatformImpl::cacheStorage( - const WebString& origin_identifier) { - const GURL origin = - storage::GetOriginFromIdentifier(origin_identifier.utf8()); + const blink::WebSecurityOrigin& security_origin) { + const GURL origin = blink::WebStringToGURL(security_origin.toString()); return new WebServiceWorkerCacheStorageImpl(thread_safe_sender_.get(), origin); } diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h index 8b558d3..90e644d 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h @@ -121,7 +121,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { blink::WebScrollbarBehavior* scrollbarBehavior() override; blink::WebIDBFactory* idbFactory() override; blink::WebServiceWorkerCacheStorage* cacheStorage( - const blink::WebString& origin_identifier) override; + const blink::WebSecurityOrigin& security_origin) override; blink::WebFileSystem* fileSystem() override; bool canAccelerate2dCanvas() override; bool isThreadedCompositingEnabled() override; diff --git a/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp b/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp index 4885b7e..deb839b 100644 --- a/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp @@ -11,8 +11,8 @@ #include "modules/cachestorage/CacheStorage.h" #include "platform/Supplementable.h" #include "platform/heap/Handle.h" -#include "platform/weborigin/DatabaseIdentifier.h" #include "public/platform/Platform.h" +#include "public/platform/WebSecurityOrigin.h" namespace blink { @@ -52,9 +52,7 @@ public: } if (!m_caches) { - String identifier = createDatabaseIdentifierFromSecurityOrigin(context->securityOrigin()); - ASSERT(!identifier.isEmpty()); - m_caches = CacheStorage::create(GlobalFetch::ScopedFetcher::from(fetchingScope), Platform::current()->cacheStorage(identifier)); + m_caches = CacheStorage::create(GlobalFetch::ScopedFetcher::from(fetchingScope), Platform::current()->cacheStorage(WebSecurityOrigin(context->securityOrigin()))); } return m_caches; } diff --git a/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp b/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp index 13a4c39..7360934 100644 --- a/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.cpp @@ -13,6 +13,7 @@ #include "platform/weborigin/SecurityOrigin.h" #include "public/platform/Platform.h" #include "public/platform/WebPassOwnPtr.h" +#include "public/platform/WebSecurityOrigin.h" #include "public/platform/WebString.h" #include "public/platform/WebURL.h" #include "public/platform/WebVector.h" @@ -76,8 +77,7 @@ PassOwnPtr<WebServiceWorkerCacheStorage> assertCacheStorage(ErrorString* errorSt return nullptr; } - String identifier = createDatabaseIdentifierFromSecurityOrigin(secOrigin.get()); - OwnPtr<WebServiceWorkerCacheStorage> cache = adoptPtr(Platform::current()->cacheStorage(identifier)); + OwnPtr<WebServiceWorkerCacheStorage> cache = adoptPtr(Platform::current()->cacheStorage(WebSecurityOrigin(secOrigin))); if (!cache) *errorString = "Could not find cache storage."; return cache.release(); diff --git a/third_party/WebKit/public/platform/Platform.h b/third_party/WebKit/public/platform/Platform.h index 72a3e18..7ae10de 100644 --- a/third_party/WebKit/public/platform/Platform.h +++ b/third_party/WebKit/public/platform/Platform.h @@ -232,7 +232,7 @@ public: // Cache Storage ---------------------------------------------------------- // The caller is responsible for deleting the returned object. - virtual WebServiceWorkerCacheStorage* cacheStorage(const WebString& originIdentifier) { return nullptr; } + virtual WebServiceWorkerCacheStorage* cacheStorage(const WebSecurityOrigin&) { return nullptr; } // Gamepad ------------------------------------------------------------- |