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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 return; | 133 return; |
134 ScriptState::Scope scope(m_resolver->getScriptState()); | 134 ScriptState::Scope scope(m_resolver->getScriptState()); |
135 m_resolver->resolve(Response::create(m_resolver->getScriptState(), webRe
sponse)); | 135 m_resolver->resolve(Response::create(m_resolver->getScriptState(), webRe
sponse)); |
136 m_resolver.clear(); | 136 m_resolver.clear(); |
137 } | 137 } |
138 | 138 |
139 void onError(WebServiceWorkerCacheError reason) override | 139 void onError(WebServiceWorkerCacheError reason) override |
140 { | 140 { |
141 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) | 141 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex
t()->activeDOMObjectsAreStopped()) |
142 return; | 142 return; |
143 if (reason == WebServiceWorkerCacheErrorNotFound) | 143 if (reason == WebServiceWorkerCacheErrorNotFound || reason == WebService
WorkerCacheErrorCacheNameNotFound) |
144 m_resolver->resolve(); | 144 m_resolver->resolve(); |
145 else | 145 else |
146 m_resolver->reject(CacheStorageError::createException(reason)); | 146 m_resolver->reject(CacheStorageError::createException(reason)); |
147 m_resolver.clear(); | 147 m_resolver.clear(); |
148 } | 148 } |
149 | 149 |
150 private: | 150 private: |
151 Persistent<ScriptPromiseResolver> m_resolver; | 151 Persistent<ScriptPromiseResolver> m_resolver; |
152 }; | 152 }; |
153 | 153 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 m_webCacheStorage.reset(); | 343 m_webCacheStorage.reset(); |
344 } | 344 } |
345 | 345 |
346 DEFINE_TRACE(CacheStorage) | 346 DEFINE_TRACE(CacheStorage) |
347 { | 347 { |
348 visitor->trace(m_scopedFetcher); | 348 visitor->trace(m_scopedFetcher); |
349 visitor->trace(m_nameToCacheMap); | 349 visitor->trace(m_nameToCacheMap); |
350 } | 350 } |
351 | 351 |
352 } // namespace blink | 352 } // namespace blink |
OLD | NEW |