| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "net/url_request/url_request_job_metrics.h" | 5 #include "net/url_request/url_request_job_metrics.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 | 9 |
| 10 using base::TimeDelta; |
| 11 |
| 10 void URLRequestJobMetrics::AppendText(std::wstring* text) { | 12 void URLRequestJobMetrics::AppendText(std::wstring* text) { |
| 11 if (!text) | 13 if (!text) |
| 12 return; | 14 return; |
| 13 | 15 |
| 14 text->append(L"job url = "); | 16 text->append(L"job url = "); |
| 15 text->append(UTF8ToWide(original_url_->spec())); | 17 text->append(UTF8ToWide(original_url_->spec())); |
| 16 | 18 |
| 17 if (url_.get()) { | 19 if (url_.get()) { |
| 18 text->append(L"; redirected url = "); | 20 text->append(L"; redirected url = "); |
| 19 text->append(UTF8ToWide(url_->spec())); | 21 text->append(UTF8ToWide(url_->spec())); |
| 20 } | 22 } |
| 21 | 23 |
| 22 TimeDelta elapsed = end_time_ - start_time_; | 24 TimeDelta elapsed = end_time_ - start_time_; |
| 23 StringAppendF(text, | 25 StringAppendF(text, |
| 24 L"; total bytes read = %d; read calls = %d; time = %lld ms;", | 26 L"; total bytes read = %d; read calls = %d; time = %lld ms;", |
| 25 total_bytes_read_, number_of_read_IO_, elapsed.InMilliseconds()); | 27 total_bytes_read_, number_of_read_IO_, elapsed.InMilliseconds()); |
| 26 | 28 |
| 27 if (success_) { | 29 if (success_) { |
| 28 text->append(L" success."); | 30 text->append(L" success."); |
| 29 } else { | 31 } else { |
| 30 text->append(L" fail."); | 32 text->append(L" fail."); |
| 31 } | 33 } |
| 32 } | 34 } |
| 33 | 35 |
| OLD | NEW |