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

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

Issue 1546243002: Convert Pass()→std::move() in //storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 (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 <utility>
8
7 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
8 #include "net/base/request_priority.h" 10 #include "net/base/request_priority.h"
9 #include "net/url_request/url_request_context.h" 11 #include "net/url_request/url_request_context.h"
10 #include "storage/browser/blob/blob_data_handle.h" 12 #include "storage/browser/blob/blob_data_handle.h"
11 #include "storage/browser/blob/blob_storage_context.h" 13 #include "storage/browser/blob/blob_storage_context.h"
12 #include "storage/browser/blob/blob_url_request_job.h" 14 #include "storage/browser/blob/blob_url_request_job.h"
13 #include "storage/browser/fileapi/file_system_context.h" 15 #include "storage/browser/fileapi/file_system_context.h"
14 16
15 namespace storage { 17 namespace storage {
16 18
17 namespace { 19 namespace {
18 20
19 int kUserDataKey; // The value is not important, the addr is a key. 21 int kUserDataKey; // The value is not important, the addr is a key.
20 22
21 } // namespace 23 } // namespace
22 24
23 // static 25 // static
24 scoped_ptr<net::URLRequest> BlobProtocolHandler::CreateBlobRequest( 26 scoped_ptr<net::URLRequest> BlobProtocolHandler::CreateBlobRequest(
25 scoped_ptr<BlobDataHandle> blob_data_handle, 27 scoped_ptr<BlobDataHandle> blob_data_handle,
26 const net::URLRequestContext* request_context, 28 const net::URLRequestContext* request_context,
27 net::URLRequest::Delegate* request_delegate) { 29 net::URLRequest::Delegate* request_delegate) {
28 const GURL kBlobUrl("blob://see_user_data/"); 30 const GURL kBlobUrl("blob://see_user_data/");
29 scoped_ptr<net::URLRequest> request = request_context->CreateRequest( 31 scoped_ptr<net::URLRequest> request = request_context->CreateRequest(
30 kBlobUrl, net::DEFAULT_PRIORITY, request_delegate); 32 kBlobUrl, net::DEFAULT_PRIORITY, request_delegate);
31 SetRequestedBlobDataHandle(request.get(), blob_data_handle.Pass()); 33 SetRequestedBlobDataHandle(request.get(), std::move(blob_data_handle));
32 return request.Pass(); 34 return request;
33 } 35 }
34 36
35 // static 37 // static
36 void BlobProtocolHandler::SetRequestedBlobDataHandle( 38 void BlobProtocolHandler::SetRequestedBlobDataHandle(
37 net::URLRequest* request, 39 net::URLRequest* request,
38 scoped_ptr<BlobDataHandle> blob_data_handle) { 40 scoped_ptr<BlobDataHandle> blob_data_handle) {
39 request->SetUserData(&kUserDataKey, blob_data_handle.release()); 41 request->SetUserData(&kUserDataKey, blob_data_handle.release());
40 } 42 }
41 43
42 // static 44 // static
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // TODO(michaeln): Replace this use case and others like it with a BlobReader 79 // TODO(michaeln): Replace this use case and others like it with a BlobReader
78 // impl that does not depend on urlfetching to perform this function. 80 // impl that does not depend on urlfetching to perform this function.
79 const std::string kPrefix("blob:uuid/"); 81 const std::string kPrefix("blob:uuid/");
80 if (!base::StartsWith(request->url().spec(), kPrefix, 82 if (!base::StartsWith(request->url().spec(), kPrefix,
81 base::CompareCase::SENSITIVE)) 83 base::CompareCase::SENSITIVE))
82 return NULL; 84 return NULL;
83 std::string uuid = request->url().spec().substr(kPrefix.length()); 85 std::string uuid = request->url().spec().substr(kPrefix.length());
84 scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid); 86 scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid);
85 BlobDataHandle* handle_ptr = handle.get(); 87 BlobDataHandle* handle_ptr = handle.get();
86 if (handle) { 88 if (handle) {
87 SetRequestedBlobDataHandle(request, handle.Pass()); 89 SetRequestedBlobDataHandle(request, std::move(handle));
88 } 90 }
89 return handle_ptr; 91 return handle_ptr;
90 } 92 }
91 93
92 } // namespace storage 94 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_storage_context.cc ('k') | storage/browser/blob/internal_blob_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698