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

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

Issue 2413663003: Expose GlobalRequestID in NavigationHandle and ResourceRequestInfo. (Closed)
Patch Set: Add frame map 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const GURL& new_referrer_url, 128 const GURL& new_referrer_url,
125 bool new_is_external_protocol) override; 129 bool new_is_external_protocol) override;
126 NavigationThrottle::ThrottleCheckResult CallWillProcessResponseForTesting( 130 NavigationThrottle::ThrottleCheckResult CallWillProcessResponseForTesting(
127 RenderFrameHost* render_frame_host, 131 RenderFrameHost* render_frame_host,
128 const std::string& raw_response_header) override; 132 const std::string& raw_response_header) override;
129 void CallDidCommitNavigationForTesting(const GURL& url) override; 133 void CallDidCommitNavigationForTesting(const GURL& url) override;
130 bool WasStartedFromContextMenu() const override; 134 bool WasStartedFromContextMenu() const override;
131 135
132 NavigationData* GetNavigationData() override; 136 NavigationData* GetNavigationData() override;
133 137
138 bool HasNetworkResponseStarted() const override;
139
140 // This is valid after the network response has started.
141 // TODO(clamy): See if this can be initialized earlier if needed by
142 // non-transfer code. There may be some issues in PlzNavigate, where
143 // WillStartRequest will be called before starting a request on the IO thread.
144 const GlobalRequestID& GetGlobalRequestID() const override;
145
134 // The NavigatorDelegate to notify/query for various navigation events. 146 // The NavigatorDelegate to notify/query for various navigation events.
135 // Normally this is the WebContents, except if this NavigationHandle was 147 // Normally this is the WebContents, except if this NavigationHandle was
136 // created during a navigation to an interstitial page. In this case it will 148 // created during a navigation to an interstitial page. In this case it will
137 // be the InterstitialPage itself. 149 // be the InterstitialPage itself.
138 // 150 //
139 // Note: due to the interstitial navigation case, all calls that can possibly 151 // Note: due to the interstitial navigation case, all calls that can possibly
140 // expose the NavigationHandle to code outside of content/ MUST go though the 152 // expose the NavigationHandle to code outside of content/ MUST go though the
141 // NavigatorDelegate. In particular, the ContentBrowserClient should not be 153 // NavigatorDelegate. In particular, the ContentBrowserClient should not be
142 // called directly form the NavigationHandle code. Thus, these calls will not 154 // called directly form the NavigationHandle code. Thus, these calls will not
143 // expose the NavigationHandle when navigating to an InterstialPage. 155 // expose the NavigationHandle when navigating to an InterstialPage.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 268
257 // Called during commit. Takes ownership of the embedder's NavigationData 269 // Called during commit. Takes ownership of the embedder's NavigationData
258 // instance. This NavigationData may have been cloned prior to being added 270 // instance. This NavigationData may have been cloned prior to being added
259 // here. 271 // here.
260 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { 272 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) {
261 navigation_data_ = std::move(navigation_data); 273 navigation_data_ = std::move(navigation_data);
262 } 274 }
263 275
264 SSLStatus ssl_status() { return ssl_status_; } 276 SSLStatus ssl_status() { return ssl_status_; }
265 277
266 // This is valid after the network response has started.
267 // TODO(clamy): See if this can be initialized earlier if needed by
268 // non-transfer code. There may be some issues in PlzNavigate, where
269 // WillStartRequest will be called before starting a request on the IO thread.
270 const GlobalRequestID& request_id() const {
271 DCHECK_GE(state_, WILL_PROCESS_RESPONSE);
272 return request_id_;
273 }
274
275 // Called when the navigation is transferred to a different renderer. 278 // Called when the navigation is transferred to a different renderer.
276 void Transfer(); 279 void Transfer();
277 280
278 NavigationUIData* navigation_ui_data() const { 281 NavigationUIData* navigation_ui_data() const {
279 return navigation_ui_data_.get(); 282 return navigation_ui_data_.get();
280 } 283 }
281 284
282 private: 285 private:
283 friend class NavigationHandleImplTest; 286 friend class NavigationHandleImplTest;
284 287
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 bool started_from_context_menu_; 426 bool started_from_context_menu_;
424 427
425 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; 428 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_;
426 429
427 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 430 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
428 }; 431 };
429 432
430 } // namespace content 433 } // namespace content
431 434
432 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 435 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698