OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // net::URLRequestFileJob implementation: | 127 // net::URLRequestFileJob implementation: |
128 virtual void Start() OVERRIDE { | 128 virtual void Start() OVERRIDE { |
129 base::TimeDelta time_to_wait; | 129 base::TimeDelta time_to_wait; |
130 if (!load_timing_deltas_.receive_headers_end.is_null()) { | 130 if (!load_timing_deltas_.receive_headers_end.is_null()) { |
131 // Need to delay starting until the largest of the times has elapsed. | 131 // Need to delay starting until the largest of the times has elapsed. |
132 // Wait a little longer than necessary, to be on the safe side. | 132 // Wait a little longer than necessary, to be on the safe side. |
133 time_to_wait = load_timing_deltas_.receive_headers_end.GetDelta() + | 133 time_to_wait = load_timing_deltas_.receive_headers_end.GetDelta() + |
134 base::TimeDelta::FromMilliseconds(100); | 134 base::TimeDelta::FromMilliseconds(100); |
135 } | 135 } |
136 | 136 |
137 MessageLoop::current()->PostDelayedTask( | 137 base::MessageLoop::current()->PostDelayedTask( |
138 FROM_HERE, | 138 FROM_HERE, |
139 base::Bind(&MockUrlRequestJobWithTiming::DelayedStart, | 139 base::Bind(&MockUrlRequestJobWithTiming::DelayedStart, |
140 weak_factory_.GetWeakPtr()), | 140 weak_factory_.GetWeakPtr()), |
141 time_to_wait); | 141 time_to_wait); |
142 } | 142 } |
143 | 143 |
144 virtual void GetLoadTimingInfo( | 144 virtual void GetLoadTimingInfo( |
145 net::LoadTimingInfo* load_timing_info) const OVERRIDE { | 145 net::LoadTimingInfo* load_timing_info) const OVERRIDE { |
146 // This should have been set by the URLRequest. | 146 // This should have been set by the URLRequest. |
147 base::TimeTicks request_start = load_timing_info->request_start; | 147 base::TimeTicks request_start = load_timing_info->request_start; |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 navigation_deltas.send_start.GetDelta()); | 588 navigation_deltas.send_start.GetDelta()); |
589 // The only times that are guaranteed to be distinct are send_start and | 589 // The only times that are guaranteed to be distinct are send_start and |
590 // received_headers end. | 590 // received_headers end. |
591 EXPECT_LT(navigation_deltas.send_start.GetDelta(), | 591 EXPECT_LT(navigation_deltas.send_start.GetDelta(), |
592 navigation_deltas.receive_headers_end.GetDelta()); | 592 navigation_deltas.receive_headers_end.GetDelta()); |
593 | 593 |
594 EXPECT_TRUE(navigation_deltas.ssl_start.is_null()); | 594 EXPECT_TRUE(navigation_deltas.ssl_start.is_null()); |
595 } | 595 } |
596 | 596 |
597 } // namespace | 597 } // namespace |
OLD | NEW |