OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/loader/async_resource_handler.h" | 5 #include "content/browser/loader/async_resource_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 310 |
311 if (rdh_->delegate()) { | 311 if (rdh_->delegate()) { |
312 rdh_->delegate()->OnRequestRedirected( | 312 rdh_->delegate()->OnRequestRedirected( |
313 redirect_info.new_url, request(), info->GetContext(), response); | 313 redirect_info.new_url, request(), info->GetContext(), response); |
314 } | 314 } |
315 | 315 |
316 NetLogObserver::PopulateResponseInfo(request(), response); | 316 NetLogObserver::PopulateResponseInfo(request(), response); |
317 reported_transfer_size_ = 0; | 317 reported_transfer_size_ = 0; |
318 response->head.request_start = request()->creation_time(); | 318 response->head.request_start = request()->creation_time(); |
319 response->head.response_start = TimeTicks::Now(); | 319 response->head.response_start = TimeTicks::Now(); |
| 320 response->head.encoded_data_length = request()->GetTotalReceivedBytes(); |
320 // TODO(davidben): Is it necessary to pass the new first party URL for | 321 // TODO(davidben): Is it necessary to pass the new first party URL for |
321 // cookies? The only case where it can change is top-level navigation requests | 322 // cookies? The only case where it can change is top-level navigation requests |
322 // and hopefully those will eventually all be owned by the browser. It's | 323 // and hopefully those will eventually all be owned by the browser. It's |
323 // possible this is still needed while renderer-owned ones exist. | 324 // possible this is still needed while renderer-owned ones exist. |
324 return info->filter()->Send(new ResourceMsg_ReceivedRedirect( | 325 return info->filter()->Send(new ResourceMsg_ReceivedRedirect( |
325 GetRequestID(), redirect_info, response->head)); | 326 GetRequestID(), redirect_info, response->head)); |
326 } | 327 } |
327 | 328 |
328 bool AsyncResourceHandler::OnResponseStarted(ResourceResponse* response, | 329 bool AsyncResourceHandler::OnResponseStarted(ResourceResponse* response, |
329 bool* defer) { | 330 bool* defer) { |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 } else { | 609 } else { |
609 UMA_HISTOGRAM_CUSTOM_COUNTS( | 610 UMA_HISTOGRAM_CUSTOM_COUNTS( |
610 "Net.ResourceLoader.ResponseStartToEnd.Over_512kB", | 611 "Net.ResourceLoader.ResponseStartToEnd.Over_512kB", |
611 elapsed_time, 1, 100000, 100); | 612 elapsed_time, 1, 100000, 100); |
612 } | 613 } |
613 | 614 |
614 inlining_helper_->RecordHistogram(elapsed_time); | 615 inlining_helper_->RecordHistogram(elapsed_time); |
615 } | 616 } |
616 | 617 |
617 } // namespace content | 618 } // namespace content |
OLD | NEW |