Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: content/browser/loader/resource_loader.cc

Issue 2741433002: Fix ResourceDispatcherHostDelegate::OnResponseStarted not getting called for navigation requests (Closed)
Patch Set: fix mojo unittests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/resource_loader.h" 5 #include "content/browser/loader/resource_loader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 } else { 627 } else {
628 request_->FollowDeferredRedirect(); 628 request_->FollowDeferredRedirect();
629 } 629 }
630 } 630 }
631 631
632 void ResourceLoader::CompleteResponseStarted() { 632 void ResourceLoader::CompleteResponseStarted() {
633 ResourceRequestInfoImpl* info = GetRequestInfo(); 633 ResourceRequestInfoImpl* info = GetRequestInfo();
634 scoped_refptr<ResourceResponse> response = new ResourceResponse(); 634 scoped_refptr<ResourceResponse> response = new ResourceResponse();
635 PopulateResourceResponse(info, request_.get(), response.get()); 635 PopulateResourceResponse(info, request_.get(), response.get());
636 636
637 delegate_->DidReceiveResponse(this); 637 delegate_->DidReceiveResponse(this, response.get());
638 638
639 read_deferral_start_time_ = base::TimeTicks::Now(); 639 read_deferral_start_time_ = base::TimeTicks::Now();
640 // Using a ScopedDeferral here would result in calling ReadMore(true) on sync 640 // Using a ScopedDeferral here would result in calling ReadMore(true) on sync
641 // success. Calling ReadMore(false) here instead allows small responses to be 641 // success. Calling ReadMore(false) here instead allows small responses to be
642 // handled completely synchronously, if no ResourceHandler defers handling of 642 // handled completely synchronously, if no ResourceHandler defers handling of
643 // the response. 643 // the response.
644 deferred_stage_ = DEFERRED_SYNC; 644 deferred_stage_ = DEFERRED_SYNC;
645 handler_->OnResponseStarted(response.get(), 645 handler_->OnResponseStarted(response.get(),
646 base::MakeUnique<Controller>(this)); 646 base::MakeUnique<Controller>(this));
647 if (is_deferred()) { 647 if (is_deferred()) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", prefetch_status, 792 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", prefetch_status,
793 STATUS_MAX); 793 STATUS_MAX);
794 } 794 }
795 } else if (request_->response_info().unused_since_prefetch) { 795 } else if (request_->response_info().unused_since_prefetch) {
796 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); 796 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time();
797 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); 797 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time);
798 } 798 }
799 } 799 }
800 800
801 } // namespace content 801 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/loader/resource_loader_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698