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

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

Issue 648813002: PlzNavigate: Add first version of NavigationURLLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@plz-navigate-prepare
Patch Set: nasko and mmenke comments Created 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_
6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/common/content_export.h"
11
12 namespace net {
13 struct RedirectInfo;
14 }
15
16 namespace content {
17
18 class StreamHandle;
19 struct ResourceResponse;
20
21 // PlzNavigate: The delegate interface to NavigationURLLoader.
22 class CONTENT_EXPORT NavigationURLLoaderDelegate {
23 public:
24 // Called when the request is redirected. Call FollowRedirect to continue
25 // processing the request.
26 virtual void OnRequestRedirected(const net::RedirectInfo& redirect_info,
27 ResourceResponse* response) = 0;
mmenke 2014/10/28 16:05:39 Suggest making this a "const scoped_refptr&". Tha
davidben 2014/10/29 19:10:34 Done. At least within loader/.
28
29 // Called when the request receives its response. No further calls will be
30 // made to the delegate. The response body is returned as a stream in
31 // |body|.
32 virtual void OnResponseStarted(ResourceResponse* response,
33 scoped_ptr<StreamHandle> body) = 0;
mmenke 2014/10/28 16:05:39 nit: Maybe body_stream? Or body_blob? Or bloby_
davidben 2014/10/29 19:10:33 *shrug* I feel like body is pretty descriptive. St
mmenke 2014/10/29 19:44:46 I dunno... I see a test mucking with something ca
davidben 2014/10/29 19:46:54 Yeah, that a StreamHandle requires a URLRequest to
34
35 // Called if the request fails before receving a response. |net_error| is a
36 // network error code for the failure.
37 virtual void OnRequestFailed(int net_error) = 0;
38
39 protected:
40 NavigationURLLoaderDelegate() {}
41 virtual ~NavigationURLLoaderDelegate() {}
42
43 private:
44 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderDelegate);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698