| 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 // Library functions related to the Financial Server ping. | 5 // Library functions related to the Financial Server ping. |
| 6 | 6 |
| 7 #include "rlz/lib/financial_ping.h" | 7 #include "rlz/lib/financial_ping.h" |
| 8 | 8 |
| 9 #include "base/atomicops.h" | 9 #include "base/atomicops.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 311 |
| 312 std::string url = base::StringPrintf("http://%s:%d%s", | 312 std::string url = base::StringPrintf("http://%s:%d%s", |
| 313 kFinancialServer, kFinancialPort, | 313 kFinancialServer, kFinancialPort, |
| 314 request); | 314 request); |
| 315 | 315 |
| 316 scoped_ptr<net::URLFetcher> fetcher(net::URLFetcher::Create( | 316 scoped_ptr<net::URLFetcher> fetcher(net::URLFetcher::Create( |
| 317 GURL(url), net::URLFetcher::GET, &delegate)); | 317 GURL(url), net::URLFetcher::GET, &delegate)); |
| 318 | 318 |
| 319 fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE | | 319 fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE | |
| 320 net::LOAD_DO_NOT_SEND_AUTH_DATA | | 320 net::LOAD_DO_NOT_SEND_AUTH_DATA | |
| 321 net::LOAD_DO_NOT_PROMPT_FOR_LOGIN | | |
| 322 net::LOAD_DO_NOT_SEND_COOKIES | | 321 net::LOAD_DO_NOT_SEND_COOKIES | |
| 323 net::LOAD_DO_NOT_SAVE_COOKIES); | 322 net::LOAD_DO_NOT_SAVE_COOKIES); |
| 324 | 323 |
| 325 // Ensure rlz_lib::SetURLRequestContext() has been called before sending | 324 // Ensure rlz_lib::SetURLRequestContext() has been called before sending |
| 326 // pings. | 325 // pings. |
| 327 fetcher->SetRequestContext(context); | 326 fetcher->SetRequestContext(context); |
| 328 | 327 |
| 329 base::WeakPtrFactory<base::RunLoop> weak(&loop); | 328 base::WeakPtrFactory<base::RunLoop> weak(&loop); |
| 330 | 329 |
| 331 const base::TimeDelta kTimeout = base::TimeDelta::FromMinutes(5); | 330 const base::TimeDelta kTimeout = base::TimeDelta::FromMinutes(5); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 } | 403 } |
| 405 | 404 |
| 406 bool WasSendFinancialPingInterrupted() { | 405 bool WasSendFinancialPingInterrupted() { |
| 407 return send_financial_ping_interrupted_for_test; | 406 return send_financial_ping_interrupted_for_test; |
| 408 } | 407 } |
| 409 | 408 |
| 410 } // namespace test | 409 } // namespace test |
| 411 #endif | 410 #endif |
| 412 | 411 |
| 413 } // namespace rlz_lib | 412 } // namespace rlz_lib |
| OLD | NEW |