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_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/browser/loader/resource_handler.h" |
| 11 #include "content/browser/loader/stream_writer.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class NavigationURLLoaderCore; |
| 16 |
| 17 // The leaf ResourceHandler used with NavigationURLLoaderCore. |
| 18 class NavigationResourceHandler : public ResourceHandler { |
| 19 public: |
| 20 NavigationResourceHandler(net::URLRequest* request, |
| 21 NavigationURLLoaderCore* core); |
| 22 virtual ~NavigationResourceHandler(); |
| 23 |
| 24 // Called by the loader the cancel the request. |
| 25 void Cancel(); |
| 26 |
| 27 // Called to the loader to resume a paused redirect. |
| 28 void FollowRedirect(); |
| 29 |
| 30 // ResourceHandler implementation. |
| 31 virtual void SetController(ResourceController* controller) OVERRIDE; |
| 32 |
| 33 virtual bool OnUploadProgress(uint64 position, uint64 size) OVERRIDE; |
| 34 |
| 35 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
| 36 ResourceResponse* response, |
| 37 bool* defer) OVERRIDE; |
| 38 |
| 39 virtual bool OnResponseStarted(ResourceResponse* response, |
| 40 bool* defer) OVERRIDE; |
| 41 |
| 42 virtual bool OnWillStart(const GURL& url, bool* defer) OVERRIDE; |
| 43 |
| 44 virtual bool OnBeforeNetworkStart(const GURL& url, bool* defer) OVERRIDE; |
| 45 |
| 46 virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
| 47 int* buf_size, |
| 48 int min_size) OVERRIDE; |
| 49 |
| 50 virtual bool OnReadCompleted(int bytes_read, bool* defer) OVERRIDE; |
| 51 |
| 52 virtual void OnResponseCompleted(const net::URLRequestStatus& status, |
| 53 const std::string& security_info, |
| 54 bool* defer) OVERRIDE; |
| 55 |
| 56 virtual void OnDataDownloaded(int bytes_downloaded) OVERRIDE; |
| 57 |
| 58 private: |
| 59 scoped_refptr<NavigationURLLoaderCore> core_; |
| 60 StreamWriter writer_; |
| 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(NavigationResourceHandler); |
| 63 }; |
| 64 |
| 65 } // namespace content |
| 66 |
| 67 #endif // CONTENT_BROWSER_LOADER_CERTIFICATE_RESOURCE_HANDLER_H_ |
OLD | NEW |