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

Side by Side Diff: storage/browser/blob/blob_url_request_job_factory.cc

Issue 2842833003: Update SupportsUserData uses with unique_ptr. (Closed)
Patch Set: rebase 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
« no previous file with comments | « gin/modules/module_registry.cc ('k') | ui/web_dialogs/web_dialog_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "storage/browser/blob/blob_url_request_job_factory.h" 5 #include "storage/browser/blob/blob_url_request_job_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 21 matching lines...) Expand all
32 std::unique_ptr<net::URLRequest> request = request_context->CreateRequest( 32 std::unique_ptr<net::URLRequest> request = request_context->CreateRequest(
33 kBlobUrl, net::DEFAULT_PRIORITY, request_delegate); 33 kBlobUrl, net::DEFAULT_PRIORITY, request_delegate);
34 SetRequestedBlobDataHandle(request.get(), std::move(blob_data_handle)); 34 SetRequestedBlobDataHandle(request.get(), std::move(blob_data_handle));
35 return request; 35 return request;
36 } 36 }
37 37
38 // static 38 // static
39 void BlobProtocolHandler::SetRequestedBlobDataHandle( 39 void BlobProtocolHandler::SetRequestedBlobDataHandle(
40 net::URLRequest* request, 40 net::URLRequest* request,
41 std::unique_ptr<BlobDataHandle> blob_data_handle) { 41 std::unique_ptr<BlobDataHandle> blob_data_handle) {
42 request->SetUserData(&kUserDataKey, blob_data_handle.release()); 42 request->SetUserData(&kUserDataKey, std::move(blob_data_handle));
43 } 43 }
44 44
45 // static 45 // static
46 BlobDataHandle* BlobProtocolHandler::GetRequestBlobDataHandle( 46 BlobDataHandle* BlobProtocolHandler::GetRequestBlobDataHandle(
47 net::URLRequest* request) { 47 net::URLRequest* request) {
48 return static_cast<BlobDataHandle*>(request->GetUserData(&kUserDataKey)); 48 return static_cast<BlobDataHandle*>(request->GetUserData(&kUserDataKey));
49 } 49 }
50 50
51 BlobProtocolHandler::BlobProtocolHandler( 51 BlobProtocolHandler::BlobProtocolHandler(
52 BlobStorageContext* context, 52 BlobStorageContext* context,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 std::string uuid = request->url().spec().substr(kPrefix.length()); 86 std::string uuid = request->url().spec().substr(kPrefix.length());
87 std::unique_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid); 87 std::unique_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid);
88 BlobDataHandle* handle_ptr = handle.get(); 88 BlobDataHandle* handle_ptr = handle.get();
89 if (handle) { 89 if (handle) {
90 SetRequestedBlobDataHandle(request, std::move(handle)); 90 SetRequestedBlobDataHandle(request, std::move(handle));
91 } 91 }
92 return handle_ptr; 92 return handle_ptr;
93 } 93 }
94 94
95 } // namespace storage 95 } // namespace storage
OLDNEW
« no previous file with comments | « gin/modules/module_registry.cc ('k') | ui/web_dialogs/web_dialog_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698