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

Side by Side Diff: content/renderer/cache_storage/cache_storage_dispatcher.cc

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 "content/renderer/cache_storage/cache_storage_dispatcher.h" 5 #include "content/renderer/cache_storage/cache_storage_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 int request_id, 296 int request_id,
297 int cache_id) { 297 int cache_id) {
298 DCHECK_EQ(thread_id, CurrentWorkerId()); 298 DCHECK_EQ(thread_id, CurrentWorkerId());
299 scoped_ptr<WebCache> web_cache( 299 scoped_ptr<WebCache> web_cache(
300 new WebCache(weak_factory_.GetWeakPtr(), cache_id)); 300 new WebCache(weak_factory_.GetWeakPtr(), cache_id));
301 web_caches_.AddWithID(web_cache.get(), cache_id); 301 web_caches_.AddWithID(web_cache.get(), cache_id);
302 UMA_HISTOGRAM_TIMES("ServiceWorkerCache.CacheStorage.Open", 302 UMA_HISTOGRAM_TIMES("ServiceWorkerCache.CacheStorage.Open",
303 TimeTicks::Now() - open_times_[request_id]); 303 TimeTicks::Now() - open_times_[request_id]);
304 WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks* callbacks = 304 WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks* callbacks =
305 open_callbacks_.Lookup(request_id); 305 open_callbacks_.Lookup(request_id);
306 callbacks->onSuccess(blink::adoptWebPtr(web_cache.release())); 306 callbacks->onSuccess(std::move(web_cache));
307 open_callbacks_.Remove(request_id); 307 open_callbacks_.Remove(request_id);
308 open_times_.erase(request_id); 308 open_times_.erase(request_id);
309 } 309 }
310 310
311 void CacheStorageDispatcher::OnCacheStorageDeleteSuccess(int thread_id, 311 void CacheStorageDispatcher::OnCacheStorageDeleteSuccess(int thread_id,
312 int request_id) { 312 int request_id) {
313 DCHECK_EQ(thread_id, CurrentWorkerId()); 313 DCHECK_EQ(thread_id, CurrentWorkerId());
314 UMA_HISTOGRAM_TIMES("ServiceWorkerCache.CacheStorage.Delete", 314 UMA_HISTOGRAM_TIMES("ServiceWorkerCache.CacheStorage.Delete",
315 TimeTicks::Now() - delete_times_[request_id]); 315 TimeTicks::Now() - delete_times_[request_id]);
316 WebServiceWorkerCacheStorage::CacheStorageCallbacks* callbacks = 316 WebServiceWorkerCacheStorage::CacheStorageCallbacks* callbacks =
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 CacheStorageDispatcher::WebResponsesFromResponses( 673 CacheStorageDispatcher::WebResponsesFromResponses(
674 const std::vector<ServiceWorkerResponse>& responses) { 674 const std::vector<ServiceWorkerResponse>& responses) {
675 blink::WebVector<blink::WebServiceWorkerResponse> web_responses( 675 blink::WebVector<blink::WebServiceWorkerResponse> web_responses(
676 responses.size()); 676 responses.size());
677 for (size_t i = 0; i < responses.size(); ++i) 677 for (size_t i = 0; i < responses.size(); ++i)
678 PopulateWebResponseFromResponse(responses[i], &(web_responses[i])); 678 PopulateWebResponseFromResponse(responses[i], &(web_responses[i]));
679 return web_responses; 679 return web_responses;
680 } 680 }
681 681
682 } // namespace content 682 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/bluetooth/bluetooth_dispatcher.cc ('k') | content/renderer/media/rtc_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698