| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BUFFERED_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 net::URLRequest* request); | 30 net::URLRequest* request); |
| 31 virtual ~BufferedResourceHandler(); | 31 virtual ~BufferedResourceHandler(); |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 // ResourceHandler implementation: | 34 // ResourceHandler implementation: |
| 35 virtual void SetController(ResourceController* controller) OVERRIDE; | 35 virtual void SetController(ResourceController* controller) OVERRIDE; |
| 36 virtual bool OnResponseStarted(int request_id, | 36 virtual bool OnResponseStarted(int request_id, |
| 37 ResourceResponse* response, | 37 ResourceResponse* response, |
| 38 bool* defer) OVERRIDE; | 38 bool* defer) OVERRIDE; |
| 39 virtual bool OnWillRead(int request_id, | 39 virtual bool OnWillRead(int request_id, |
| 40 scoped_refptr<net::IOBuffer>* buf, | 40 net::IOBuffer** buf, |
| 41 int* buf_size, | 41 int* buf_size, |
| 42 int min_size) OVERRIDE; | 42 int min_size) OVERRIDE; |
| 43 virtual bool OnReadCompleted(int request_id, int bytes_read, | 43 virtual bool OnReadCompleted(int request_id, int bytes_read, |
| 44 bool* defer) OVERRIDE; | 44 bool* defer) OVERRIDE; |
| 45 virtual bool OnResponseCompleted(int request_id, | 45 virtual bool OnResponseCompleted(int request_id, |
| 46 const net::URLRequestStatus& status, | 46 const net::URLRequestStatus& status, |
| 47 const std::string& security_info) OVERRIDE; | 47 const std::string& security_info) OVERRIDE; |
| 48 | 48 |
| 49 // ResourceController implementation: | 49 // ResourceController implementation: |
| 50 virtual void Resume() OVERRIDE; | 50 virtual void Resume() OVERRIDE; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // OnReadCompleted) to the downstream ResourceHandler. | 88 // OnReadCompleted) to the downstream ResourceHandler. |
| 89 STATE_REPLAYING, | 89 STATE_REPLAYING, |
| 90 | 90 |
| 91 // In this state, we are just a blind pass-through ResourceHandler. | 91 // In this state, we are just a blind pass-through ResourceHandler. |
| 92 STATE_STREAMING | 92 STATE_STREAMING |
| 93 }; | 93 }; |
| 94 State state_; | 94 State state_; |
| 95 | 95 |
| 96 scoped_refptr<ResourceResponse> response_; | 96 scoped_refptr<ResourceResponse> response_; |
| 97 ResourceDispatcherHostImpl* host_; | 97 ResourceDispatcherHostImpl* host_; |
| 98 net::URLRequest* request_; |
| 98 scoped_refptr<net::IOBuffer> read_buffer_; | 99 scoped_refptr<net::IOBuffer> read_buffer_; |
| 99 int read_buffer_size_; | 100 int read_buffer_size_; |
| 100 int bytes_read_; | 101 int bytes_read_; |
| 101 | 102 |
| 102 bool must_download_; | 103 bool must_download_; |
| 103 bool must_download_is_set_; | 104 bool must_download_is_set_; |
| 104 | 105 |
| 105 base::WeakPtrFactory<BufferedResourceHandler> weak_ptr_factory_; | 106 base::WeakPtrFactory<BufferedResourceHandler> weak_ptr_factory_; |
| 106 | 107 |
| 107 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); | 108 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 } // namespace content | 111 } // namespace content |
| 111 | 112 |
| 112 #endif // CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ | 113 #endif // CONTENT_BROWSER_LOADER_BUFFERED_RESOURCE_HANDLER_H_ |
| OLD | NEW |