| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 is_srcdoc_(is_srcdoc), | 61 is_srcdoc_(is_srcdoc), |
| 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 DCHECK(!navigation_start.is_null()); | 69 DCHECK(!navigation_start.is_null()); |
| 70 GetDelegate()->DidStartNavigation(this); | 70 GetDelegate()->DidStartNavigation(this); |
| 71 |
| 72 if (IsInMainFrame()) { |
| 73 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( |
| 74 "navigation", "Navigation StartToCommit", this, |
| 75 navigation_start.ToInternalValue(), "Initial URL", url_.spec()); |
| 76 } |
| 71 } | 77 } |
| 72 | 78 |
| 73 NavigationHandleImpl::~NavigationHandleImpl() { | 79 NavigationHandleImpl::~NavigationHandleImpl() { |
| 74 GetDelegate()->DidFinishNavigation(this); | 80 GetDelegate()->DidFinishNavigation(this); |
| 75 | 81 |
| 76 // Cancel the navigation on the IO thread if the NavigationHandle is being | 82 // Cancel the navigation on the IO thread if the NavigationHandle is being |
| 77 // destroyed in the middle of the NavigationThrottles checks. | 83 // destroyed in the middle of the NavigationThrottles checks. |
| 78 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) | 84 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) |
| 79 RunCompleteCallback(NavigationThrottle::CANCEL_AND_IGNORE); | 85 RunCompleteCallback(NavigationThrottle::CANCEL_AND_IGNORE); |
| 86 |
| 87 if (IsInMainFrame()) { |
| 88 TRACE_EVENT_ASYNC_END2("navigation", "Navigation StartToCommit", this, |
| 89 "URL", url_.spec(), "Net Error Code", |
| 90 net_error_code_); |
| 91 } |
| 80 } | 92 } |
| 81 | 93 |
| 82 NavigatorDelegate* NavigationHandleImpl::GetDelegate() const { | 94 NavigatorDelegate* NavigationHandleImpl::GetDelegate() const { |
| 83 return frame_tree_node_->navigator()->GetDelegate(); | 95 return frame_tree_node_->navigator()->GetDelegate(); |
| 84 } | 96 } |
| 85 | 97 |
| 86 const GURL& NavigationHandleImpl::GetURL() { | 98 const GURL& NavigationHandleImpl::GetURL() { |
| 87 return url_; | 99 return url_; |
| 88 } | 100 } |
| 89 | 101 |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 complete_callback_.Reset(); | 494 complete_callback_.Reset(); |
| 483 | 495 |
| 484 if (!callback.is_null()) | 496 if (!callback.is_null()) |
| 485 callback.Run(result); | 497 callback.Run(result); |
| 486 | 498 |
| 487 // No code after running the callback, as it might have resulted in our | 499 // No code after running the callback, as it might have resulted in our |
| 488 // destruction. | 500 // destruction. |
| 489 } | 501 } |
| 490 | 502 |
| 491 } // namespace content | 503 } // namespace content |
| OLD | NEW |