| 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/service/gaia/service_gaia_authenticator.h" | 5 #include "chrome/service/gaia/service_gaia_authenticator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "chrome/service/net/service_url_request_context.h" | 9 #include "chrome/service/net/service_url_request_context.h" |
| 10 #include "chrome/service/service_process.h" | 10 #include "chrome/service/service_process.h" |
| 11 #include "content/public/common/url_fetcher.h" | |
| 12 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 12 #include "net/url_request/url_fetcher.h" |
| 13 | 13 |
| 14 ServiceGaiaAuthenticator::ServiceGaiaAuthenticator( | 14 ServiceGaiaAuthenticator::ServiceGaiaAuthenticator( |
| 15 const std::string& user_agent, const std::string& service_id, | 15 const std::string& user_agent, const std::string& service_id, |
| 16 const std::string& gaia_url, | 16 const std::string& gaia_url, |
| 17 base::MessageLoopProxy* io_message_loop_proxy) | 17 base::MessageLoopProxy* io_message_loop_proxy) |
| 18 : gaia::GaiaAuthenticator(user_agent, service_id, gaia_url), | 18 : gaia::GaiaAuthenticator(user_agent, service_id, gaia_url), |
| 19 http_post_completed_(false, false), | 19 http_post_completed_(false, false), |
| 20 io_message_loop_proxy_(io_message_loop_proxy), | 20 io_message_loop_proxy_(io_message_loop_proxy), |
| 21 http_response_code_(0) { | 21 http_response_code_(0) { |
| 22 } | 22 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 ret = kMaxBackoffDelaySeconds; | 71 ret = kMaxBackoffDelaySeconds; |
| 72 } | 72 } |
| 73 return ret; | 73 return ret; |
| 74 } | 74 } |
| 75 | 75 |
| 76 ServiceGaiaAuthenticator::~ServiceGaiaAuthenticator() {} | 76 ServiceGaiaAuthenticator::~ServiceGaiaAuthenticator() {} |
| 77 | 77 |
| 78 void ServiceGaiaAuthenticator::DoPost(const GURL& post_url, | 78 void ServiceGaiaAuthenticator::DoPost(const GURL& post_url, |
| 79 const std::string& post_body) { | 79 const std::string& post_body) { |
| 80 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); | 80 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); |
| 81 net::URLFetcher* request = content::URLFetcher::Create( | 81 net::URLFetcher* request = net::URLFetcher::Create( |
| 82 post_url, net::URLFetcher::POST, this); | 82 post_url, net::URLFetcher::POST, this); |
| 83 request->SetRequestContext( | 83 request->SetRequestContext( |
| 84 g_service_process->GetServiceURLRequestContextGetter()); | 84 g_service_process->GetServiceURLRequestContextGetter()); |
| 85 request->SetUploadData("application/x-www-form-urlencoded", post_body); | 85 request->SetUploadData("application/x-www-form-urlencoded", post_body); |
| 86 request->Start(); | 86 request->Start(); |
| 87 } | 87 } |
| OLD | NEW |