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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/browser/frame_host/frame_tree_node.h" | 8 #include "content/browser/frame_host/frame_tree_node.h" |
9 #include "content/browser/frame_host/navigator.h" | 9 #include "content/browser/frame_host/navigator.h" |
10 #include "content/browser/frame_host/navigator_delegate.h" | 10 #include "content/browser/frame_host/navigator_delegate.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 NavigationThrottle::ThrottleCheckResult* to_update, | 26 NavigationThrottle::ThrottleCheckResult* to_update, |
27 NavigationThrottle::ThrottleCheckResult result) { | 27 NavigationThrottle::ThrottleCheckResult result) { |
28 *to_update = result; | 28 *to_update = result; |
29 } | 29 } |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 // static | 33 // static |
34 scoped_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( | 34 scoped_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( |
35 const GURL& url, | 35 const GURL& url, |
36 FrameTreeNode* frame_tree_node) { | 36 FrameTreeNode* frame_tree_node, |
| 37 const base::TimeTicks& navigation_start) { |
37 return scoped_ptr<NavigationHandleImpl>( | 38 return scoped_ptr<NavigationHandleImpl>( |
38 new NavigationHandleImpl(url, frame_tree_node)); | 39 new NavigationHandleImpl(url, frame_tree_node, navigation_start)); |
39 } | 40 } |
40 | 41 |
41 NavigationHandleImpl::NavigationHandleImpl(const GURL& url, | 42 NavigationHandleImpl::NavigationHandleImpl( |
42 FrameTreeNode* frame_tree_node) | 43 const GURL& url, |
| 44 FrameTreeNode* frame_tree_node, |
| 45 const base::TimeTicks& navigation_start) |
43 : url_(url), | 46 : url_(url), |
44 is_post_(false), | 47 is_post_(false), |
45 has_user_gesture_(false), | 48 has_user_gesture_(false), |
46 transition_(ui::PAGE_TRANSITION_LINK), | 49 transition_(ui::PAGE_TRANSITION_LINK), |
47 is_external_protocol_(false), | 50 is_external_protocol_(false), |
48 net_error_code_(net::OK), | 51 net_error_code_(net::OK), |
49 render_frame_host_(nullptr), | 52 render_frame_host_(nullptr), |
50 is_same_page_(false), | 53 is_same_page_(false), |
51 state_(INITIAL), | 54 state_(INITIAL), |
52 is_transferring_(false), | 55 is_transferring_(false), |
53 frame_tree_node_(frame_tree_node), | 56 frame_tree_node_(frame_tree_node), |
54 next_index_(0) { | 57 next_index_(0), |
| 58 navigation_start_(navigation_start) { |
| 59 DCHECK(!navigation_start.is_null()); |
55 // PlzNavigate | 60 // PlzNavigate |
56 // Initialize the ServiceWorkerNavigationHandle if it can be created for this | 61 // Initialize the ServiceWorkerNavigationHandle if it can be created for this |
57 // frame. | 62 // frame. |
58 bool can_create_service_worker = | 63 bool can_create_service_worker = |
59 (frame_tree_node_->current_replication_state().sandbox_flags & | 64 (frame_tree_node_->current_replication_state().sandbox_flags & |
60 blink::WebSandboxFlags::Origin) != blink::WebSandboxFlags::Origin; | 65 blink::WebSandboxFlags::Origin) != blink::WebSandboxFlags::Origin; |
61 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 66 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
62 switches::kEnableBrowserSideNavigation) && | 67 switches::kEnableBrowserSideNavigation) && |
63 can_create_service_worker) { | 68 can_create_service_worker) { |
64 BrowserContext* browser_context = | 69 BrowserContext* browser_context = |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 default: | 341 default: |
337 NOTREACHED(); | 342 NOTREACHED(); |
338 } | 343 } |
339 } | 344 } |
340 next_index_ = 0; | 345 next_index_ = 0; |
341 state_ = WILL_REDIRECT_REQUEST; | 346 state_ = WILL_REDIRECT_REQUEST; |
342 return NavigationThrottle::PROCEED; | 347 return NavigationThrottle::PROCEED; |
343 } | 348 } |
344 | 349 |
345 } // namespace content | 350 } // namespace content |
OLD | NEW |