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

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

Issue 1532873003: PlzNavigate: add initial traces for new TBM benchmarks. (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
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.h" 5 #include "content/browser/loader/navigation_url_loader_impl.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/trace_event/trace_event.h"
9 #include "content/browser/frame_host/navigation_request_info.h" 10 #include "content/browser/frame_host/navigation_request_info.h"
10 #include "content/browser/loader/navigation_url_loader_delegate.h" 11 #include "content/browser/loader/navigation_url_loader_delegate.h"
11 #include "content/browser/loader/navigation_url_loader_impl_core.h" 12 #include "content/browser/loader/navigation_url_loader_impl_core.h"
12 #include "content/browser/service_worker/service_worker_navigation_handle.h" 13 #include "content/browser/service_worker/service_worker_navigation_handle.h"
13 #include "content/public/browser/browser_context.h" 14 #include "content/public/browser/browser_context.h"
14 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
15 #include "content/public/browser/stream_handle.h" 16 #include "content/public/browser/stream_handle.h"
16 17
17 namespace content { 18 namespace content {
18 19
19 NavigationURLLoaderImpl::NavigationURLLoaderImpl( 20 NavigationURLLoaderImpl::NavigationURLLoaderImpl(
20 BrowserContext* browser_context, 21 BrowserContext* browser_context,
21 scoped_ptr<NavigationRequestInfo> request_info, 22 scoped_ptr<NavigationRequestInfo> request_info,
22 ServiceWorkerNavigationHandle* service_worker_handle, 23 ServiceWorkerNavigationHandle* service_worker_handle,
23 NavigationURLLoaderDelegate* delegate) 24 NavigationURLLoaderDelegate* delegate)
24 : delegate_(delegate), weak_factory_(this) { 25 : delegate_(delegate), weak_factory_(this) {
25 DCHECK_CURRENTLY_ON(BrowserThread::UI); 26 DCHECK_CURRENTLY_ON(BrowserThread::UI);
26 27
27 core_ = new NavigationURLLoaderImplCore(weak_factory_.GetWeakPtr()); 28 core_ = new NavigationURLLoaderImplCore(weak_factory_.GetWeakPtr());
29 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1(
clamy 2015/12/18 15:42:11 This is called on the UI thread while the end happ
carlosk 2015/12/18 17:23:21 Nope, it's supported behavior: https://code.google
30 "navigation", "Navigation timeToResponseStarted", core_,
31 request_info->common_params.navigation_start.ToInternalValue(),
32 "FrameTreeNode id", request_info->frame_tree_node_id);
28 ServiceWorkerNavigationHandleCore* service_worker_handle_core = 33 ServiceWorkerNavigationHandleCore* service_worker_handle_core =
29 service_worker_handle ? service_worker_handle->core() : nullptr; 34 service_worker_handle ? service_worker_handle->core() : nullptr;
30 BrowserThread::PostTask( 35 BrowserThread::PostTask(
31 BrowserThread::IO, FROM_HERE, 36 BrowserThread::IO, FROM_HERE,
32 base::Bind(&NavigationURLLoaderImplCore::Start, base::Unretained(core_), 37 base::Bind(&NavigationURLLoaderImplCore::Start, base::Unretained(core_),
33 browser_context->GetResourceContext(), 38 browser_context->GetResourceContext(),
34 service_worker_handle_core, base::Passed(&request_info))); 39 service_worker_handle_core, base::Passed(&request_info)));
35 } 40 }
36 41
37 NavigationURLLoaderImpl::~NavigationURLLoaderImpl() { 42 NavigationURLLoaderImpl::~NavigationURLLoaderImpl() {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 delegate_->OnRequestFailed(in_cache, net_error); 78 delegate_->OnRequestFailed(in_cache, net_error);
74 } 79 }
75 80
76 void NavigationURLLoaderImpl::NotifyRequestStarted(base::TimeTicks timestamp) { 81 void NavigationURLLoaderImpl::NotifyRequestStarted(base::TimeTicks timestamp) {
77 DCHECK_CURRENTLY_ON(BrowserThread::UI); 82 DCHECK_CURRENTLY_ON(BrowserThread::UI);
78 83
79 delegate_->OnRequestStarted(timestamp); 84 delegate_->OnRequestStarted(timestamp);
80 } 85 }
81 86
82 } // namespace content 87 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698