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

Side by Side Diff: content/public/browser/navigation_handle.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_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string>
9 10
10 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
11 #include "content/public/browser/navigation_throttle.h" 12 #include "content/public/browser/navigation_throttle.h"
12 #include "content/public/common/referrer.h" 13 #include "content/public/common/referrer.h"
13 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
14 #include "net/http/http_response_info.h" 15 #include "net/http/http_response_info.h"
15 #include "ui/base/page_transition_types.h" 16 #include "ui/base/page_transition_types.h"
16 17
17 class GURL; 18 class GURL;
18 19
19 namespace net { 20 namespace net {
20 class HttpResponseHeaders; 21 class HttpResponseHeaders;
21 } // namespace net 22 } // namespace net
22 23
23 namespace content { 24 namespace content {
25 struct GlobalRequestID;
24 class NavigationData; 26 class NavigationData;
25 class NavigationThrottle; 27 class NavigationThrottle;
26 class RenderFrameHost; 28 class RenderFrameHost;
27 class SiteInstance; 29 class SiteInstance;
28 class WebContents; 30 class WebContents;
29 31
30 // A NavigationHandle tracks information related to a single navigation. 32 // A NavigationHandle tracks information related to a single navigation.
31 // NavigationHandles are provided to several WebContentsObserver methods to 33 // NavigationHandles are provided to several WebContentsObserver methods to
32 // allow observers to track specific navigations. Observers should clear any 34 // allow observers to track specific navigations. Observers should clear any
33 // references to a NavigationHandle at the time of 35 // references to a NavigationHandle at the time of
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 178
177 // Resumes a navigation that was previously deferred by a NavigationThrottle. 179 // Resumes a navigation that was previously deferred by a NavigationThrottle.
178 virtual void Resume() = 0; 180 virtual void Resume() = 0;
179 181
180 // Cancels a navigation that was previously deferred by a NavigationThrottle. 182 // Cancels a navigation that was previously deferred by a NavigationThrottle.
181 // |result| should be equal to NavigationThrottle::CANCEL or 183 // |result| should be equal to NavigationThrottle::CANCEL or
182 // NavigationThrottle::CANCEL_AND_IGNORE. 184 // NavigationThrottle::CANCEL_AND_IGNORE.
183 virtual void CancelDeferredNavigation( 185 virtual void CancelDeferredNavigation(
184 NavigationThrottle::ThrottleCheckResult result) = 0; 186 NavigationThrottle::ThrottleCheckResult result) = 0;
185 187
188 // Returns the ID of the MAIN_FRAME URLRequest associated with this
clamy 2016/11/09 16:06:53 This is valid for subframes as well. I think we ca
Not at Google. Contact bengr 2016/11/09 22:30:01 Done.
189 // navigation. Can only be called from NavigationThrottle::WillProcessResponse
190 // and WebContentsObserver::ReadyToCommitNavigation.
clamy 2016/11/09 16:06:53 Can you add something like: "Note: in the case of
Not at Google. Contact bengr 2016/11/09 22:30:01 Done.
191 virtual const GlobalRequestID& GetGlobalRequestID() = 0;
192
186 // Testing methods ---------------------------------------------------------- 193 // Testing methods ----------------------------------------------------------
187 // 194 //
188 // The following methods should be used exclusively for writing unit tests. 195 // The following methods should be used exclusively for writing unit tests.
189 196
190 static std::unique_ptr<NavigationHandle> CreateNavigationHandleForTesting( 197 static std::unique_ptr<NavigationHandle> CreateNavigationHandleForTesting(
191 const GURL& url, 198 const GURL& url,
192 RenderFrameHost* render_frame_host, 199 RenderFrameHost* render_frame_host,
193 bool committed = false, 200 bool committed = false,
194 net::Error error = net::OK); 201 net::Error error = net::OK);
195 202
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 236
230 // The NavigationData that the embedder returned from 237 // The NavigationData that the embedder returned from
231 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will 238 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will
232 // be a clone of the NavigationData. 239 // be a clone of the NavigationData.
233 virtual NavigationData* GetNavigationData() = 0; 240 virtual NavigationData* GetNavigationData() = 0;
234 }; 241 };
235 242
236 } // namespace content 243 } // namespace content
237 244
238 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 245 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698