| 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> |
| 11 | |
| 12 #include <memory> | |
| 13 #include <string> | 11 #include <string> |
| 14 #include <utility> | |
| 15 #include <vector> | |
| 16 | 12 |
| 17 #include "base/callback.h" | 13 #include "base/callback.h" |
| 18 #include "base/macros.h" | 14 #include "base/macros.h" |
| 19 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 21 #include "content/browser/frame_host/frame_tree_node.h" | 17 #include "content/browser/frame_host/frame_tree_node.h" |
| 22 #include "content/browser/frame_host/render_frame_host_impl.h" | 18 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 23 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 24 #include "content/public/browser/global_request_id.h" | 20 #include "content/public/browser/global_request_id.h" |
| 25 #include "content/public/browser/navigation_data.h" | 21 #include "content/public/browser/navigation_data.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting( | 121 NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting( |
| 126 const GURL& new_url, | 122 const GURL& new_url, |
| 127 bool new_method_is_post, | 123 bool new_method_is_post, |
| 128 const GURL& new_referrer_url, | 124 const GURL& new_referrer_url, |
| 129 bool new_is_external_protocol) override; | 125 bool new_is_external_protocol) override; |
| 130 NavigationThrottle::ThrottleCheckResult CallWillProcessResponseForTesting( | 126 NavigationThrottle::ThrottleCheckResult CallWillProcessResponseForTesting( |
| 131 RenderFrameHost* render_frame_host, | 127 RenderFrameHost* render_frame_host, |
| 132 const std::string& raw_response_header) override; | 128 const std::string& raw_response_header) override; |
| 133 void CallDidCommitNavigationForTesting(const GURL& url) override; | 129 void CallDidCommitNavigationForTesting(const GURL& url) override; |
| 134 bool WasStartedFromContextMenu() const override; | 130 bool WasStartedFromContextMenu() const override; |
| 135 const GlobalRequestID& GetGlobalRequestID() override; | |
| 136 | 131 |
| 137 NavigationData* GetNavigationData() override; | 132 NavigationData* GetNavigationData() override; |
| 138 | 133 |
| 139 // The NavigatorDelegate to notify/query for various navigation events. | 134 // The NavigatorDelegate to notify/query for various navigation events. |
| 140 // Normally this is the WebContents, except if this NavigationHandle was | 135 // Normally this is the WebContents, except if this NavigationHandle was |
| 141 // created during a navigation to an interstitial page. In this case it will | 136 // created during a navigation to an interstitial page. In this case it will |
| 142 // be the InterstitialPage itself. | 137 // be the InterstitialPage itself. |
| 143 // | 138 // |
| 144 // Note: due to the interstitial navigation case, all calls that can possibly | 139 // Note: due to the interstitial navigation case, all calls that can possibly |
| 145 // expose the NavigationHandle to code outside of content/ MUST go though the | 140 // expose the NavigationHandle to code outside of content/ MUST go though the |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 258 |
| 264 // Called during commit. Takes ownership of the embedder's NavigationData | 259 // Called during commit. Takes ownership of the embedder's NavigationData |
| 265 // instance. This NavigationData may have been cloned prior to being added | 260 // instance. This NavigationData may have been cloned prior to being added |
| 266 // here. | 261 // here. |
| 267 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { | 262 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { |
| 268 navigation_data_ = std::move(navigation_data); | 263 navigation_data_ = std::move(navigation_data); |
| 269 } | 264 } |
| 270 | 265 |
| 271 SSLStatus ssl_status() { return ssl_status_; } | 266 SSLStatus ssl_status() { return ssl_status_; } |
| 272 | 267 |
| 268 // This is valid after the network response has started. |
| 269 // TODO(clamy): See if this can be initialized earlier if needed by |
| 270 // non-transfer code. There may be some issues in PlzNavigate, where |
| 271 // WillStartRequest will be called before starting a request on the IO thread. |
| 272 const GlobalRequestID& request_id() const { |
| 273 DCHECK_GE(state_, WILL_PROCESS_RESPONSE); |
| 274 return request_id_; |
| 275 } |
| 276 |
| 273 // Called when the navigation is transferred to a different renderer. | 277 // Called when the navigation is transferred to a different renderer. |
| 274 void Transfer(); | 278 void Transfer(); |
| 275 | 279 |
| 276 NavigationUIData* navigation_ui_data() const { | 280 NavigationUIData* navigation_ui_data() const { |
| 277 return navigation_ui_data_.get(); | 281 return navigation_ui_data_.get(); |
| 278 } | 282 } |
| 279 | 283 |
| 280 private: | 284 private: |
| 281 friend class NavigationHandleImplTest; | 285 friend class NavigationHandleImplTest; |
| 282 | 286 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 bool started_from_context_menu_; | 425 bool started_from_context_menu_; |
| 422 | 426 |
| 423 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; | 427 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; |
| 424 | 428 |
| 425 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 429 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
| 426 }; | 430 }; |
| 427 | 431 |
| 428 } // namespace content | 432 } // namespace content |
| 429 | 433 |
| 430 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 434 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
| OLD | NEW |