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

Side by Side Diff: content/browser/loader/navigation_url_loader_delegate.h

Issue 2537593002: PlzNavigate: Pass move information along with the response started notification for navigation requ… (Closed)
Patch Set: . Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_ 5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_
6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_ 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 13
14 namespace net { 14 namespace net {
15 struct RedirectInfo; 15 struct RedirectInfo;
16 } 16 }
17 17
18 namespace content { 18 namespace content {
19 19
20 class NavigationData; 20 class NavigationData;
21 class StreamHandle; 21 class StreamHandle;
22 struct GlobalRequestID;
22 struct ResourceResponse; 23 struct ResourceResponse;
23 struct SSLStatus; 24 struct SSLStatus;
24 25
25 // PlzNavigate: The delegate interface to NavigationURLLoader. 26 // PlzNavigate: The delegate interface to NavigationURLLoader.
26 class CONTENT_EXPORT NavigationURLLoaderDelegate { 27 class CONTENT_EXPORT NavigationURLLoaderDelegate {
27 public: 28 public:
28 // Called when the request is redirected. Call FollowRedirect to continue 29 // Called when the request is redirected. Call FollowRedirect to continue
29 // processing the request. 30 // processing the request.
30 virtual void OnRequestRedirected( 31 virtual void OnRequestRedirected(
31 const net::RedirectInfo& redirect_info, 32 const net::RedirectInfo& redirect_info,
32 const scoped_refptr<ResourceResponse>& response) = 0; 33 const scoped_refptr<ResourceResponse>& response) = 0;
33 34
34 // Called when the request receives its response. No further calls will be 35 // Called when the request receives its response. No further calls will be
35 // made to the delegate. The response body is returned as a stream in 36 // made to the delegate. The response body is returned as a stream in
36 // |body_stream|. |navigation_data| is passed to the NavigationHandle. 37 // |body_stream|. |navigation_data| is passed to the NavigationHandle.
37 virtual void OnResponseStarted( 38 virtual void OnResponseStarted(
38 const scoped_refptr<ResourceResponse>& response, 39 const scoped_refptr<ResourceResponse>& response,
39 std::unique_ptr<StreamHandle> body_stream, 40 std::unique_ptr<StreamHandle> body_stream,
40 const SSLStatus& ssl_status, 41 const SSLStatus& ssl_status,
41 std::unique_ptr<NavigationData> navigation_data) = 0; 42 std::unique_ptr<NavigationData> navigation_data,
43 const GlobalRequestID& request_id,
44 bool is_download,
45 bool is_stream) = 0;
42 46
43 // Called if the request fails before receving a response. |net_error| is a 47 // Called if the request fails before receving a response. |net_error| is a
44 // network error code for the failure. |has_stale_copy_in_cache| is true if 48 // network error code for the failure. |has_stale_copy_in_cache| is true if
45 // there is a stale copy of the unreachable page in cache. 49 // there is a stale copy of the unreachable page in cache.
46 virtual void OnRequestFailed(bool has_stale_copy_in_cache, int net_error) = 0; 50 virtual void OnRequestFailed(bool has_stale_copy_in_cache, int net_error) = 0;
47 51
48 // Called after the network request has begun on the IO thread at time 52 // Called after the network request has begun on the IO thread at time
49 // |timestamp|. This is just a thread hop but is used to compare timing 53 // |timestamp|. This is just a thread hop but is used to compare timing
50 // against the pre-PlzNavigate codepath which didn't start the network request 54 // against the pre-PlzNavigate codepath which didn't start the network request
51 // until after the renderer was initialized. 55 // until after the renderer was initialized.
52 virtual void OnRequestStarted(base::TimeTicks timestamp) = 0; 56 virtual void OnRequestStarted(base::TimeTicks timestamp) = 0;
53 57
54 protected: 58 protected:
55 NavigationURLLoaderDelegate() {} 59 NavigationURLLoaderDelegate() {}
56 virtual ~NavigationURLLoaderDelegate() {} 60 virtual ~NavigationURLLoaderDelegate() {}
57 61
58 private: 62 private:
59 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderDelegate); 63 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderDelegate);
60 }; 64 };
61 65
62 } // namespace content 66 } // namespace content
63 67
64 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_ 68 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_resource_handler.cc ('k') | content/browser/loader/navigation_url_loader_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698