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/InspectorCacheStorageAgent.h" | 5 #include "modules/cachestorage/InspectorCacheStorageAgent.h" |
6 | 6 |
7 #include "platform/heap/Handle.h" | 7 #include "platform/heap/Handle.h" |
8 #include "platform/weborigin/KURL.h" | 8 #include "platform/weborigin/KURL.h" |
9 #include "platform/weborigin/SecurityOrigin.h" | 9 #include "platform/weborigin/SecurityOrigin.h" |
10 #include "public/platform/Platform.h" | 10 #include "public/platform/Platform.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 m_callback(std::move(callback)) {} | 378 m_callback(std::move(callback)) {} |
379 ~GetCacheForDeleteEntry() override {} | 379 ~GetCacheForDeleteEntry() override {} |
380 | 380 |
381 void onSuccess(std::unique_ptr<WebServiceWorkerCache> cache) override { | 381 void onSuccess(std::unique_ptr<WebServiceWorkerCache> cache) override { |
382 auto deleteRequest = | 382 auto deleteRequest = |
383 WTF::makeUnique<DeleteCacheEntry>(std::move(m_callback)); | 383 WTF::makeUnique<DeleteCacheEntry>(std::move(m_callback)); |
384 BatchOperation deleteOperation; | 384 BatchOperation deleteOperation; |
385 deleteOperation.operationType = WebServiceWorkerCache::OperationTypeDelete; | 385 deleteOperation.operationType = WebServiceWorkerCache::OperationTypeDelete; |
386 deleteOperation.request.setURL(KURL(ParsedURLString, m_requestSpec)); | 386 deleteOperation.request.setURL(KURL(ParsedURLString, m_requestSpec)); |
387 Vector<BatchOperation> operations; | 387 Vector<BatchOperation> operations; |
388 operations.append(deleteOperation); | 388 operations.push_back(deleteOperation); |
389 cache.release()->dispatchBatch(std::move(deleteRequest), | 389 cache.release()->dispatchBatch(std::move(deleteRequest), |
390 WebVector<BatchOperation>(operations)); | 390 WebVector<BatchOperation>(operations)); |
391 } | 391 } |
392 | 392 |
393 void onError(WebServiceWorkerCacheError error) override { | 393 void onError(WebServiceWorkerCacheError error) override { |
394 m_callback->sendFailure(Response::Error(String::format( | 394 m_callback->sendFailure(Response::Error(String::format( |
395 "Error requesting cache %s: %s", m_cacheName.utf8().data(), | 395 "Error requesting cache %s: %s", m_cacheName.utf8().data(), |
396 serviceWorkerCacheErrorString(error).data()))); | 396 serviceWorkerCacheErrorString(error).data()))); |
397 } | 397 } |
398 | 398 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 if (!response.isSuccess()) { | 484 if (!response.isSuccess()) { |
485 callback->sendFailure(response); | 485 callback->sendFailure(response); |
486 return; | 486 return; |
487 } | 487 } |
488 cache->dispatchOpen(WTF::makeUnique<GetCacheForDeleteEntry>( | 488 cache->dispatchOpen(WTF::makeUnique<GetCacheForDeleteEntry>( |
489 request, cacheName, std::move(callback)), | 489 request, cacheName, std::move(callback)), |
490 WebString(cacheName)); | 490 WebString(cacheName)); |
491 } | 491 } |
492 | 492 |
493 } // namespace blink | 493 } // namespace blink |
OLD | NEW |