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

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

Issue 1498663003: PlzNavigate: fix crash in unit_tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/navigation_url_loader_impl_core.h" 5 #include "content/browser/loader/navigation_url_loader_impl_core.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/frame_host/navigation_request_info.h" 10 #include "content/browser/frame_host/navigation_request_info.h"
(...skipping 29 matching lines...) Expand all
40 ResourceContext* resource_context, 40 ResourceContext* resource_context,
41 ServiceWorkerNavigationHandleCore* service_worker_handle_core, 41 ServiceWorkerNavigationHandleCore* service_worker_handle_core,
42 scoped_ptr<NavigationRequestInfo> request_info) { 42 scoped_ptr<NavigationRequestInfo> request_info) {
43 DCHECK_CURRENTLY_ON(BrowserThread::IO); 43 DCHECK_CURRENTLY_ON(BrowserThread::IO);
44 44
45 BrowserThread::PostTask( 45 BrowserThread::PostTask(
46 BrowserThread::UI, FROM_HERE, 46 BrowserThread::UI, FROM_HERE,
47 base::Bind(&NavigationURLLoaderImpl::NotifyRequestStarted, loader_, 47 base::Bind(&NavigationURLLoaderImpl::NotifyRequestStarted, loader_,
48 base::TimeTicks::Now())); 48 base::TimeTicks::Now()));
49 49
50 ResourceDispatcherHostImpl::Get()->BeginNavigationRequest( 50 // The ResourceDispatcherHostImpl can be null in unit tests.
51 resource_context, *request_info, this, service_worker_handle_core); 51 if (ResourceDispatcherHostImpl::Get()) {
nasko 2015/12/03 15:10:27 Interesting. If we hit this in real code (for some
clamy 2015/12/03 16:15:02 Mm not sure. It's not a change from the current si
52 ResourceDispatcherHostImpl::Get()->BeginNavigationRequest(
53 resource_context, *request_info, this, service_worker_handle_core);
54 }
52 } 55 }
53 56
54 void NavigationURLLoaderImplCore::FollowRedirect() { 57 void NavigationURLLoaderImplCore::FollowRedirect() {
55 DCHECK_CURRENTLY_ON(BrowserThread::IO); 58 DCHECK_CURRENTLY_ON(BrowserThread::IO);
56 59
57 if (resource_handler_) 60 if (resource_handler_)
58 resource_handler_->FollowRedirect(); 61 resource_handler_->FollowRedirect();
59 } 62 }
60 63
61 void NavigationURLLoaderImplCore::NotifyRequestRedirected( 64 void NavigationURLLoaderImplCore::NotifyRequestRedirected(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 int net_error) { 101 int net_error) {
99 DCHECK_CURRENTLY_ON(BrowserThread::IO); 102 DCHECK_CURRENTLY_ON(BrowserThread::IO);
100 103
101 BrowserThread::PostTask( 104 BrowserThread::PostTask(
102 BrowserThread::UI, FROM_HERE, 105 BrowserThread::UI, FROM_HERE,
103 base::Bind(&NavigationURLLoaderImpl::NotifyRequestFailed, loader_, 106 base::Bind(&NavigationURLLoaderImpl::NotifyRequestFailed, loader_,
104 in_cache, net_error)); 107 in_cache, net_error));
105 } 108 }
106 109
107 } // namespace content 110 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698