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

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

Issue 2413663003: Expose GlobalRequestID in NavigationHandle and ResourceRequestInfo. (Closed)
Patch Set: Ignore PlzNavigate 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 // This is valid after the network response has started.
clamy 2016/11/09 16:06:53 Move this function to the block of implentation of
Not at Google. Contact bengr 2016/11/09 22:30:01 Done.
139 // TODO(clamy): See if this can be initialized earlier if needed by
140 // non-transfer code. There may be some issues in PlzNavigate, where
141 // WillStartRequest will be called before starting a request on the IO thread.
142 const GlobalRequestID& GetGlobalRequestID() override;
143
134 // The NavigatorDelegate to notify/query for various navigation events. 144 // The NavigatorDelegate to notify/query for various navigation events.
135 // Normally this is the WebContents, except if this NavigationHandle was 145 // Normally this is the WebContents, except if this NavigationHandle was
136 // created during a navigation to an interstitial page. In this case it will 146 // created during a navigation to an interstitial page. In this case it will
137 // be the InterstitialPage itself. 147 // be the InterstitialPage itself.
138 // 148 //
139 // Note: due to the interstitial navigation case, all calls that can possibly 149 // 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 150 // expose the NavigationHandle to code outside of content/ MUST go though the
141 // NavigatorDelegate. In particular, the ContentBrowserClient should not be 151 // NavigatorDelegate. In particular, the ContentBrowserClient should not be
142 // called directly form the NavigationHandle code. Thus, these calls will not 152 // called directly form the NavigationHandle code. Thus, these calls will not
143 // expose the NavigationHandle when navigating to an InterstialPage. 153 // expose the NavigationHandle when navigating to an InterstialPage.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 268
259 // Called during commit. Takes ownership of the embedder's NavigationData 269 // Called during commit. Takes ownership of the embedder's NavigationData
260 // instance. This NavigationData may have been cloned prior to being added 270 // instance. This NavigationData may have been cloned prior to being added
261 // here. 271 // here.
262 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { 272 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) {
263 navigation_data_ = std::move(navigation_data); 273 navigation_data_ = std::move(navigation_data);
264 } 274 }
265 275
266 SSLStatus ssl_status() { return ssl_status_; } 276 SSLStatus ssl_status() { return ssl_status_; }
267 277
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
277 // Called when the navigation is transferred to a different renderer. 278 // Called when the navigation is transferred to a different renderer.
278 void Transfer(); 279 void Transfer();
279 280
280 NavigationUIData* navigation_ui_data() const { 281 NavigationUIData* navigation_ui_data() const {
281 return navigation_ui_data_.get(); 282 return navigation_ui_data_.get();
282 } 283 }
283 284
284 private: 285 private:
285 friend class NavigationHandleImplTest; 286 friend class NavigationHandleImplTest;
286 287
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 bool started_from_context_menu_; 426 bool started_from_context_menu_;
426 427
427 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; 428 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_;
428 429
429 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 430 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
430 }; 431 };
431 432
432 } // namespace content 433 } // namespace content
433 434
434 #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