| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 class GetCacheResponsesForRequestData | 226 class GetCacheResponsesForRequestData |
| 227 : public WebServiceWorkerCache::CacheMatchCallbacks { | 227 : public WebServiceWorkerCache::CacheMatchCallbacks { |
| 228 WTF_MAKE_NONCOPYABLE(GetCacheResponsesForRequestData); | 228 WTF_MAKE_NONCOPYABLE(GetCacheResponsesForRequestData); |
| 229 | 229 |
| 230 public: | 230 public: |
| 231 GetCacheResponsesForRequestData(const DataRequestParams& params, | 231 GetCacheResponsesForRequestData(const DataRequestParams& params, |
| 232 const WebServiceWorkerRequest& request, | 232 const WebServiceWorkerRequest& request, |
| 233 PassRefPtr<ResponsesAccumulator> accum) | 233 PassRefPtr<ResponsesAccumulator> accum) |
| 234 : m_params(params), m_request(request), m_accumulator(accum) {} | 234 : m_params(params), m_request(request), m_accumulator(std::move(accum)) {} |
| 235 ~GetCacheResponsesForRequestData() override {} | 235 ~GetCacheResponsesForRequestData() override {} |
| 236 | 236 |
| 237 void onSuccess(const WebServiceWorkerResponse& response) override { | 237 void onSuccess(const WebServiceWorkerResponse& response) override { |
| 238 m_accumulator->addRequestResponsePair(m_request, response); | 238 m_accumulator->addRequestResponsePair(m_request, response); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void onError(WebServiceWorkerCacheError error) override { | 241 void onError(WebServiceWorkerCacheError error) override { |
| 242 m_accumulator->sendFailure(Response::Error( | 242 m_accumulator->sendFailure(Response::Error( |
| 243 String::format("Error requesting responses for cache %s: %s", | 243 String::format("Error requesting responses for cache %s: %s", |
| 244 m_params.cacheName.utf8().data(), | 244 m_params.cacheName.utf8().data(), |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 if (!response.isSuccess()) { | 485 if (!response.isSuccess()) { |
| 486 callback->sendFailure(response); | 486 callback->sendFailure(response); |
| 487 return; | 487 return; |
| 488 } | 488 } |
| 489 cache->dispatchOpen(WTF::makeUnique<GetCacheForDeleteEntry>( | 489 cache->dispatchOpen(WTF::makeUnique<GetCacheForDeleteEntry>( |
| 490 request, cacheName, std::move(callback)), | 490 request, cacheName, std::move(callback)), |
| 491 WebString(cacheName)); | 491 WebString(cacheName)); |
| 492 } | 492 } |
| 493 | 493 |
| 494 } // namespace blink | 494 } // namespace blink |
| OLD | NEW |