| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 // Apply the user agent which was set earlier. | 39 // Apply the user agent which was set earlier. |
| 40 if (is_user_agent_set()) | 40 if (is_user_agent_set()) |
| 41 context_->set_user_agent(user_agent_); | 41 context_->set_user_agent(user_agent_); |
| 42 | 42 |
| 43 return context_; | 43 return context_; |
| 44 } | 44 } |
| 45 | 45 |
| 46 scoped_refptr<base::MessageLoopProxy> | 46 scoped_refptr<base::MessageLoopProxy> |
| 47 HttpBridge::RequestContextGetter::GetIOMessageLoopProxy() { | 47 HttpBridge::RequestContextGetter::GetIOMessageLoopProxy() const { |
| 48 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 48 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 49 } | 49 } |
| 50 | 50 |
| 51 HttpBridgeFactory::HttpBridgeFactory( | 51 HttpBridgeFactory::HttpBridgeFactory( |
| 52 URLRequestContextGetter* baseline_context_getter) { | 52 URLRequestContextGetter* baseline_context_getter) { |
| 53 DCHECK(baseline_context_getter != NULL); | 53 DCHECK(baseline_context_getter != NULL); |
| 54 request_context_getter_ = | 54 request_context_getter_ = |
| 55 new HttpBridge::RequestContextGetter(baseline_context_getter); | 55 new HttpBridge::RequestContextGetter(baseline_context_getter); |
| 56 } | 56 } |
| 57 | 57 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. | 239 // URLFetcher, so it seems most natural / "polite" to let the stack unwind. |
| 240 MessageLoop::current()->DeleteSoon(FROM_HERE, url_poster_); | 240 MessageLoop::current()->DeleteSoon(FROM_HERE, url_poster_); |
| 241 url_poster_ = NULL; | 241 url_poster_ = NULL; |
| 242 | 242 |
| 243 // Wake the blocked syncer thread in MakeSynchronousPost. | 243 // Wake the blocked syncer thread in MakeSynchronousPost. |
| 244 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! | 244 // WARNING: DONT DO ANYTHING AFTER THIS CALL! |this| may be deleted! |
| 245 http_post_completed_.Signal(); | 245 http_post_completed_.Signal(); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace browser_sync | 248 } // namespace browser_sync |
| OLD | NEW |