Chromium Code Reviews| OLD | NEW |
|---|---|
| (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; | |
|
nasko
2014/10/23 22:36:16
nit: empty line between the methods
davidben
2014/10/27 20:46:04
Done.
| |
| 28 // Called when the request receives its response. No further calls will be | |
| 29 // made to the delegate. The response body is returned as a stream in | |
| 30 // |body|. | |
| 31 virtual void OnResponseStarted(ResourceResponse* response, | |
| 32 scoped_ptr<StreamHandle> body) = 0; | |
| 33 | |
| 34 // Called if the request fails before receving a response. |net_error| is a | |
| 35 // network error code for the failure. | |
| 36 virtual void OnRequestFailed(int net_error) = 0; | |
| 37 | |
| 38 protected: | |
| 39 NavigationURLLoaderDelegate() {} | |
| 40 virtual ~NavigationURLLoaderDelegate() {} | |
| 41 | |
| 42 private: | |
| 43 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderDelegate); | |
| 44 }; | |
| 45 | |
| 46 } // namespace content | |
| 47 | |
| 48 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_ | |
| OLD | NEW |