| 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 "modules/cachestorage/CacheStorage.h" | 5 #include "modules/cachestorage/CacheStorage.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
| 9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
| 10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 explicit KeysCallbacks(ScriptPromiseResolver* resolver) | 199 explicit KeysCallbacks(ScriptPromiseResolver* resolver) |
| 200 : m_resolver(resolver) {} | 200 : m_resolver(resolver) {} |
| 201 ~KeysCallbacks() override {} | 201 ~KeysCallbacks() override {} |
| 202 | 202 |
| 203 void onSuccess(const WebVector<WebString>& keys) override { | 203 void onSuccess(const WebVector<WebString>& keys) override { |
| 204 if (!m_resolver->getExecutionContext() || | 204 if (!m_resolver->getExecutionContext() || |
| 205 m_resolver->getExecutionContext()->isContextDestroyed()) | 205 m_resolver->getExecutionContext()->isContextDestroyed()) |
| 206 return; | 206 return; |
| 207 Vector<String> wtfKeys; | 207 Vector<String> wtfKeys; |
| 208 for (size_t i = 0; i < keys.size(); ++i) | 208 for (size_t i = 0; i < keys.size(); ++i) |
| 209 wtfKeys.append(keys[i]); | 209 wtfKeys.push_back(keys[i]); |
| 210 m_resolver->resolve(wtfKeys); | 210 m_resolver->resolve(wtfKeys); |
| 211 m_resolver.clear(); | 211 m_resolver.clear(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void onError(WebServiceWorkerCacheError reason) override { | 214 void onError(WebServiceWorkerCacheError reason) override { |
| 215 if (!m_resolver->getExecutionContext() || | 215 if (!m_resolver->getExecutionContext() || |
| 216 m_resolver->getExecutionContext()->isContextDestroyed()) | 216 m_resolver->getExecutionContext()->isContextDestroyed()) |
| 217 return; | 217 return; |
| 218 m_resolver->reject(CacheStorageError::createException(reason)); | 218 m_resolver->reject(CacheStorageError::createException(reason)); |
| 219 m_resolver.clear(); | 219 m_resolver.clear(); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 353 |
| 354 void CacheStorage::dispose() { | 354 void CacheStorage::dispose() { |
| 355 m_webCacheStorage.reset(); | 355 m_webCacheStorage.reset(); |
| 356 } | 356 } |
| 357 | 357 |
| 358 DEFINE_TRACE(CacheStorage) { | 358 DEFINE_TRACE(CacheStorage) { |
| 359 visitor->trace(m_scopedFetcher); | 359 visitor->trace(m_scopedFetcher); |
| 360 } | 360 } |
| 361 | 361 |
| 362 } // namespace blink | 362 } // namespace blink |
| OLD | NEW |