OLD | NEW |
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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 28 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
29 | 29 |
30 core_ = new NavigationURLLoaderImplCore(weak_factory_.GetWeakPtr()); | 30 core_ = new NavigationURLLoaderImplCore(weak_factory_.GetWeakPtr()); |
31 | 31 |
32 // TODO(carlosk): extend this trace to support non-PlzNavigate navigations. | 32 // TODO(carlosk): extend this trace to support non-PlzNavigate navigations. |
33 // For the trace below we're using the NavigationURLLoaderImplCore as the | 33 // For the trace below we're using the NavigationURLLoaderImplCore as the |
34 // async trace id, |navigation_start| as the timestamp and reporting the | 34 // async trace id, |navigation_start| as the timestamp and reporting the |
35 // FrameTreeNode id as a parameter. | 35 // FrameTreeNode id as a parameter. |
36 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( | 36 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( |
37 "navigation", "Navigation timeToResponseStarted", core_, | 37 "navigation", "Navigation timeToResponseStarted", core_, |
38 request_info->common_params.navigation_start.ToInternalValue(), | 38 request_info->common_params.navigation_start, |
39 "FrameTreeNode id", request_info->frame_tree_node_id); | 39 "FrameTreeNode id", request_info->frame_tree_node_id); |
40 BrowserThread::PostTask( | 40 BrowserThread::PostTask( |
41 BrowserThread::IO, FROM_HERE, | 41 BrowserThread::IO, FROM_HERE, |
42 base::Bind(&NavigationURLLoaderImplCore::Start, base::Unretained(core_), | 42 base::Bind(&NavigationURLLoaderImplCore::Start, base::Unretained(core_), |
43 browser_context->GetResourceContext(), | 43 browser_context->GetResourceContext(), |
44 service_worker_context_wrapper, base::Passed(&request_info))); | 44 service_worker_context_wrapper, base::Passed(&request_info))); |
45 } | 45 } |
46 | 46 |
47 NavigationURLLoaderImpl::~NavigationURLLoaderImpl() { | 47 NavigationURLLoaderImpl::~NavigationURLLoaderImpl() { |
48 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 48 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 delegate_->OnRequestStarted(timestamp); | 101 delegate_->OnRequestStarted(timestamp); |
102 } | 102 } |
103 | 103 |
104 void NavigationURLLoaderImpl::NotifyServiceWorkerEncountered() { | 104 void NavigationURLLoaderImpl::NotifyServiceWorkerEncountered() { |
105 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 105 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
106 | 106 |
107 delegate_->OnServiceWorkerEncountered(); | 107 delegate_->OnServiceWorkerEncountered(); |
108 } | 108 } |
109 | 109 |
110 } // namespace content | 110 } // namespace content |
OLD | NEW |