Chromium Code Reviews| 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 |
| 11 #include "content/browser/renderer_host/resource_handler.h" | 11 #include "content/browser/renderer_host/resource_handler.h" |
| 12 #include "webkit/plugins/webplugininfo.h" | |
|
jam
2011/09/21 00:04:51
nit: forward declare
| |
| 12 | 13 |
| 13 class MessageLoop; | 14 class MessageLoop; |
| 14 class ResourceDispatcherHost; | 15 class ResourceDispatcherHost; |
| 15 | 16 |
| 16 namespace net { | 17 namespace net { |
| 17 class URLRequest; | 18 class URLRequest; |
| 18 } // namespace net | 19 } // namespace net |
| 19 | 20 |
| 20 // Used to buffer a request until enough data has been received. | 21 // Used to buffer a request until enough data has been received. |
| 21 class BufferedResourceHandler : public ResourceHandler { | 22 class BufferedResourceHandler : public ResourceHandler { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 // that means that the check couldn't be fully done because the plugins aren't | 63 // that means that the check couldn't be fully done because the plugins aren't |
| 63 // loaded. The function should be called again after the plugin list is | 64 // loaded. The function should be called again after the plugin list is |
| 64 // loaded. | 65 // loaded. |
| 65 bool ShouldDownload(bool* need_plugin_list); | 66 bool ShouldDownload(bool* need_plugin_list); |
| 66 | 67 |
| 67 // Informs the original ResourceHandler |real_handler_| that the response will | 68 // Informs the original ResourceHandler |real_handler_| that the response will |
| 68 // be handled entirely by the new ResourceHandler |handler|. | 69 // be handled entirely by the new ResourceHandler |handler|. |
| 69 // A reference to |handler| is acquired. | 70 // A reference to |handler| is acquired. |
| 70 void UseAlternateResourceHandler(int request_id, ResourceHandler* handler); | 71 void UseAlternateResourceHandler(int request_id, ResourceHandler* handler); |
| 71 | 72 |
| 72 // Called on the file thread to load the list of plugins. | |
| 73 void LoadPlugins(); | |
| 74 | |
| 75 // Called on the IO thread once the list of plugins has been loaded. | 73 // Called on the IO thread once the list of plugins has been loaded. |
| 76 void OnPluginsLoaded(); | 74 void OnPluginsLoaded(std::vector<webkit::WebPluginInfo> plugins); |
|
jam
2011/09/21 00:04:51
nit: const reference
| |
| 77 | 75 |
| 78 scoped_refptr<ResourceHandler> real_handler_; | 76 scoped_refptr<ResourceHandler> real_handler_; |
| 79 scoped_refptr<ResourceResponse> response_; | 77 scoped_refptr<ResourceResponse> response_; |
| 80 ResourceDispatcherHost* host_; | 78 ResourceDispatcherHost* host_; |
| 81 net::URLRequest* request_; | 79 net::URLRequest* request_; |
| 82 scoped_refptr<net::IOBuffer> read_buffer_; | 80 scoped_refptr<net::IOBuffer> read_buffer_; |
| 83 scoped_refptr<net::IOBuffer> my_buffer_; | 81 scoped_refptr<net::IOBuffer> my_buffer_; |
| 84 int read_buffer_size_; | 82 int read_buffer_size_; |
| 85 int bytes_read_; | 83 int bytes_read_; |
| 86 bool sniff_content_; | 84 bool sniff_content_; |
| 87 bool wait_for_plugins_; | 85 bool wait_for_plugins_; |
| 88 bool buffering_; | 86 bool buffering_; |
| 89 bool finished_; | 87 bool finished_; |
| 90 | 88 |
| 91 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); | 89 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); |
| 92 }; | 90 }; |
| 93 | 91 |
| 94 #endif // CONTENT_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ | 92 #endif // CONTENT_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ |
| OLD | NEW |