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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 if (request_creation_time_.is_null()) { | 1085 if (request_creation_time_.is_null()) { |
1086 NOTREACHED() | 1086 NOTREACHED() |
1087 << "The same transaction shouldn't start twice without new timing."; | 1087 << "The same transaction shouldn't start twice without new timing."; |
1088 return; | 1088 return; |
1089 } | 1089 } |
1090 | 1090 |
1091 base::TimeDelta to_start = base::Time::Now() - request_creation_time_; | 1091 base::TimeDelta to_start = base::Time::Now() - request_creation_time_; |
1092 request_creation_time_ = base::Time(); | 1092 request_creation_time_ = base::Time(); |
1093 | 1093 |
1094 static const bool use_prefetch_histogram = | 1094 static const bool use_prefetch_histogram = |
1095 base::FieldTrialList::Find("Prefetch") && | 1095 base::FieldTrialList::TrialExists("Prefetch"); |
1096 !base::FieldTrialList::Find("Prefetch")->group_name().empty(); | |
1097 | 1096 |
1098 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpTimeToFirstByte", to_start); | 1097 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpTimeToFirstByte", to_start); |
1099 if (use_prefetch_histogram) { | 1098 if (use_prefetch_histogram) { |
1100 UMA_HISTOGRAM_MEDIUM_TIMES( | 1099 UMA_HISTOGRAM_MEDIUM_TIMES( |
1101 base::FieldTrial::MakeName("Net.HttpTimeToFirstByte", | 1100 base::FieldTrial::MakeName("Net.HttpTimeToFirstByte", |
1102 "Prefetch"), | 1101 "Prefetch"), |
1103 to_start); | 1102 to_start); |
1104 } | 1103 } |
1105 | 1104 |
1106 const bool is_prerender = !!(request_info_.load_flags & LOAD_PRERENDER); | 1105 const bool is_prerender = !!(request_info_.load_flags & LOAD_PRERENDER); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 } | 1363 } |
1365 | 1364 |
1366 bool URLRequestHttpJob::IsCompressibleContent() const { | 1365 bool URLRequestHttpJob::IsCompressibleContent() const { |
1367 std::string mime_type; | 1366 std::string mime_type; |
1368 return GetMimeType(&mime_type) && | 1367 return GetMimeType(&mime_type) && |
1369 (IsSupportedJavascriptMimeType(mime_type.c_str()) || | 1368 (IsSupportedJavascriptMimeType(mime_type.c_str()) || |
1370 IsSupportedNonImageMimeType(mime_type.c_str())); | 1369 IsSupportedNonImageMimeType(mime_type.c_str())); |
1371 } | 1370 } |
1372 | 1371 |
1373 } // namespace net | 1372 } // namespace net |
OLD | NEW |