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 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 // static | 32 // static |
33 scoped_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( | 33 scoped_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( |
34 const GURL& url, | 34 const GURL& url, |
35 FrameTreeNode* frame_tree_node, | 35 FrameTreeNode* frame_tree_node, |
36 bool is_synchronous, | 36 bool is_synchronous, |
37 bool is_srcdoc, | 37 bool is_srcdoc, |
38 const base::TimeTicks& navigation_start, | 38 const base::TimeTicks& navigation_start) { |
39 int pending_nav_entry_id) { | 39 return scoped_ptr<NavigationHandleImpl>(new NavigationHandleImpl( |
40 return scoped_ptr<NavigationHandleImpl>( | 40 url, frame_tree_node, is_synchronous, is_srcdoc, navigation_start)); |
41 new NavigationHandleImpl(url, frame_tree_node, is_synchronous, is_srcdoc, | |
42 navigation_start, pending_nav_entry_id)); | |
43 } | 41 } |
44 | 42 |
45 NavigationHandleImpl::NavigationHandleImpl( | 43 NavigationHandleImpl::NavigationHandleImpl( |
46 const GURL& url, | 44 const GURL& url, |
47 FrameTreeNode* frame_tree_node, | 45 FrameTreeNode* frame_tree_node, |
48 bool is_synchronous, | 46 bool is_synchronous, |
49 bool is_srcdoc, | 47 bool is_srcdoc, |
50 const base::TimeTicks& navigation_start, | 48 const base::TimeTicks& navigation_start) |
51 int pending_nav_entry_id) | |
52 : url_(url), | 49 : url_(url), |
53 is_post_(false), | 50 is_post_(false), |
54 has_user_gesture_(false), | 51 has_user_gesture_(false), |
55 transition_(ui::PAGE_TRANSITION_LINK), | 52 transition_(ui::PAGE_TRANSITION_LINK), |
56 is_external_protocol_(false), | 53 is_external_protocol_(false), |
57 net_error_code_(net::OK), | 54 net_error_code_(net::OK), |
58 render_frame_host_(nullptr), | 55 render_frame_host_(nullptr), |
59 is_same_page_(false), | 56 is_same_page_(false), |
60 is_synchronous_(is_synchronous), | 57 is_synchronous_(is_synchronous), |
61 is_srcdoc_(is_srcdoc), | 58 is_srcdoc_(is_srcdoc), |
62 was_redirected_(false), | 59 was_redirected_(false), |
63 state_(INITIAL), | 60 state_(INITIAL), |
64 is_transferring_(false), | 61 is_transferring_(false), |
65 frame_tree_node_(frame_tree_node), | 62 frame_tree_node_(frame_tree_node), |
66 next_index_(0), | 63 next_index_(0), |
67 navigation_start_(navigation_start), | 64 navigation_start_(navigation_start) { |
68 pending_nav_entry_id_(pending_nav_entry_id) { | |
69 DCHECK(!navigation_start.is_null()); | 65 DCHECK(!navigation_start.is_null()); |
70 GetDelegate()->DidStartNavigation(this); | 66 GetDelegate()->DidStartNavigation(this); |
71 } | 67 } |
72 | 68 |
73 NavigationHandleImpl::~NavigationHandleImpl() { | 69 NavigationHandleImpl::~NavigationHandleImpl() { |
74 GetDelegate()->DidFinishNavigation(this); | 70 GetDelegate()->DidFinishNavigation(this); |
75 | 71 |
76 // Cancel the navigation on the IO thread if the NavigationHandle is being | 72 // Cancel the navigation on the IO thread if the NavigationHandle is being |
77 // destroyed in the middle of the NavigationThrottles checks. | 73 // destroyed in the middle of the NavigationThrottles checks. |
78 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) | 74 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 complete_callback_.Reset(); | 480 complete_callback_.Reset(); |
485 | 481 |
486 if (!callback.is_null()) | 482 if (!callback.is_null()) |
487 callback.Run(result); | 483 callback.Run(result); |
488 | 484 |
489 // No code after running the callback, as it might have resulted in our | 485 // No code after running the callback, as it might have resulted in our |
490 // destruction. | 486 // destruction. |
491 } | 487 } |
492 | 488 |
493 } // namespace content | 489 } // namespace content |
OLD | NEW |