OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/renderer_host/resource_handler.h" | 10 #include "chrome/browser/renderer_host/resource_handler.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 bool ShouldWaitForPlugins(); | 55 bool ShouldWaitForPlugins(); |
56 | 56 |
57 // A test to determining whether the request should be forwarded to the | 57 // A test to determining whether the request should be forwarded to the |
58 // download thread. If need_plugin_list was passed in and was set to true, | 58 // download thread. If need_plugin_list was passed in and was set to true, |
59 // that means that the check couldn't be fully done because the plugins aren't | 59 // that means that the check couldn't be fully done because the plugins aren't |
60 // loaded. The function should be called again after the plugin list is | 60 // loaded. The function should be called again after the plugin list is |
61 // loaded. | 61 // loaded. |
62 bool ShouldDownload(bool* need_plugin_list); | 62 bool ShouldDownload(bool* need_plugin_list); |
63 | 63 |
64 // Called on the file thread to load the list of plugins. | 64 // Called on the file thread to load the list of plugins. |
65 static void LoadPlugins(BufferedResourceHandler* handler, | 65 static void LoadPlugins(BufferedResourceHandler* handler); |
66 MessageLoop* main_message_loop); | |
67 | |
68 // Runs on the main thread to notify the IO thread that plugins have been | |
69 // loaded. This is needed since the file thread outlives the IO thread. | |
70 static void NotifyPluginsLoaded(BufferedResourceHandler* handler); | |
71 | 66 |
72 // Called on the IO thread once the list of plugins has been loaded. | 67 // Called on the IO thread once the list of plugins has been loaded. |
73 void OnPluginsLoaded(); | 68 static void OnPluginsLoaded(BufferedResourceHandler* handler); |
74 | 69 |
75 scoped_refptr<ResourceHandler> real_handler_; | 70 scoped_refptr<ResourceHandler> real_handler_; |
76 scoped_refptr<ResourceResponse> response_; | 71 scoped_refptr<ResourceResponse> response_; |
77 ResourceDispatcherHost* host_; | 72 ResourceDispatcherHost* host_; |
78 URLRequest* request_; | 73 URLRequest* request_; |
79 scoped_refptr<net::IOBuffer> read_buffer_; | 74 scoped_refptr<net::IOBuffer> read_buffer_; |
80 scoped_refptr<net::IOBuffer> my_buffer_; | 75 scoped_refptr<net::IOBuffer> my_buffer_; |
81 int read_buffer_size_; | 76 int read_buffer_size_; |
82 int bytes_read_; | 77 int bytes_read_; |
83 bool sniff_content_; | 78 bool sniff_content_; |
84 bool should_buffer_; | 79 bool should_buffer_; |
85 bool wait_for_plugins_; | 80 bool wait_for_plugins_; |
86 bool buffering_; | 81 bool buffering_; |
87 bool finished_; | 82 bool finished_; |
88 | 83 |
89 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); | 84 DISALLOW_COPY_AND_ASSIGN(BufferedResourceHandler); |
90 }; | 85 }; |
91 | 86 |
92 #endif // CHROME_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ | 87 #endif // CHROME_BROWSER_RENDERER_HOST_BUFFERED_RESOURCE_HANDLER_H_ |
OLD | NEW |