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

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: Created 5 years, 5 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"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 : m_callback(callback) 339 : m_callback(callback)
340 { 340 {
341 } 341 }
342 ~DeleteCacheEntry() override { } 342 ~DeleteCacheEntry() override { }
343 343
344 void onSuccess() 344 void onSuccess()
345 { 345 {
346 m_callback->sendSuccess(); 346 m_callback->sendSuccess();
347 } 347 }
348 348
349 void onError(WebServiceWorkerCacheError* error) 349 void onError(WebPrivateOwnPtr<WebServiceWorkerCacheError>&& e)
350 { 350 {
351 m_callback->sendFailure(String::format("Error requesting cache names: %s ", serviceWorkerCacheErrorString(error).data())); 351 OwnPtr<WebServiceWorkerCacheError> error = e.release();
352 m_callback->sendFailure(String::format("Error requesting cache names: %s ", serviceWorkerCacheErrorString(error.get()).data()));
352 } 353 }
353 354
354 private: 355 private:
355 RefPtrWillBePersistent<DeleteEntryCallback> m_callback; 356 RefPtrWillBePersistent<DeleteEntryCallback> m_callback;
356 }; 357 };
357 358
358 class GetCacheForDeleteEntry 359 class GetCacheForDeleteEntry
359 : public WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks { 360 : public WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks {
360 WTF_MAKE_NONCOPYABLE(GetCacheForDeleteEntry); 361 WTF_MAKE_NONCOPYABLE(GetCacheForDeleteEntry);
361 362
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 OwnPtr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndNameForId( errorString, cacheId, &cacheName); 447 OwnPtr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndNameForId( errorString, cacheId, &cacheName);
447 if (!cache) { 448 if (!cache) {
448 callback->sendFailure(*errorString); 449 callback->sendFailure(*errorString);
449 return; 450 return;
450 } 451 }
451 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, callback) , WebString(cacheName)); 452 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, callback) , WebString(cacheName));
452 } 453 }
453 454
454 455
455 } // namespace blink 456 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698