OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/frame_host/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "content/browser/frame_host/frame_tree_node.h" | 9 #include "content/browser/frame_host/frame_tree_node.h" |
10 #include "content/browser/frame_host/navigator.h" | 10 #include "content/browser/frame_host/navigator.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 was_redirected_(false), | 62 was_redirected_(false), |
63 state_(INITIAL), | 63 state_(INITIAL), |
64 is_transferring_(false), | 64 is_transferring_(false), |
65 frame_tree_node_(frame_tree_node), | 65 frame_tree_node_(frame_tree_node), |
66 next_index_(0), | 66 next_index_(0), |
67 navigation_start_(navigation_start), | 67 navigation_start_(navigation_start), |
68 pending_nav_entry_id_(pending_nav_entry_id), | 68 pending_nav_entry_id_(pending_nav_entry_id), |
69 is_in_commit_(false) { | 69 is_in_commit_(false) { |
70 DCHECK(!navigation_start.is_null()); | 70 DCHECK(!navigation_start.is_null()); |
71 GetDelegate()->DidStartNavigation(this); | 71 GetDelegate()->DidStartNavigation(this); |
72 | |
73 if (IsInMainFrame()) { | |
74 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( | |
75 "navigation", "Navigation StartToCommit", this, | |
76 navigation_start.ToInternalValue(), "URL", url_.spec()); | |
clamy
2016/03/23 12:12:16
Are you trying to index the navigation using the u
Bryan McQuade
2016/03/23 12:17:33
That's a good point. We shouldn't assume the URL i
shivanisha
2016/03/23 13:56:09
the navigation handle pointer is the index here an
carlosk
2016/03/23 14:40:34
Mind that there can be 2 simultaneously ongoing na
shivanisha
2016/03/23 18:07:08
That's a good point that if we use frameTreeNode i
clamy
2016/03/24 10:36:32
Indexing on the NavigationHandle is good (I was wo
shivanisha
2016/03/29 19:49:32
Actually since we are logging the URL in the end t
carlosk
2016/03/31 10:10:29
IIUC there's no much use in doing that. The END ur
shivanisha
2016/04/12 14:10:03
Applying 2 different labels is making things clear
| |
77 } | |
72 } | 78 } |
73 | 79 |
74 NavigationHandleImpl::~NavigationHandleImpl() { | 80 NavigationHandleImpl::~NavigationHandleImpl() { |
75 GetDelegate()->DidFinishNavigation(this); | 81 GetDelegate()->DidFinishNavigation(this); |
76 | 82 |
77 CHECK(!is_in_commit_); | 83 CHECK(!is_in_commit_); |
78 | 84 |
79 // Cancel the navigation on the IO thread if the NavigationHandle is being | 85 // Cancel the navigation on the IO thread if the NavigationHandle is being |
80 // destroyed in the middle of the NavigationThrottles checks. | 86 // destroyed in the middle of the NavigationThrottles checks. |
81 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) | 87 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) |
82 RunCompleteCallback(NavigationThrottle::CANCEL_AND_IGNORE); | 88 RunCompleteCallback(NavigationThrottle::CANCEL_AND_IGNORE); |
89 | |
90 if (IsInMainFrame()) { | |
91 TRACE_EVENT_ASYNC_END2("navigation", "Navigation StartToCommit", this, | |
92 "URL", url_.spec(), "Net Error Code", | |
clamy
2016/03/23 12:12:16
You may also want to add a boolean to check whethe
shivanisha
2016/03/23 13:56:09
Sure, that sounds good
shivanisha
2016/03/29 19:49:32
Actually, it seems we can assume that net error co
| |
93 net_error_code_); | |
94 } | |
83 } | 95 } |
84 | 96 |
85 NavigatorDelegate* NavigationHandleImpl::GetDelegate() const { | 97 NavigatorDelegate* NavigationHandleImpl::GetDelegate() const { |
86 return frame_tree_node_->navigator()->GetDelegate(); | 98 return frame_tree_node_->navigator()->GetDelegate(); |
87 } | 99 } |
88 | 100 |
89 const GURL& NavigationHandleImpl::GetURL() { | 101 const GURL& NavigationHandleImpl::GetURL() { |
90 return url_; | 102 return url_; |
91 } | 103 } |
92 | 104 |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
487 complete_callback_.Reset(); | 499 complete_callback_.Reset(); |
488 | 500 |
489 if (!callback.is_null()) | 501 if (!callback.is_null()) |
490 callback.Run(result); | 502 callback.Run(result); |
491 | 503 |
492 // No code after running the callback, as it might have resulted in our | 504 // No code after running the callback, as it might have resulted in our |
493 // destruction. | 505 // destruction. |
494 } | 506 } |
495 | 507 |
496 } // namespace content | 508 } // namespace content |
OLD | NEW |