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/v8/ScriptPromise.h" | 8 #include "bindings/v8/ScriptPromise.h" |
9 #include "bindings/v8/ScriptPromiseResolver.h" | 9 #include "bindings/v8/ScriptPromiseResolver.h" |
10 #include "core/dom/DOMError.h" | 10 #include "core/dom/DOMError.h" |
11 #include "core/dom/ExceptionCode.h" | 11 #include "core/dom/ExceptionCode.h" |
12 #include "platform/NotImplemented.h" | 12 #include "platform/NotImplemented.h" |
13 | 13 |
14 namespace WebCore { | 14 namespace WebCore { |
15 | 15 |
16 PassRefPtr<Cache> Cache::create(const Vector<String>& urlStrings) | 16 PassRefPtr<Cache> Cache::create(const Vector<String>& urlStrings) |
17 { | 17 { |
18 RefPtr<Cache> cache = adoptRef(new Cache); | 18 RefPtr<Cache> cache = adoptRef(new Cache); |
19 // FIXME: Implement. | 19 // FIXME: Implement. |
20 notImplemented(); | 20 notImplemented(); |
21 return cache; | 21 return cache; |
22 } | 22 } |
23 | 23 |
24 Cache::~Cache() | 24 Cache::~Cache() |
25 { | 25 { |
26 } | 26 } |
27 | 27 |
28 ScriptPromise Cache::match(ExecutionContext* executionContext, const String& url
String) | 28 ScriptPromise Cache::match(ScriptState* scriptState, const String& urlString) |
29 { | 29 { |
30 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(execu
tionContext); | 30 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); |
31 ScriptPromise promise = resolver->promise(); | 31 ScriptPromise promise = resolver->promise(); |
32 | 32 |
33 // FIXME: Implement. | 33 // FIXME: Implement. |
34 notImplemented(); | 34 notImplemented(); |
35 resolver->reject(DOMError::create(NotSupportedError)); | 35 resolver->reject(DOMError::create(NotSupportedError)); |
36 return promise; | 36 return promise; |
37 } | 37 } |
38 | 38 |
39 ScriptPromise Cache::ready(ExecutionContext* executionContext) | 39 ScriptPromise Cache::ready(ScriptState* scriptState) |
40 { | 40 { |
41 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(execu
tionContext); | 41 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); |
42 ScriptPromise promise = resolver->promise(); | 42 ScriptPromise promise = resolver->promise(); |
43 | 43 |
44 // FIXME: Implement. | 44 // FIXME: Implement. |
45 notImplemented(); | 45 notImplemented(); |
46 resolver->reject(DOMError::create(NotSupportedError)); | 46 resolver->reject(DOMError::create(NotSupportedError)); |
47 return promise; | 47 return promise; |
48 } | 48 } |
49 | 49 |
50 Cache::Cache() | 50 Cache::Cache() |
51 { | 51 { |
52 ScriptWrappable::init(this); | 52 ScriptWrappable::init(this); |
53 } | 53 } |
54 | 54 |
55 } // namespace WebCore | 55 } // namespace WebCore |
OLD | NEW |