| OLD | NEW |
| 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/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 "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // TODO(timsteele): We don't currently listen for pref changes of these | 98 // TODO(timsteele): We don't currently listen for pref changes of these |
| 99 // fields or CookiePolicy; I'm not sure we want to strictly follow the | 99 // fields or CookiePolicy; I'm not sure we want to strictly follow the |
| 100 // default settings, since for example if the user chooses to block all | 100 // default settings, since for example if the user chooses to block all |
| 101 // cookies, sync will start failing. Also it seems like accept_lang/charset | 101 // cookies, sync will start failing. Also it seems like accept_lang/charset |
| 102 // should be tied to whatever the sync servers expect (if anything). These | 102 // should be tied to whatever the sync servers expect (if anything). These |
| 103 // fields should probably just be settable by sync backend; though we should | 103 // fields should probably just be settable by sync backend; though we should |
| 104 // figure out if we need to give the user explicit control over policies etc. | 104 // figure out if we need to give the user explicit control over policies etc. |
| 105 set_accept_language(baseline_context->accept_language()); | 105 set_accept_language(baseline_context->accept_language()); |
| 106 set_accept_charset(baseline_context->accept_charset()); | 106 set_accept_charset(baseline_context->accept_charset()); |
| 107 | 107 |
| 108 // We use the standard throttling manager. |
| 109 set_throttler_manager(baseline_context->throttler_manager()); |
| 110 |
| 108 // We default to the browser's user agent. This can (and should) be overridden | 111 // We default to the browser's user agent. This can (and should) be overridden |
| 109 // with set_user_agent. | 112 // with set_user_agent. |
| 110 set_user_agent(content::GetUserAgent(GURL())); | 113 set_user_agent(content::GetUserAgent(GURL())); |
| 111 | 114 |
| 112 set_net_log(baseline_context->net_log()); | 115 set_net_log(baseline_context->net_log()); |
| 113 } | 116 } |
| 114 | 117 |
| 115 HttpBridge::RequestContext::~RequestContext() { | 118 HttpBridge::RequestContext::~RequestContext() { |
| 116 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 117 delete http_transaction_factory(); | 120 delete http_transaction_factory(); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. | 304 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. |
| 302 MessageLoop::current()->DeleteSoon(FROM_HERE, fetch_state_.url_poster); | 305 MessageLoop::current()->DeleteSoon(FROM_HERE, fetch_state_.url_poster); |
| 303 fetch_state_.url_poster = NULL; | 306 fetch_state_.url_poster = NULL; |
| 304 | 307 |
| 305 // Wake the blocked syncer thread in MakeSynchronousPost. | 308 // Wake the blocked syncer thread in MakeSynchronousPost. |
| 306 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! | 309 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! |
| 307 http_post_completed_.Signal(); | 310 http_post_completed_.Signal(); |
| 308 } | 311 } |
| 309 | 312 |
| 310 } // namespace browser_sync | 313 } // namespace browser_sync |
| OLD | NEW |