| 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(DOMException::create(NotSupportedError, "Cache is not imple
mented")); | 19 resolver->reject(DOMException::create(NotSupportedError, "Cache is not imple
mented")); |
| 20 return promise; | 20 return promise; |
| 21 } | 21 } |
| 22 | 22 |
| 23 } | 23 } |
| 24 | 24 |
| 25 PassRefPtrWillBeRawPtr<Cache> Cache::fromWebServiceWorkerCache(WebServiceWorkerC
ache* webCache) | 25 Cache* Cache::fromWebServiceWorkerCache(WebServiceWorkerCache* webCache) |
| 26 { | 26 { |
| 27 return adoptRefWillBeNoop(new Cache(webCache)); | 27 return new Cache(webCache); |
| 28 } | 28 } |
| 29 | 29 |
| 30 // FIXME: Implement these methods. | 30 // FIXME: Implement these methods. |
| 31 ScriptPromise Cache::match(ScriptState* scriptState, Request* request, const Dic
tionary& queryParams) | 31 ScriptPromise Cache::match(ScriptState* scriptState, Request* request, const Dic
tionary& queryParams) |
| 32 { | 32 { |
| 33 return rejectAsNotImplemented(scriptState); | 33 return rejectAsNotImplemented(scriptState); |
| 34 } | 34 } |
| 35 | 35 |
| 36 ScriptPromise Cache::match(ScriptState* scriptState, const String& requestString
, const Dictionary& queryParams) | 36 ScriptPromise Cache::match(ScriptState* scriptState, const String& requestString
, const Dictionary& queryParams) |
| 37 { | 37 { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 return DOMException::create(NotSupportedError, "Unknown error."); | 112 return DOMException::create(NotSupportedError, "Unknown error."); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 Cache::Cache(WebServiceWorkerCache* webCache) : m_webCache(webCache) | 116 Cache::Cache(WebServiceWorkerCache* webCache) : m_webCache(webCache) |
| 117 { | 117 { |
| 118 ScriptWrappable::init(this); | 118 ScriptWrappable::init(this); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace blink | 121 } // namespace blink |
| OLD | NEW |