Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: Source/modules/cachestorage/InspectorCacheStorageAgent.cpp

Issue 1234603003: CallbackPromiseAdapter types should be more compatible with WebCallbacks (1/3). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: retry! Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/InspectorCacheStorageAgent.h" 6 #include "modules/cachestorage/InspectorCacheStorageAgent.h"
7 7
8 #include "core/InspectorBackendDispatcher.h" 8 #include "core/InspectorBackendDispatcher.h"
9 #include "core/InspectorTypeBuilder.h" 9 #include "core/InspectorTypeBuilder.h"
10 #include "platform/JSONValues.h" 10 #include "platform/JSONValues.h"
11 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
12 #include "platform/weborigin/DatabaseIdentifier.h" 12 #include "platform/weborigin/DatabaseIdentifier.h"
13 #include "platform/weborigin/KURL.h" 13 #include "platform/weborigin/KURL.h"
14 #include "platform/weborigin/SecurityOrigin.h" 14 #include "platform/weborigin/SecurityOrigin.h"
15 #include "public/platform/Platform.h" 15 #include "public/platform/Platform.h"
16 #include "public/platform/WebPassOwnPtr.h"
16 #include "public/platform/WebServiceWorkerCache.h" 17 #include "public/platform/WebServiceWorkerCache.h"
17 #include "public/platform/WebServiceWorkerCacheError.h" 18 #include "public/platform/WebServiceWorkerCacheError.h"
18 #include "public/platform/WebServiceWorkerCacheStorage.h" 19 #include "public/platform/WebServiceWorkerCacheStorage.h"
19 #include "public/platform/WebServiceWorkerRequest.h" 20 #include "public/platform/WebServiceWorkerRequest.h"
20 #include "public/platform/WebServiceWorkerResponse.h" 21 #include "public/platform/WebServiceWorkerResponse.h"
21 #include "public/platform/WebString.h" 22 #include "public/platform/WebString.h"
22 #include "public/platform/WebURL.h" 23 #include "public/platform/WebURL.h"
23 #include "public/platform/WebVector.h" 24 #include "public/platform/WebVector.h"
24 #include "wtf/Noncopyable.h" 25 #include "wtf/Noncopyable.h"
25 #include "wtf/OwnPtr.h" 26 #include "wtf/OwnPtr.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 : m_callback(callback) 340 : m_callback(callback)
340 { 341 {
341 } 342 }
342 ~DeleteCacheEntry() override { } 343 ~DeleteCacheEntry() override { }
343 344
344 void onSuccess() 345 void onSuccess()
345 { 346 {
346 m_callback->sendSuccess(); 347 m_callback->sendSuccess();
347 } 348 }
348 349
349 void onError(WebServiceWorkerCacheError* error) 350 void onError(WebPassOwnPtr<WebServiceWorkerCacheError> e)
350 { 351 {
351 m_callback->sendFailure(String::format("Error requesting cache names: %s ", serviceWorkerCacheErrorString(error).data())); 352 OwnPtr<WebServiceWorkerCacheError> error = e.release();
353 m_callback->sendFailure(String::format("Error requesting cache names: %s ", serviceWorkerCacheErrorString(error.get()).data()));
352 } 354 }
353 355
354 private: 356 private:
355 RefPtrWillBePersistent<DeleteEntryCallback> m_callback; 357 RefPtrWillBePersistent<DeleteEntryCallback> m_callback;
356 }; 358 };
357 359
358 class GetCacheForDeleteEntry 360 class GetCacheForDeleteEntry
359 : public WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks { 361 : public WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks {
360 WTF_MAKE_NONCOPYABLE(GetCacheForDeleteEntry); 362 WTF_MAKE_NONCOPYABLE(GetCacheForDeleteEntry);
361 363
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 OwnPtr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndNameForId( errorString, cacheId, &cacheName); 448 OwnPtr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndNameForId( errorString, cacheId, &cacheName);
447 if (!cache) { 449 if (!cache) {
448 callback->sendFailure(*errorString); 450 callback->sendFailure(*errorString);
449 return; 451 return;
450 } 452 }
451 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, callback) , WebString(cacheName)); 453 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, callback) , WebString(cacheName));
452 } 454 }
453 455
454 456
455 } // namespace blink 457 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/cachestorage/CacheStorageError.cpp ('k') | Source/modules/geofencing/Geofencing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698