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 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
7 | 7 |
8 #include "content/public/browser/navigation_handle.h" | 8 #include "content/public/browser/navigation_handle.h" |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 // PlzNavigate: This value always comes from the CommonNavigationParams | 84 // PlzNavigate: This value always comes from the CommonNavigationParams |
85 // associated with this navigation. | 85 // associated with this navigation. |
86 static std::unique_ptr<NavigationHandleImpl> Create( | 86 static std::unique_ptr<NavigationHandleImpl> Create( |
87 const GURL& url, | 87 const GURL& url, |
88 const std::vector<GURL>& redirect_chain, | 88 const std::vector<GURL>& redirect_chain, |
89 FrameTreeNode* frame_tree_node, | 89 FrameTreeNode* frame_tree_node, |
90 bool is_renderer_initiated, | 90 bool is_renderer_initiated, |
91 bool is_same_page, | 91 bool is_same_page, |
92 const base::TimeTicks& navigation_start, | 92 const base::TimeTicks& navigation_start, |
93 int pending_nav_entry_id, | 93 int pending_nav_entry_id, |
94 bool started_from_context_menu); | 94 bool started_from_context_menu, |
95 bool should_bypass_main_world_csp); | |
95 ~NavigationHandleImpl() override; | 96 ~NavigationHandleImpl() override; |
96 | 97 |
97 // NavigationHandle implementation: | 98 // NavigationHandle implementation: |
98 const GURL& GetURL() override; | 99 const GURL& GetURL() override; |
99 SiteInstance* GetStartingSiteInstance() override; | 100 SiteInstance* GetStartingSiteInstance() override; |
100 bool IsInMainFrame() override; | 101 bool IsInMainFrame() override; |
101 bool IsParentMainFrame() override; | 102 bool IsParentMainFrame() override; |
102 bool IsRendererInitiated() override; | 103 bool IsRendererInitiated() override; |
103 bool WasServerRedirect() override; | 104 bool WasServerRedirect() override; |
104 const std::vector<GURL>& GetRedirectChain() override; | 105 const std::vector<GURL>& GetRedirectChain() override; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 RenderFrameHost* render_frame_host, | 142 RenderFrameHost* render_frame_host, |
142 const std::string& raw_response_header) override; | 143 const std::string& raw_response_header) override; |
143 void CallDidCommitNavigationForTesting(const GURL& url) override; | 144 void CallDidCommitNavigationForTesting(const GURL& url) override; |
144 bool WasStartedFromContextMenu() const override; | 145 bool WasStartedFromContextMenu() const override; |
145 const GURL& GetSearchableFormURL() override; | 146 const GURL& GetSearchableFormURL() override; |
146 const std::string& GetSearchableFormEncoding() override; | 147 const std::string& GetSearchableFormEncoding() override; |
147 ReloadType GetReloadType() override; | 148 ReloadType GetReloadType() override; |
148 const GlobalRequestID& GetGlobalRequestID() override; | 149 const GlobalRequestID& GetGlobalRequestID() override; |
149 | 150 |
150 NavigationData* GetNavigationData() override; | 151 NavigationData* GetNavigationData() override; |
152 bool ShouldBypassMainWorldCSP() const override; | |
151 | 153 |
152 // The NavigatorDelegate to notify/query for various navigation events. | 154 // The NavigatorDelegate to notify/query for various navigation events. |
153 // Normally this is the WebContents, except if this NavigationHandle was | 155 // Normally this is the WebContents, except if this NavigationHandle was |
154 // created during a navigation to an interstitial page. In this case it will | 156 // created during a navigation to an interstitial page. In this case it will |
155 // be the InterstitialPage itself. | 157 // be the InterstitialPage itself. |
156 // | 158 // |
157 // Note: due to the interstitial navigation case, all calls that can possibly | 159 // Note: due to the interstitial navigation case, all calls that can possibly |
158 // expose the NavigationHandle to code outside of content/ MUST go though the | 160 // expose the NavigationHandle to code outside of content/ MUST go though the |
159 // NavigatorDelegate. In particular, the ContentBrowserClient should not be | 161 // NavigatorDelegate. In particular, the ContentBrowserClient should not be |
160 // called directly form the NavigationHandle code. Thus, these calls will not | 162 // called directly form the NavigationHandle code. Thus, these calls will not |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 DID_COMMIT_ERROR_PAGE, | 346 DID_COMMIT_ERROR_PAGE, |
345 }; | 347 }; |
346 | 348 |
347 NavigationHandleImpl(const GURL& url, | 349 NavigationHandleImpl(const GURL& url, |
348 const std::vector<GURL>& redirect_chain, | 350 const std::vector<GURL>& redirect_chain, |
349 FrameTreeNode* frame_tree_node, | 351 FrameTreeNode* frame_tree_node, |
350 bool is_renderer_initiated, | 352 bool is_renderer_initiated, |
351 bool is_same_page, | 353 bool is_same_page, |
352 const base::TimeTicks& navigation_start, | 354 const base::TimeTicks& navigation_start, |
353 int pending_nav_entry_id, | 355 int pending_nav_entry_id, |
354 bool started_from_context_menu); | 356 bool started_from_context_menu, |
357 bool should_bypass_main_world_csp); | |
355 | 358 |
356 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); | 359 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); |
357 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); | 360 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); |
358 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); | 361 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); |
359 | 362 |
360 // Called when WillProcessResponse checks are done, to find the final | 363 // Called when WillProcessResponse checks are done, to find the final |
361 // RenderFrameHost for the navigation. Checks whether the navigation should be | 364 // RenderFrameHost for the navigation. Checks whether the navigation should be |
362 // transferred. Returns false if the transfer attempt results in the | 365 // transferred. Returns false if the transfer attempt results in the |
363 // destruction of this NavigationHandle and the navigation should no longer | 366 // destruction of this NavigationHandle and the navigation should no longer |
364 // proceed. This can happen when the RenderFrameHostManager determines a | 367 // proceed. This can happen when the RenderFrameHostManager determines a |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 ReloadType reload_type_; | 486 ReloadType reload_type_; |
484 | 487 |
485 GURL searchable_form_url_; | 488 GURL searchable_form_url_; |
486 std::string searchable_form_encoding_; | 489 std::string searchable_form_encoding_; |
487 | 490 |
488 GURL previous_url_; | 491 GURL previous_url_; |
489 GURL base_url_; | 492 GURL base_url_; |
490 net::HostPortPair socket_address_; | 493 net::HostPortPair socket_address_; |
491 NavigationType navigation_type_; | 494 NavigationType navigation_type_; |
492 | 495 |
496 // Whether or not the navigation has been issued by an isolated world. For | |
497 // instance from a chrome extension. When it returns true, the navigation | |
alexmos
2017/02/14 06:57:20
nit: I'd also mention content scripts, and make it
arthursonzogni
2017/02/15 09:26:09
Done.
| |
498 // should not be blocked by the parent frame's Content-Security-Policy(CSP). | |
alexmos
2017/02/14 06:57:20
nit: probably mentioning one of Content Security P
arthursonzogni
2017/02/15 09:26:09
Done.
| |
499 bool should_bypass_main_world_csp_; | |
500 | |
493 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; | 501 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; |
494 | 502 |
495 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 503 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
496 }; | 504 }; |
497 | 505 |
498 } // namespace content | 506 } // namespace content |
499 | 507 |
500 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 508 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
OLD | NEW |