| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 if (request_creation_time_.is_null()) { | 1090 if (request_creation_time_.is_null()) { |
| 1091 NOTREACHED() | 1091 NOTREACHED() |
| 1092 << "The same transaction shouldn't start twice without new timing."; | 1092 << "The same transaction shouldn't start twice without new timing."; |
| 1093 return; | 1093 return; |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 base::TimeDelta to_start = base::Time::Now() - request_creation_time_; | 1096 base::TimeDelta to_start = base::Time::Now() - request_creation_time_; |
| 1097 request_creation_time_ = base::Time(); | 1097 request_creation_time_ = base::Time(); |
| 1098 | 1098 |
| 1099 static const bool use_prefetch_histogram = | 1099 static const bool use_prefetch_histogram = |
| 1100 base::FieldTrialList::Find("Prefetch") && | 1100 base::FieldTrialList::TrialExists("Prefetch"); |
| 1101 !base::FieldTrialList::Find("Prefetch")->group_name().empty(); | |
| 1102 | 1101 |
| 1103 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpTimeToFirstByte", to_start); | 1102 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpTimeToFirstByte", to_start); |
| 1104 if (use_prefetch_histogram) { | 1103 if (use_prefetch_histogram) { |
| 1105 UMA_HISTOGRAM_MEDIUM_TIMES( | 1104 UMA_HISTOGRAM_MEDIUM_TIMES( |
| 1106 base::FieldTrial::MakeName("Net.HttpTimeToFirstByte", | 1105 base::FieldTrial::MakeName("Net.HttpTimeToFirstByte", |
| 1107 "Prefetch"), | 1106 "Prefetch"), |
| 1108 to_start); | 1107 to_start); |
| 1109 } | 1108 } |
| 1110 | 1109 |
| 1111 const bool is_prerender = !!(request_info_.load_flags & LOAD_PRERENDER); | 1110 const bool is_prerender = !!(request_info_.load_flags & LOAD_PRERENDER); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 } | 1368 } |
| 1370 | 1369 |
| 1371 bool URLRequestHttpJob::IsCompressibleContent() const { | 1370 bool URLRequestHttpJob::IsCompressibleContent() const { |
| 1372 std::string mime_type; | 1371 std::string mime_type; |
| 1373 return GetMimeType(&mime_type) && | 1372 return GetMimeType(&mime_type) && |
| 1374 (IsSupportedJavascriptMimeType(mime_type.c_str()) || | 1373 (IsSupportedJavascriptMimeType(mime_type.c_str()) || |
| 1375 IsSupportedNonImageMimeType(mime_type.c_str())); | 1374 IsSupportedNonImageMimeType(mime_type.c_str())); |
| 1376 } | 1375 } |
| 1377 | 1376 |
| 1378 } // namespace net | 1377 } // namespace net |
| OLD | NEW |