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

Side by Side Diff: chrome/browser/google_apis/gdata_contacts_requests.cc

Issue 26784003: google_apis: Implement google_apis::ResponseWriter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/google_apis/gdata_contacts_requests.h" 5 #include "chrome/browser/google_apis/gdata_contacts_requests.h"
6 6
7 #include "chrome/browser/google_apis/time_util.h" 7 #include "chrome/browser/google_apis/time_util.h"
8 #include "net/base/url_util.h" 8 #include "net/base/url_util.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 GetContactPhotoRequest::~GetContactPhotoRequest() {} 95 GetContactPhotoRequest::~GetContactPhotoRequest() {}
96 96
97 GURL GetContactPhotoRequest::GetURL() const { 97 GURL GetContactPhotoRequest::GetURL() const {
98 return photo_url_; 98 return photo_url_;
99 } 99 }
100 100
101 void GetContactPhotoRequest::ProcessURLFetchResults( 101 void GetContactPhotoRequest::ProcessURLFetchResults(
102 const net::URLFetcher* source) { 102 const net::URLFetcher* source) {
103 GDataErrorCode code = GetErrorCode(source); 103 GDataErrorCode code = GetErrorCode(source);
104 scoped_ptr<std::string> data(new std::string); 104 scoped_ptr<std::string> data(new std::string(response_writer()->data()));
105 source->GetResponseAsString(data.get());
106 callback_.Run(code, data.Pass()); 105 callback_.Run(code, data.Pass());
107 OnProcessURLFetchResultsComplete(); 106 OnProcessURLFetchResultsComplete();
108 } 107 }
109 108
110 void GetContactPhotoRequest::RunCallbackOnPrematureFailure( 109 void GetContactPhotoRequest::RunCallbackOnPrematureFailure(
111 GDataErrorCode code) { 110 GDataErrorCode code) {
112 scoped_ptr<std::string> data(new std::string); 111 scoped_ptr<std::string> data(new std::string);
113 callback_.Run(code, data.Pass()); 112 callback_.Run(code, data.Pass());
114 } 113 }
115 114
116 } // namespace google_apis 115 } // namespace google_apis
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/base_requests.cc ('k') | net/tools/get_server_time/get_server_time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698