OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "modules/serviceworkers/Cache.h" |
| 7 |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "bindings/core/v8/ScriptState.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 namespace { |
| 14 |
| 15 ScriptPromise rejectAsNotImplemented(ScriptState* scriptState) |
| 16 { |
| 17 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); |
| 18 const ScriptPromise promise = resolver->promise(); |
| 19 resolver->reject("not implemented"); |
| 20 |
| 21 return promise; |
| 22 } |
| 23 |
| 24 } |
| 25 |
| 26 PassRefPtrWillBeRawPtr<Cache> Cache::fromWebServiceWorkerCache(WebServiceWorkerC
ache* webCache) |
| 27 { |
| 28 return adoptRefWillBeNoop(new Cache(webCache)); |
| 29 } |
| 30 |
| 31 // FIXME: Implement these methods. |
| 32 ScriptPromise Cache::match(ScriptState* scriptState, Request* request, const Dic
tionary& queryParams) |
| 33 { |
| 34 return rejectAsNotImplemented(scriptState); |
| 35 } |
| 36 |
| 37 ScriptPromise Cache::match(ScriptState* scriptState, const String& requestString
, const Dictionary& queryParams) |
| 38 { |
| 39 return rejectAsNotImplemented(scriptState); |
| 40 } |
| 41 |
| 42 ScriptPromise Cache::matchAll(ScriptState* scriptState, Request* request, const
Dictionary& queryParams) |
| 43 { |
| 44 return rejectAsNotImplemented(scriptState); |
| 45 } |
| 46 |
| 47 ScriptPromise Cache::matchAll(ScriptState* scriptState, const String& requestStr
ing, const Dictionary& queryParams) |
| 48 { |
| 49 return rejectAsNotImplemented(scriptState); |
| 50 } |
| 51 |
| 52 ScriptPromise Cache::add(ScriptState* scriptState, Request* request) |
| 53 { |
| 54 return rejectAsNotImplemented(scriptState); |
| 55 } |
| 56 |
| 57 ScriptPromise Cache::add(ScriptState* scriptState, const String& requestString) |
| 58 { |
| 59 return rejectAsNotImplemented(scriptState); |
| 60 } |
| 61 |
| 62 ScriptPromise Cache::addAll(ScriptState* scriptState, const WillBeHeapVector<Scr
iptValue>& rawRequests) |
| 63 { |
| 64 return rejectAsNotImplemented(scriptState); |
| 65 } |
| 66 |
| 67 ScriptPromise Cache::deleteFunction(ScriptState* scriptState, Request* request,
const Dictionary& queryParams) |
| 68 { |
| 69 return rejectAsNotImplemented(scriptState); |
| 70 } |
| 71 |
| 72 ScriptPromise Cache::deleteFunction(ScriptState* scriptState, const String& requ
estString, const Dictionary& queryParams) |
| 73 { |
| 74 return rejectAsNotImplemented(scriptState); |
| 75 } |
| 76 |
| 77 ScriptPromise Cache::put(ScriptState* scriptState, Request* request, Response*) |
| 78 { |
| 79 return rejectAsNotImplemented(scriptState); |
| 80 } |
| 81 |
| 82 ScriptPromise Cache::put(ScriptState* scriptState, const String& requestString,
Response*) |
| 83 { |
| 84 return rejectAsNotImplemented(scriptState); |
| 85 } |
| 86 |
| 87 ScriptPromise Cache::keys(ScriptState* scriptState) |
| 88 { |
| 89 return rejectAsNotImplemented(scriptState); |
| 90 } |
| 91 |
| 92 ScriptPromise Cache::keys(ScriptState* scriptState, Request* request, const Dict
ionary& queryParams) |
| 93 { |
| 94 return rejectAsNotImplemented(scriptState); |
| 95 } |
| 96 |
| 97 ScriptPromise Cache::keys(ScriptState* scriptState, const String& requestString,
const Dictionary& queryParams) |
| 98 { |
| 99 return rejectAsNotImplemented(scriptState); |
| 100 } |
| 101 |
| 102 Cache::Cache(WebServiceWorkerCache* webCache) : m_webCache(webCache) |
| 103 { |
| 104 ScriptWrappable::init(this); |
| 105 } |
| 106 |
| 107 } // namespace blink |
OLD | NEW |