Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: content/browser/frame_host/navigation_handle_impl.h

Issue 2413663003: Expose GlobalRequestID in NavigationHandle and ResourceRequestInfo. (Closed)
Patch Set: Add comments. Relocate method. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
11 #include <string> 13 #include <string>
14 #include <utility>
15 #include <vector>
12 16
13 #include "base/callback.h" 17 #include "base/callback.h"
14 #include "base/macros.h" 18 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 19 #include "base/memory/ref_counted.h"
16 #include "base/memory/scoped_vector.h" 20 #include "base/memory/scoped_vector.h"
17 #include "content/browser/frame_host/frame_tree_node.h" 21 #include "content/browser/frame_host/frame_tree_node.h"
18 #include "content/browser/frame_host/render_frame_host_impl.h" 22 #include "content/browser/frame_host/render_frame_host_impl.h"
19 #include "content/common/content_export.h" 23 #include "content/common/content_export.h"
20 #include "content/public/browser/global_request_id.h" 24 #include "content/public/browser/global_request_id.h"
21 #include "content/public/browser/navigation_data.h" 25 #include "content/public/browser/navigation_data.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 const GURL& new_referrer_url, 127 const GURL& new_referrer_url,
124 bool new_is_external_protocol) override; 128 bool new_is_external_protocol) override;
125 NavigationThrottle::ThrottleCheckResult CallWillProcessResponseForTesting( 129 NavigationThrottle::ThrottleCheckResult CallWillProcessResponseForTesting(
126 RenderFrameHost* render_frame_host, 130 RenderFrameHost* render_frame_host,
127 const std::string& raw_response_header) override; 131 const std::string& raw_response_header) override;
128 void CallDidCommitNavigationForTesting(const GURL& url) override; 132 void CallDidCommitNavigationForTesting(const GURL& url) override;
129 bool WasStartedFromContextMenu() const override; 133 bool WasStartedFromContextMenu() const override;
130 134
131 NavigationData* GetNavigationData() override; 135 NavigationData* GetNavigationData() override;
132 136
137 bool HasNetworkResponseStarted() override;
138
139 // This is valid after the network response has started.
140 // TODO(clamy): See if this can be initialized earlier if needed by
141 // non-transfer code. There may be some issues in PlzNavigate, where
142 // WillStartRequest will be called before starting a request on the IO thread.
143 const GlobalRequestID& GetGlobalRequestID() override;
144
133 // The NavigatorDelegate to notify/query for various navigation events. 145 // The NavigatorDelegate to notify/query for various navigation events.
134 // Normally this is the WebContents, except if this NavigationHandle was 146 // Normally this is the WebContents, except if this NavigationHandle was
135 // created during a navigation to an interstitial page. In this case it will 147 // created during a navigation to an interstitial page. In this case it will
136 // be the InterstitialPage itself. 148 // be the InterstitialPage itself.
137 // 149 //
138 // Note: due to the interstitial navigation case, all calls that can possibly 150 // Note: due to the interstitial navigation case, all calls that can possibly
139 // expose the NavigationHandle to code outside of content/ MUST go though the 151 // expose the NavigationHandle to code outside of content/ MUST go though the
140 // NavigatorDelegate. In particular, the ContentBrowserClient should not be 152 // NavigatorDelegate. In particular, the ContentBrowserClient should not be
141 // called directly form the NavigationHandle code. Thus, these calls will not 153 // called directly form the NavigationHandle code. Thus, these calls will not
142 // expose the NavigationHandle when navigating to an InterstialPage. 154 // expose the NavigationHandle when navigating to an InterstialPage.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 267
256 // Called during commit. Takes ownership of the embedder's NavigationData 268 // Called during commit. Takes ownership of the embedder's NavigationData
257 // instance. This NavigationData may have been cloned prior to being added 269 // instance. This NavigationData may have been cloned prior to being added
258 // here. 270 // here.
259 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { 271 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) {
260 navigation_data_ = std::move(navigation_data); 272 navigation_data_ = std::move(navigation_data);
261 } 273 }
262 274
263 SSLStatus ssl_status() { return ssl_status_; } 275 SSLStatus ssl_status() { return ssl_status_; }
264 276
265 // This is valid after the network response has started.
266 // TODO(clamy): See if this can be initialized earlier if needed by
267 // non-transfer code. There may be some issues in PlzNavigate, where
268 // WillStartRequest will be called before starting a request on the IO thread.
269 const GlobalRequestID& request_id() const {
270 DCHECK_GE(state_, WILL_PROCESS_RESPONSE);
271 return request_id_;
272 }
273
274 // Called when the navigation is transferred to a different renderer. 277 // Called when the navigation is transferred to a different renderer.
275 void Transfer(); 278 void Transfer();
276 279
277 NavigationUIData* navigation_ui_data() const { 280 NavigationUIData* navigation_ui_data() const {
278 return navigation_ui_data_.get(); 281 return navigation_ui_data_.get();
279 } 282 }
280 283
281 private: 284 private:
282 friend class NavigationHandleImplTest; 285 friend class NavigationHandleImplTest;
283 286
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 bool started_from_context_menu_; 424 bool started_from_context_menu_;
422 425
423 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; 426 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_;
424 427
425 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 428 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
426 }; 429 };
427 430
428 } // namespace content 431 } // namespace content
429 432
430 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 433 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698