| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 BufferedResourceHandler(ResourceHandler* handler, | 26 BufferedResourceHandler(ResourceHandler* handler, |
| 27 ResourceDispatcherHost* host, | 27 ResourceDispatcherHost* host, |
| 28 net::URLRequest* request); | 28 net::URLRequest* request); |
| 29 | 29 |
| 30 // ResourceHandler implementation: | 30 // ResourceHandler implementation: |
| 31 virtual bool OnUploadProgress(int request_id, | 31 virtual bool OnUploadProgress(int request_id, |
| 32 uint64 position, | 32 uint64 position, |
| 33 uint64 size) OVERRIDE; | 33 uint64 size) OVERRIDE; |
| 34 virtual bool OnRequestRedirected(int request_id, | 34 virtual bool OnRequestRedirected(int request_id, |
| 35 const GURL& new_url, | 35 const GURL& new_url, |
| 36 ResourceResponse* response, | 36 content::ResourceResponse* response, |
| 37 bool* defer) OVERRIDE; | 37 bool* defer) OVERRIDE; |
| 38 virtual bool OnResponseStarted(int request_id, | 38 virtual bool OnResponseStarted(int request_id, |
| 39 ResourceResponse* response) OVERRIDE; | 39 content::ResourceResponse* response) OVERRIDE; |
| 40 virtual bool OnWillStart(int request_id, | 40 virtual bool OnWillStart(int request_id, |
| 41 const GURL& url, | 41 const GURL& url, |
| 42 bool* defer) OVERRIDE; | 42 bool* defer) OVERRIDE; |
| 43 virtual bool OnWillRead(int request_id, | 43 virtual bool OnWillRead(int request_id, |
| 44 net::IOBuffer** buf, | 44 net::IOBuffer** buf, |
| 45 int* buf_size, | 45 int* buf_size, |
| 46 int min_size) OVERRIDE; | 46 int min_size) OVERRIDE; |
| 47 virtual bool OnReadCompleted(int request_id, int* bytes_read) OVERRIDE; | 47 virtual bool OnReadCompleted(int request_id, int* bytes_read) OVERRIDE; |
| 48 virtual bool OnResponseCompleted(int request_id, | 48 virtual bool OnResponseCompleted(int request_id, |
| 49 const net::URLRequestStatus& status, | 49 const net::URLRequestStatus& status, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 78 | 78 |
| 79 // Informs the original ResourceHandler |real_handler_| that the response will | 79 // Informs the original ResourceHandler |real_handler_| that the response will |
| 80 // be handled entirely by the new ResourceHandler |handler|. | 80 // be handled entirely by the new ResourceHandler |handler|. |
| 81 // A reference to |handler| is acquired. | 81 // A reference to |handler| is acquired. |
| 82 void UseAlternateResourceHandler(int request_id, ResourceHandler* handler); | 82 void UseAlternateResourceHandler(int request_id, ResourceHandler* handler); |
| 83 | 83 |
| 84 // Called on the IO thread once the list of plugins has been loaded. | 84 // Called on the IO thread once the list of plugins has been loaded. |
| 85 void OnPluginsLoaded(const std::vector<webkit::WebPluginInfo>& plugins); | 85 void OnPluginsLoaded(const std::vector<webkit::WebPluginInfo>& plugins); |
| 86 | 86 |
| 87 scoped_refptr<ResourceHandler> real_handler_; | 87 scoped_refptr<ResourceHandler> real_handler_; |
| 88 scoped_refptr<ResourceResponse> response_; | 88 scoped_refptr<content::ResourceResponse> response_; |
| 89 ResourceDispatcherHost* host_; | 89 ResourceDispatcherHost* host_; |
| 90 net::URLRequest* request_; | 90 net::URLRequest* request_; |
| 91 scoped_refptr<net::IOBuffer> read_buffer_; | 91 scoped_refptr<net::IOBuffer> read_buffer_; |
| 92 scoped_refptr<net::IOBuffer> my_buffer_; | 92 scoped_refptr<net::IOBuffer> my_buffer_; |
| 93 int read_buffer_size_; | 93 int read_buffer_size_; |
| 94 int bytes_read_; | 94 int bytes_read_; |
| 95 bool sniff_content_; | 95 bool sniff_content_; |
| 96 bool wait_for_plugins_; | 96 bool wait_for_plugins_; |
| 97 bool buffering_; | 97 bool buffering_; |
| 98 bool finished_; | 98 bool finished_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); | 100 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif // CONTENT_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ | 103 #endif // CONTENT_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ |
| OLD | NEW |