| 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_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/browser/loader/resource_handler.h" | 9 #include "content/browser/loader/resource_handler.h" |
| 10 #include "content/browser/loader/stream_writer.h" | 10 #include "content/browser/loader/stream_writer.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 class NavigationURLLoaderImplCore; | 14 class NavigationURLLoaderImplCore; |
| 15 | 15 |
| 16 // PlzNavigate: The leaf ResourceHandler used with NavigationURLLoaderImplCore. | 16 // PlzNavigate: The leaf ResourceHandler used with NavigationURLLoaderImplCore. |
| 17 class NavigationResourceHandler : public ResourceHandler { | 17 class NavigationResourceHandler : public ResourceHandler { |
| 18 public: | 18 public: |
| 19 NavigationResourceHandler(net::URLRequest* request, | 19 NavigationResourceHandler(net::URLRequest* request, |
| 20 NavigationURLLoaderImplCore* core); | 20 NavigationURLLoaderImplCore* core); |
| 21 ~NavigationResourceHandler() override; | 21 ~NavigationResourceHandler() override; |
| 22 | 22 |
| 23 // Called by the loader the cancel the request. | 23 // Called by the loader the cancel the request. |
| 24 void Cancel(); | 24 void Cancel(); |
| 25 | 25 |
| 26 // Called to the loader to resume a paused redirect. | 26 // Called to the loader to resume a paused redirect. |
| 27 void FollowRedirect(); | 27 void FollowRedirect(); |
| 28 | 28 |
| 29 // Called to proceed with the response. |
| 30 void ProceedWithResponse(); |
| 31 |
| 29 // ResourceHandler implementation. | 32 // ResourceHandler implementation. |
| 30 void SetController(ResourceController* controller) override; | 33 void SetController(ResourceController* controller) override; |
| 31 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 34 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
| 32 ResourceResponse* response, | 35 ResourceResponse* response, |
| 33 bool* defer) override; | 36 bool* defer) override; |
| 34 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; | 37 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; |
| 35 bool OnWillStart(const GURL& url, bool* defer) override; | 38 bool OnWillStart(const GURL& url, bool* defer) override; |
| 36 bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; | 39 bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; |
| 37 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 40 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
| 38 int* buf_size, | 41 int* buf_size, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 50 | 53 |
| 51 NavigationURLLoaderImplCore* core_; | 54 NavigationURLLoaderImplCore* core_; |
| 52 StreamWriter writer_; | 55 StreamWriter writer_; |
| 53 | 56 |
| 54 DISALLOW_COPY_AND_ASSIGN(NavigationResourceHandler); | 57 DISALLOW_COPY_AND_ASSIGN(NavigationResourceHandler); |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 } // namespace content | 60 } // namespace content |
| 58 | 61 |
| 59 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ | 62 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ |
| OLD | NEW |