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

Side by Side Diff: chrome/browser/local_discovery/gcd_api_flow_impl.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 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 "chrome/browser/local_discovery/gcd_api_flow_impl.h" 5 #include "chrome/browser/local_discovery/gcd_api_flow_impl.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void GCDApiFlowImpl::OnGetTokenFailure( 57 void GCDApiFlowImpl::OnGetTokenFailure(
58 const OAuth2TokenService::Request* request, 58 const OAuth2TokenService::Request* request,
59 const GoogleServiceAuthError& error) { 59 const GoogleServiceAuthError& error) {
60 request_->OnGCDAPIFlowError(ERROR_TOKEN); 60 request_->OnGCDAPIFlowError(ERROR_TOKEN);
61 } 61 }
62 62
63 void GCDApiFlowImpl::CreateRequest(const GURL& url) { 63 void GCDApiFlowImpl::CreateRequest(const GURL& url) {
64 net::URLFetcher::RequestType request_type = request_->GetRequestType(); 64 net::URLFetcher::RequestType request_type = request_->GetRequestType();
65 65
66 url_fetcher_.reset(net::URLFetcher::Create(url, request_type, this)); 66 url_fetcher_ = net::URLFetcher::Create(url, request_type, this);
67 67
68 if (request_type != net::URLFetcher::GET) { 68 if (request_type != net::URLFetcher::GET) {
69 std::string upload_type; 69 std::string upload_type;
70 std::string upload_data; 70 std::string upload_data;
71 request_->GetUploadData(&upload_type, &upload_data); 71 request_->GetUploadData(&upload_type, &upload_data);
72 url_fetcher_->SetUploadData(upload_type, upload_data); 72 url_fetcher_->SetUploadData(upload_type, upload_data);
73 } 73 }
74 74
75 url_fetcher_->SetRequestContext(request_context_.get()); 75 url_fetcher_->SetRequestContext(request_context_.get());
76 76
(...skipping 26 matching lines...) Expand all
103 103
104 if (!value || !value->GetAsDictionary(&dictionary_value)) { 104 if (!value || !value->GetAsDictionary(&dictionary_value)) {
105 request_->OnGCDAPIFlowError(ERROR_MALFORMED_RESPONSE); 105 request_->OnGCDAPIFlowError(ERROR_MALFORMED_RESPONSE);
106 return; 106 return;
107 } 107 }
108 108
109 request_->OnGCDAPIFlowComplete(*dictionary_value); 109 request_->OnGCDAPIFlowComplete(*dictionary_value);
110 } 110 }
111 111
112 } // namespace local_discovery 112 } // namespace local_discovery
OLDNEW
« no previous file with comments | « chrome/browser/intranet_redirect_detector.cc ('k') | chrome/browser/local_discovery/privet_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698