| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/serviceworkers/Cache.h" | 6 #include "modules/serviceworkers/Cache.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 ScriptPromise rejectAsNotImplemented(ScriptState* scriptState) | 15 ScriptPromise rejectAsNotImplemented(ScriptState* scriptState) |
| 16 { | 16 { |
| 17 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); | 17 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); |
| 18 const ScriptPromise promise = resolver->promise(); | 18 const ScriptPromise promise = resolver->promise(); |
| 19 resolver->reject("not implemented"); | 19 resolver->reject("not implemented"); |
| 20 | 20 |
| 21 return promise; | 21 return promise; |
| 22 } | 22 } |
| 23 | 23 |
| 24 } | 24 } |
| 25 | 25 |
| 26 PassRefPtrWillBeRawPtr<Cache> Cache::fromWebServiceWorkerCache(WebServiceWorkerC
ache* webCache) | 26 Cache* Cache::fromWebServiceWorkerCache(WebServiceWorkerCache* webCache) |
| 27 { | 27 { |
| 28 return adoptRefWillBeNoop(new Cache(webCache)); | 28 return new Cache(webCache); |
| 29 } | 29 } |
| 30 | 30 |
| 31 // FIXME: Implement these methods. | 31 // FIXME: Implement these methods. |
| 32 ScriptPromise Cache::match(ScriptState* scriptState, Request* request, const Dic
tionary& queryParams) | 32 ScriptPromise Cache::match(ScriptState* scriptState, Request* request, const Dic
tionary& queryParams) |
| 33 { | 33 { |
| 34 return rejectAsNotImplemented(scriptState); | 34 return rejectAsNotImplemented(scriptState); |
| 35 } | 35 } |
| 36 | 36 |
| 37 ScriptPromise Cache::match(ScriptState* scriptState, const String& requestString
, const Dictionary& queryParams) | 37 ScriptPromise Cache::match(ScriptState* scriptState, const String& requestString
, const Dictionary& queryParams) |
| 38 { | 38 { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 { | 98 { |
| 99 return rejectAsNotImplemented(scriptState); | 99 return rejectAsNotImplemented(scriptState); |
| 100 } | 100 } |
| 101 | 101 |
| 102 Cache::Cache(WebServiceWorkerCache* webCache) : m_webCache(webCache) | 102 Cache::Cache(WebServiceWorkerCache* webCache) : m_webCache(webCache) |
| 103 { | 103 { |
| 104 ScriptWrappable::init(this); | 104 ScriptWrappable::init(this); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |