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

Side by Side Diff: third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp

Issue 1865913005: Nuke WebPassOwnPtr<T> and replace it with std::unique_ptr<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
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 "modules/cachestorage/CacheStorage.h" 5 #include "modules/cachestorage/CacheStorage.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 }; 84 };
85 85
86 // FIXME: Consider using CallbackPromiseAdapter. 86 // FIXME: Consider using CallbackPromiseAdapter.
87 class CacheStorage::WithCacheCallbacks final : public WebServiceWorkerCacheStora ge::CacheStorageWithCacheCallbacks { 87 class CacheStorage::WithCacheCallbacks final : public WebServiceWorkerCacheStora ge::CacheStorageWithCacheCallbacks {
88 WTF_MAKE_NONCOPYABLE(WithCacheCallbacks); 88 WTF_MAKE_NONCOPYABLE(WithCacheCallbacks);
89 public: 89 public:
90 WithCacheCallbacks(const String& cacheName, CacheStorage* cacheStorage, Scri ptPromiseResolver* resolver) 90 WithCacheCallbacks(const String& cacheName, CacheStorage* cacheStorage, Scri ptPromiseResolver* resolver)
91 : m_cacheName(cacheName), m_cacheStorage(cacheStorage), m_resolver(resol ver) { } 91 : m_cacheName(cacheName), m_cacheStorage(cacheStorage), m_resolver(resol ver) { }
92 ~WithCacheCallbacks() override { } 92 ~WithCacheCallbacks() override { }
93 93
94 void onSuccess(WebPassOwnPtr<WebServiceWorkerCache> webCache) override 94 void onSuccess(std::unique_ptr<WebServiceWorkerCache> webCache) override
95 { 95 {
96 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex t()->activeDOMObjectsAreStopped()) 96 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex t()->activeDOMObjectsAreStopped())
97 return; 97 return;
98 Cache* cache = Cache::create(m_cacheStorage->m_scopedFetcher, webCache.r elease()); 98 Cache* cache = Cache::create(m_cacheStorage->m_scopedFetcher, adoptPtr(w ebCache.release()));
99 m_cacheStorage->m_nameToCacheMap.set(m_cacheName, cache); 99 m_cacheStorage->m_nameToCacheMap.set(m_cacheName, cache);
100 m_resolver->resolve(cache); 100 m_resolver->resolve(cache);
101 m_resolver.clear(); 101 m_resolver.clear();
102 } 102 }
103 103
104 void onError(WebServiceWorkerCacheError reason) override 104 void onError(WebServiceWorkerCacheError reason) override
105 { 105 {
106 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex t()->activeDOMObjectsAreStopped()) 106 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContex t()->activeDOMObjectsAreStopped())
107 return; 107 return;
108 if (reason == WebServiceWorkerCacheErrorNotFound) 108 if (reason == WebServiceWorkerCacheErrorNotFound)
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 m_webCacheStorage.clear(); 340 m_webCacheStorage.clear();
341 } 341 }
342 342
343 DEFINE_TRACE(CacheStorage) 343 DEFINE_TRACE(CacheStorage)
344 { 344 {
345 visitor->trace(m_scopedFetcher); 345 visitor->trace(m_scopedFetcher);
346 visitor->trace(m_nameToCacheMap); 346 visitor->trace(m_nameToCacheMap);
347 } 347 }
348 348
349 } // namespace blink 349 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698