| 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/CacheStorage.h" | 6 #include "modules/serviceworkers/CacheStorage.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 #include "modules/serviceworkers/Cache.h" | 10 #include "modules/serviceworkers/Cache.h" |
| 11 #include "public/platform/WebServiceWorkerCacheError.h" | 11 #include "public/platform/WebServiceWorkerCacheError.h" |
| 12 #include "public/platform/WebServiceWorkerCacheStorage.h" | 12 #include "public/platform/WebServiceWorkerCacheStorage.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 const char* CacheErrorToString(WebServiceWorkerCacheError reason) | 18 const char* CacheErrorToString(WebServiceWorkerCacheError reason) |
| 19 { | 19 { |
| 20 // FIXME: Construct correct DOM error objects rather than returning strings. | 20 // FIXME: Construct correct DOM error objects rather than returning strings. |
| 21 switch (reason) { | 21 switch (reason) { |
| 22 case WebServiceWorkerCacheError::WebServiceWorkerCacheErrorNotImplemented: | 22 case WebServiceWorkerCacheErrorNotImplemented: |
| 23 return "not implemented"; | 23 return "not implemented"; |
| 24 case WebServiceWorkerCacheError::WebServiceWorkerCacheErrorNotFound: | 24 case WebServiceWorkerCacheErrorNotFound: |
| 25 return "not found"; | 25 return "not found"; |
| 26 case WebServiceWorkerCacheError::WebServiceWorkerCacheErrorExists: | 26 case WebServiceWorkerCacheErrorExists: |
| 27 return "entry already exists"; | 27 return "entry already exists"; |
| 28 default: | 28 default: |
| 29 ASSERT_NOT_REACHED(); | 29 ASSERT_NOT_REACHED(); |
| 30 return "unknown error"; | 30 return "unknown error"; |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 | 33 |
| 34 class CacheStorageCallbacks : public WebServiceWorkerCacheStorage::CacheStorageC
allbacks { | 34 class CacheStorageCallbacks : public WebServiceWorkerCacheStorage::CacheStorageC
allbacks { |
| 35 WTF_MAKE_NONCOPYABLE(CacheStorageCallbacks); | 35 WTF_MAKE_NONCOPYABLE(CacheStorageCallbacks); |
| 36 public: | 36 public: |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 return promise; | 166 return promise; |
| 167 } | 167 } |
| 168 | 168 |
| 169 CacheStorage::CacheStorage(WebServiceWorkerCacheStorage* webCacheStorage) : m_we
bCacheStorage(webCacheStorage) | 169 CacheStorage::CacheStorage(WebServiceWorkerCacheStorage* webCacheStorage) : m_we
bCacheStorage(webCacheStorage) |
| 170 { | 170 { |
| 171 ScriptWrappable::init(this); | 171 ScriptWrappable::init(this); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace blink | 174 } // namespace blink |
| OLD | NEW |