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

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: rebase 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/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/common/content_export.h"
12
13 namespace net {
14 struct RedirectInfo;
15 }
16
17 namespace content {
18
19 class StreamHandle;
20 struct ResourceResponse;
21
22 // PlzNavigate: The delegate interface to NavigationURLLoader.
23 class CONTENT_EXPORT NavigationURLLoaderDelegate {
24 public:
25 // Called when the request is redirected. Call FollowRedirect to continue
26 // processing the request.
27 virtual void OnRequestRedirected(
28 const net::RedirectInfo& redirect_info,
29 const scoped_refptr<ResourceResponse>& response) = 0;
30
31 // Called when the request receives its response. No further calls will be
32 // made to the delegate. The response body is returned as a stream in
33 // |body_stream|.
34 virtual void OnResponseStarted(
35 const scoped_refptr<ResourceResponse>& response,
36 scoped_ptr<StreamHandle> body_stream) = 0;
37
38 // Called if the request fails before receving a response. |net_error| is a
39 // network error code for the failure.
40 virtual void OnRequestFailed(int net_error) = 0;
41
42 protected:
43 NavigationURLLoaderDelegate() {}
44 virtual ~NavigationURLLoaderDelegate() {}
45
46 private:
47 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderDelegate);
48 };
49
50 } // namespace content
51
52 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_url_loader.cc ('k') | content/browser/loader/navigation_url_loader_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698