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

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

Issue 2846843002: [blink] Unique pointers in Platform.h (Closed)
Patch Set: fix compilation (and again) Created 3 years, 7 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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 resolver_->Reject(CacheStorageError::CreateException(reason)); 219 resolver_->Reject(CacheStorageError::CreateException(reason));
220 resolver_.Clear(); 220 resolver_.Clear();
221 } 221 }
222 222
223 private: 223 private:
224 Persistent<ScriptPromiseResolver> resolver_; 224 Persistent<ScriptPromiseResolver> resolver_;
225 }; 225 };
226 226
227 CacheStorage* CacheStorage::Create( 227 CacheStorage* CacheStorage::Create(
228 GlobalFetch::ScopedFetcher* fetcher, 228 GlobalFetch::ScopedFetcher* fetcher,
229 WebServiceWorkerCacheStorage* web_cache_storage) { 229 std::unique_ptr<WebServiceWorkerCacheStorage> web_cache_storage) {
230 return new CacheStorage(fetcher, WTF::WrapUnique(web_cache_storage)); 230 return new CacheStorage(fetcher, std::move(web_cache_storage));
231 } 231 }
232 232
233 ScriptPromise CacheStorage::open(ScriptState* script_state, 233 ScriptPromise CacheStorage::open(ScriptState* script_state,
234 const String& cache_name, 234 const String& cache_name,
235 ExceptionState& exception_state) { 235 ExceptionState& exception_state) {
236 if (!CommonChecks(script_state, exception_state)) 236 if (!CommonChecks(script_state, exception_state))
237 return ScriptPromise(); 237 return ScriptPromise();
238 238
239 ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); 239 ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
240 const ScriptPromise promise = resolver->Promise(); 240 const ScriptPromise promise = resolver->Promise();
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 356
357 void CacheStorage::Dispose() { 357 void CacheStorage::Dispose() {
358 web_cache_storage_.reset(); 358 web_cache_storage_.reset();
359 } 359 }
360 360
361 DEFINE_TRACE(CacheStorage) { 361 DEFINE_TRACE(CacheStorage) {
362 visitor->Trace(scoped_fetcher_); 362 visitor->Trace(scoped_fetcher_);
363 } 363 }
364 364
365 } // namespace blink 365 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698