| 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/cachestorage/Cache.h" | 6 #include "modules/cachestorage/Cache.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 m_completed = true; | 205 m_completed = true; |
| 206 | 206 |
| 207 ScriptState* state = m_resolver->scriptState(); | 207 ScriptState* state = m_resolver->scriptState(); |
| 208 ScriptState::Scope scope(state); | 208 ScriptState::Scope scope(state); |
| 209 m_resolver->reject(V8ThrowException::createTypeError(state->isolate(), e
xception->toString())); | 209 m_resolver->reject(V8ThrowException::createTypeError(state->isolate(), e
xception->toString())); |
| 210 } | 210 } |
| 211 | 211 |
| 212 DEFINE_INLINE_VIRTUAL_TRACE() | 212 DEFINE_INLINE_VIRTUAL_TRACE() |
| 213 { | 213 { |
| 214 visitor->trace(m_cache); | 214 visitor->trace(m_cache); |
| 215 visitor->trace(m_resolver); |
| 215 } | 216 } |
| 216 | 217 |
| 217 private: | 218 private: |
| 218 bool m_completed = false; | 219 bool m_completed = false; |
| 219 int m_numberOfRemainingOperations; | 220 int m_numberOfRemainingOperations; |
| 220 Member<Cache> m_cache; | 221 Member<Cache> m_cache; |
| 221 RefPtrWillBePersistent<ScriptPromiseResolver> m_resolver; | 222 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; |
| 222 Vector<WebServiceWorkerCache::BatchOperation> m_batchOperations; | 223 Vector<WebServiceWorkerCache::BatchOperation> m_batchOperations; |
| 223 }; | 224 }; |
| 224 | 225 |
| 225 class Cache::BlobHandleCallbackForPut final : public BodyStreamBuffer::BlobHandl
eCreatorClient { | 226 class Cache::BlobHandleCallbackForPut final : public BodyStreamBuffer::BlobHandl
eCreatorClient { |
| 226 public: | 227 public: |
| 227 BlobHandleCallbackForPut(size_t index, BarrierCallbackForPut* barrierCallbac
k, Request* request, Response* response) | 228 BlobHandleCallbackForPut(size_t index, BarrierCallbackForPut* barrierCallbac
k, Request* request, Response* response) |
| 228 : m_index(index) | 229 : m_index(index) |
| 229 , m_barrierCallback(barrierCallback) | 230 , m_barrierCallback(barrierCallback) |
| 230 { | 231 { |
| 231 request->populateWebServiceWorkerRequest(m_webRequest); | 232 request->populateWebServiceWorkerRequest(m_webRequest); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, toWebQ
ueryParams(options)); | 480 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, toWebQ
ueryParams(options)); |
| 480 return promise; | 481 return promise; |
| 481 } | 482 } |
| 482 | 483 |
| 483 WebServiceWorkerCache* Cache::webCache() const | 484 WebServiceWorkerCache* Cache::webCache() const |
| 484 { | 485 { |
| 485 return m_webCache.get(); | 486 return m_webCache.get(); |
| 486 } | 487 } |
| 487 | 488 |
| 488 } // namespace blink | 489 } // namespace blink |
| OLD | NEW |