| OLD | NEW |
| 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" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 const net::RedirectInfo& redirect_info, | 31 const net::RedirectInfo& redirect_info, |
| 32 const scoped_refptr<ResourceResponse>& response) = 0; | 32 const scoped_refptr<ResourceResponse>& response) = 0; |
| 33 | 33 |
| 34 // Called when the request receives its response. No further calls will be | 34 // 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 | 35 // made to the delegate. The response body is returned as a stream in |
| 36 // |body_stream|. |navigation_data| is passed to the NavigationHandle. | 36 // |body_stream|. |navigation_data| is passed to the NavigationHandle. |
| 37 virtual void OnResponseStarted( | 37 virtual void OnResponseStarted( |
| 38 const scoped_refptr<ResourceResponse>& response, | 38 const scoped_refptr<ResourceResponse>& response, |
| 39 std::unique_ptr<StreamHandle> body_stream, | 39 std::unique_ptr<StreamHandle> body_stream, |
| 40 const SSLStatus& ssl_status, | 40 const SSLStatus& ssl_status, |
| 41 std::unique_ptr<NavigationData> navigation_data) = 0; | 41 std::unique_ptr<NavigationData> navigation_data, |
| 42 bool is_download) = 0; |
| 42 | 43 |
| 43 // Called if the request fails before receving a response. |net_error| is a | 44 // 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 | 45 // 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. | 46 // 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; | 47 virtual void OnRequestFailed(bool has_stale_copy_in_cache, int net_error) = 0; |
| 47 | 48 |
| 48 // Called after the network request has begun on the IO thread at time | 49 // 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 | 50 // |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 | 51 // against the pre-PlzNavigate codepath which didn't start the network request |
| 51 // until after the renderer was initialized. | 52 // until after the renderer was initialized. |
| 52 virtual void OnRequestStarted(base::TimeTicks timestamp) = 0; | 53 virtual void OnRequestStarted(base::TimeTicks timestamp) = 0; |
| 53 | 54 |
| 54 protected: | 55 protected: |
| 55 NavigationURLLoaderDelegate() {} | 56 NavigationURLLoaderDelegate() {} |
| 56 virtual ~NavigationURLLoaderDelegate() {} | 57 virtual ~NavigationURLLoaderDelegate() {} |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderDelegate); | 60 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderDelegate); |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 } // namespace content | 63 } // namespace content |
| 63 | 64 |
| 64 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_ | 65 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_DELEGATE_H_ |
| OLD | NEW |