Commit 555f534f authored by jsbell's avatar jsbell Committed by Commit bot

Cache Storage: Implement Blink Platform API

The API will be defined in a follow-up Blink CL. Unlike the existing,
Service Worker-specific API, this one passes ownership of the new
object to the caller. The origin is specified by a database identifier
derived from the SecurityOrigin on the Blink side.

BUG=439389

Review URL: https://codereview.chromium.org/1031063002

Cr-Commit-Position: refs/heads/master@{#322278}
parent 78ed69f0
......@@ -54,6 +54,7 @@
#include "content/renderer/scheduler/web_scheduler_impl.h"
#include "content/renderer/scheduler/webthread_impl_for_scheduler.h"
#include "content/renderer/screen_orientation/screen_orientation_observer.h"
#include "content/renderer/service_worker/webserviceworkercachestorage_impl.h"
#include "content/renderer/webclipboard_impl.h"
#include "content/renderer/webgraphicscontext3d_provider_impl.h"
#include "content/renderer/webpublicsuffixlist_impl.h"
......@@ -66,6 +67,7 @@
#include "media/filters/stream_parser_factory.h"
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
#include "storage/common/database/database_identifier.h"
#include "storage/common/quota/quota_types.h"
#include "third_party/WebKit/public/platform/WebBatteryStatusListener.h"
#include "third_party/WebKit/public/platform/WebBlobRegistry.h"
......@@ -391,6 +393,16 @@ WebIDBFactory* RendererBlinkPlatformImpl::idbFactory() {
//------------------------------------------------------------------------------
blink::WebServiceWorkerCacheStorage* RendererBlinkPlatformImpl::cacheStorage(
const WebString& origin_identifier) {
const GURL origin =
storage::GetOriginFromIdentifier(origin_identifier.utf8());
return new WebServiceWorkerCacheStorageImpl(thread_safe_sender_.get(),
origin);
}
//------------------------------------------------------------------------------
WebFileSystem* RendererBlinkPlatformImpl::fileSystem() {
return WebFileSystemImpl::ThreadSpecificInstance(default_task_runner_);
}
......
......@@ -34,6 +34,7 @@ class WebBatteryStatus;
class WebDeviceMotionData;
class WebDeviceOrientationData;
class WebGraphicsContext3DProvider;
class WebServiceWorkerCacheStorage;
}
namespace content {
......@@ -101,6 +102,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
virtual void screenColorProfile(blink::WebVector<char>* to_profile);
virtual blink::WebScrollbarBehavior* scrollbarBehavior();
virtual blink::WebIDBFactory* idbFactory();
virtual blink::WebServiceWorkerCacheStorage* cacheStorage(
const blink::WebString& origin_identifier);
virtual blink::WebFileSystem* fileSystem();
virtual bool canAccelerate2dCanvas();
virtual bool isThreadedCompositingEnabled();
......
......@@ -62,6 +62,7 @@ class EmbeddedWorkerContextClient
// WebServiceWorkerContextClient overrides, some of them are just dispatched
// on to script_context_.
virtual blink::WebURL scope() const;
// TODO(jsbell): Remove this once Blink is updated. http://crbug.com/439389
virtual blink::WebServiceWorkerCacheStorage* cacheStorage();
virtual void didPauseAfterDownload();
virtual void getClients(const blink::WebServiceWorkerClientQueryOptions&,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment