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; | 10 using base::TimeDelta; |
11 | 11 |
12 void URLRequestJobMetrics::AppendText(std::wstring* text) { | 12 void URLRequestJobMetrics::AppendText(std::wstring* text) { |
13 if (!text) | 13 if (!text) |
14 return; | 14 return; |
15 | 15 |
16 text->append(L"job url = "); | 16 text->append(L"job url = "); |
17 text->append(UTF8ToWide(original_url_->spec())); | 17 text->append(UTF8ToWide(original_url_->spec())); |
18 | 18 |
19 if (url_.get()) { | 19 if (url_.get()) { |
20 text->append(L"; redirected url = "); | 20 text->append(L"; redirected url = "); |
21 text->append(UTF8ToWide(url_->spec())); | 21 text->append(UTF8ToWide(url_->spec())); |
22 } | 22 } |
23 | 23 |
24 TimeDelta elapsed = end_time_ - start_time_; | 24 TimeDelta elapsed = end_time_ - start_time_; |
25 StringAppendF(text, | 25 StringAppendF(text, |
26 L"; total bytes read = %d; read calls = %d; time = %lld ms;", | 26 L"; total bytes read = %ld; read calls = %d; time = %lld ms;", |
27 total_bytes_read_, number_of_read_IO_, elapsed.InMilliseconds()); | 27 static_cast<long>(total_bytes_read_), |
| 28 number_of_read_IO_, elapsed.InMilliseconds()); |
28 | 29 |
29 if (success_) { | 30 if (success_) { |
30 text->append(L" success."); | 31 text->append(L" success."); |
31 } else { | 32 } else { |
32 text->append(L" fail."); | 33 text->append(L" fail."); |
33 } | 34 } |
34 } | 35 } |
OLD | NEW |