Commit aa8c66c2 authored by gavinp@chromium.org's avatar gavinp@chromium.org

ServiceWorker, remove old Cache API implementation to make way for the polyfill.

R=falken@chromium.org,jkarlin@chromium.org
BUG=374822

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175596 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 607ae5f9
...@@ -119,7 +119,6 @@ ...@@ -119,7 +119,6 @@
'quota/StorageQuota.idl', 'quota/StorageQuota.idl',
'quota/StorageQuotaCallback.idl', 'quota/StorageQuotaCallback.idl',
'quota/StorageUsageCallback.idl', 'quota/StorageUsageCallback.idl',
'serviceworkers/Cache.idl',
'serviceworkers/Client.idl', 'serviceworkers/Client.idl',
'serviceworkers/FetchEvent.idl', 'serviceworkers/FetchEvent.idl',
'serviceworkers/HeaderMap.idl', 'serviceworkers/HeaderMap.idl',
...@@ -644,8 +643,6 @@ ...@@ -644,8 +643,6 @@
'screen_orientation/ScreenOrientation.h', 'screen_orientation/ScreenOrientation.h',
'screen_orientation/ScreenOrientationController.cpp', 'screen_orientation/ScreenOrientationController.cpp',
'screen_orientation/ScreenOrientationController.h', 'screen_orientation/ScreenOrientationController.h',
'serviceworkers/Cache.cpp',
'serviceworkers/Cache.h',
'serviceworkers/Client.cpp', 'serviceworkers/Client.cpp',
'serviceworkers/Client.h', 'serviceworkers/Client.h',
'serviceworkers/FetchEvent.cpp', 'serviceworkers/FetchEvent.cpp',
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "modules/serviceworkers/Cache.h"
#include "bindings/v8/ScriptPromise.h"
#include "bindings/v8/ScriptPromiseResolver.h"
#include "core/dom/DOMError.h"
#include "core/dom/ExceptionCode.h"
#include "platform/NotImplemented.h"
namespace WebCore {
PassRefPtr<Cache> Cache::create(const Vector<String>& urlStrings)
{
RefPtr<Cache> cache = adoptRef(new Cache);
// FIXME: Implement.
notImplemented();
return cache;
}
Cache::~Cache()
{
}
ScriptPromise Cache::match(ScriptState* scriptState, const String& urlString)
{
RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
// FIXME: Implement.
notImplemented();
resolver->reject(DOMError::create(NotSupportedError));
return promise;
}
ScriptPromise Cache::ready(ScriptState* scriptState)
{
RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
// FIXME: Implement.
notImplemented();
resolver->reject(DOMError::create(NotSupportedError));
return promise;
}
Cache::Cache()
{
ScriptWrappable::init(this);
}
} // namespace WebCore
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef Cache_h
#define Cache_h
#include "bindings/v8/ScriptState.h"
#include "bindings/v8/ScriptWrappable.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/Vector.h"
namespace WebCore {
class ExecutionContext;
class ScriptPromise;
class Cache FINAL : public RefCounted<Cache>, public ScriptWrappable {
public:
static PassRefPtr<Cache> create(const Vector<String>& urlStrings);
~Cache();
ScriptPromise match(ScriptState*, const String& urlString);
ScriptPromise ready(ScriptState*);
private:
Cache();
};
} // namespace WebCore
#endif // Cache_h
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
Constructor(DOMString[] urls),
Exposed=ServiceWorker,
RuntimeEnabled=ServiceWorker
] interface Cache {
[CallWith=ScriptState] Promise match(DOMString url);
[CallWith=ScriptState] Promise ready();
};
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