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

Side by Side Diff: chrome/browser/sync/glue/http_bridge.cc

Issue 6166010: net: Remove typedef net::URLRequestStatus URLRequestStatus; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 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 "chrome/browser/sync/glue/http_bridge.h" 5 #include "chrome/browser/sync/glue/http_bridge.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "chrome/browser/browser_thread.h" 10 #include "chrome/browser/browser_thread.h"
11 #include "net/base/cookie_monster.h" 11 #include "net/base/cookie_monster.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 const std::string HttpBridge::GetResponseHeaderValue( 212 const std::string HttpBridge::GetResponseHeaderValue(
213 const std::string& name) const { 213 const std::string& name) const {
214 214
215 DCHECK_EQ(MessageLoop::current(), created_on_loop_); 215 DCHECK_EQ(MessageLoop::current(), created_on_loop_);
216 DCHECK(request_completed_); 216 DCHECK(request_completed_);
217 std::string value; 217 std::string value;
218 response_headers_->EnumerateHeader(NULL, name, &value); 218 response_headers_->EnumerateHeader(NULL, name, &value);
219 return value; 219 return value;
220 } 220 }
221 221
222 void HttpBridge::OnURLFetchComplete(const URLFetcher *source, const GURL &url, 222 void HttpBridge::OnURLFetchComplete(const URLFetcher *source,
223 const URLRequestStatus &status, 223 const GURL &url,
224 const net::URLRequestStatus &status,
224 int response_code, 225 int response_code,
225 const ResponseCookies &cookies, 226 const ResponseCookies &cookies,
226 const std::string &data) { 227 const std::string &data) {
227 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 228 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
228 229
229 request_completed_ = true; 230 request_completed_ = true;
230 request_succeeded_ = (URLRequestStatus::SUCCESS == status.status()); 231 request_succeeded_ = (net::URLRequestStatus::SUCCESS == status.status());
231 http_response_code_ = response_code; 232 http_response_code_ = response_code;
232 os_error_code_ = status.os_error(); 233 os_error_code_ = status.os_error();
233 234
234 response_content_ = data; 235 response_content_ = data;
235 response_headers_ = source->response_headers(); 236 response_headers_ = source->response_headers();
236 237
237 // End of the line for url_poster_. It lives only on the IO loop. 238 // End of the line for url_poster_. It lives only on the IO loop.
238 // We defer deletion because we're inside a callback from a component of the 239 // We defer deletion because we're inside a callback from a component of the
239 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. 240 // URLFetcher, so it seems most natural / "polite" to let the stack unwind.
240 MessageLoop::current()->DeleteSoon(FROM_HERE, url_poster_); 241 MessageLoop::current()->DeleteSoon(FROM_HERE, url_poster_);
241 url_poster_ = NULL; 242 url_poster_ = NULL;
242 243
243 // Wake the blocked syncer thread in MakeSynchronousPost. 244 // Wake the blocked syncer thread in MakeSynchronousPost.
244 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! 245 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted!
245 http_post_completed_.Signal(); 246 http_post_completed_.Signal();
246 } 247 }
247 248
248 } // namespace browser_sync 249 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/speech/speech_recognizer_unittest.cc ('k') | chrome/browser/sync/glue/http_bridge_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698