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

Side by Side Diff: content/public/browser/navigation_handle.h

Issue 2413663003: Expose GlobalRequestID in NavigationHandle and ResourceRequestInfo. (Closed)
Patch Set: Addressed comments 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 "ui/base/page_transition_types.h" 15 #include "ui/base/page_transition_types.h"
15 16
16 class GURL; 17 class GURL;
17 18
18 namespace net { 19 namespace net {
19 class HttpResponseHeaders; 20 class HttpResponseHeaders;
20 } // namespace net 21 } // namespace net
21 22
22 namespace content { 23 namespace content {
24 struct GlobalRequestID;
23 class NavigationData; 25 class NavigationData;
24 class NavigationThrottle; 26 class NavigationThrottle;
25 class RenderFrameHost; 27 class RenderFrameHost;
26 class SiteInstance; 28 class SiteInstance;
27 class WebContents; 29 class WebContents;
28 30
29 // A NavigationHandle tracks information related to a single navigation. 31 // A NavigationHandle tracks information related to a single navigation.
30 // NavigationHandles are provided to several WebContentsObserver methods to 32 // NavigationHandles are provided to several WebContentsObserver methods to
31 // allow observers to track specific navigations. Observers should clear any 33 // allow observers to track specific navigations. Observers should clear any
32 // references to a NavigationHandle at the time of 34 // references to a NavigationHandle at the time of
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 176
175 // Resumes a navigation that was previously deferred by a NavigationThrottle. 177 // Resumes a navigation that was previously deferred by a NavigationThrottle.
176 virtual void Resume() = 0; 178 virtual void Resume() = 0;
177 179
178 // Cancels a navigation that was previously deferred by a NavigationThrottle. 180 // Cancels a navigation that was previously deferred by a NavigationThrottle.
179 // |result| should be equal to NavigationThrottle::CANCEL or 181 // |result| should be equal to NavigationThrottle::CANCEL or
180 // NavigationThrottle::CANCEL_AND_IGNORE. 182 // NavigationThrottle::CANCEL_AND_IGNORE.
181 virtual void CancelDeferredNavigation( 183 virtual void CancelDeferredNavigation(
182 NavigationThrottle::ThrottleCheckResult result) = 0; 184 NavigationThrottle::ThrottleCheckResult result) = 0;
183 185
186 virtual bool HasNetworkResponseStarted() = 0;
Charlie Reis 2016/10/29 00:07:10 nit: All methods in content/public should be docum
Not at Google. Contact bengr 2016/11/01 21:11:06 Done.
187
188 // This is valid after the network response has started. Returns the ID of the
189 // MAIN_FRAME URLRequest associated with this navigation.
190 virtual const GlobalRequestID& GetGlobalRequestID() = 0;
191
184 // Testing methods ---------------------------------------------------------- 192 // Testing methods ----------------------------------------------------------
185 // 193 //
186 // The following methods should be used exclusively for writing unit tests. 194 // The following methods should be used exclusively for writing unit tests.
187 195
188 static std::unique_ptr<NavigationHandle> CreateNavigationHandleForTesting( 196 static std::unique_ptr<NavigationHandle> CreateNavigationHandleForTesting(
189 const GURL& url, 197 const GURL& url,
190 RenderFrameHost* render_frame_host, 198 RenderFrameHost* render_frame_host,
191 bool committed = false, 199 bool committed = false,
192 net::Error error = net::OK); 200 net::Error error = net::OK);
193 201
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 235
228 // The NavigationData that the embedder returned from 236 // The NavigationData that the embedder returned from
229 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will 237 // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will
230 // be a clone of the NavigationData. 238 // be a clone of the NavigationData.
231 virtual NavigationData* GetNavigationData() = 0; 239 virtual NavigationData* GetNavigationData() = 0;
232 }; 240 };
233 241
234 } // namespace content 242 } // namespace content
235 243
236 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_ 244 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698