OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_RENDERER_RENDER_THREAD_H_ | 5 #ifndef CHROME_RENDERER_RENDER_THREAD_H_ |
6 #define CHROME_RENDERER_RENDER_THREAD_H_ | 6 #define CHROME_RENDERER_RENDER_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 struct ContentSettings; | 45 struct ContentSettings; |
46 struct RendererPreferences; | 46 struct RendererPreferences; |
47 struct DOMStorageMsg_Event_Params; | 47 struct DOMStorageMsg_Event_Params; |
48 struct ViewMsg_ExtensionLoaded_Params; | 48 struct ViewMsg_ExtensionLoaded_Params; |
49 struct ViewMsg_New_Params; | 49 struct ViewMsg_New_Params; |
50 struct WebPreferences; | 50 struct WebPreferences; |
51 | 51 |
52 namespace base { | 52 namespace base { |
53 class MessageLoopProxy; | 53 class MessageLoopProxy; |
54 template<class T> class ScopedCallbackFactory; | |
55 class Thread; | 54 class Thread; |
56 } | 55 } |
57 | 56 |
58 namespace IPC { | 57 namespace IPC { |
59 struct ChannelHandle; | 58 struct ChannelHandle; |
60 } | 59 } |
61 | 60 |
62 namespace safe_browsing { | |
63 class Scorer; | |
64 } | |
65 | |
66 namespace WebKit { | 61 namespace WebKit { |
67 class WebStorageEventDispatcher; | 62 class WebStorageEventDispatcher; |
68 } | 63 } |
69 | 64 |
70 namespace v8 { | 65 namespace v8 { |
71 class Extension; | 66 class Extension; |
72 } | 67 } |
73 | 68 |
74 // The RenderThreadBase is the minimal interface that a RenderView/Widget | 69 // The RenderThreadBase is the minimal interface that a RenderView/Widget |
75 // expects from a render thread. The interface basically abstracts a way to send | 70 // expects from a render thread. The interface basically abstracts a way to send |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 189 } |
195 | 190 |
196 IndexedDBDispatcher* indexed_db_dispatcher() const { | 191 IndexedDBDispatcher* indexed_db_dispatcher() const { |
197 return indexed_db_dispatcher_.get(); | 192 return indexed_db_dispatcher_.get(); |
198 } | 193 } |
199 | 194 |
200 SpellCheck* spellchecker() const { | 195 SpellCheck* spellchecker() const { |
201 return spellchecker_.get(); | 196 return spellchecker_.get(); |
202 } | 197 } |
203 | 198 |
204 // Returns the phishing Scorer object, or NULL if a model has not been passed | |
205 // in from the browser yet. | |
206 const safe_browsing::Scorer* phishing_scorer() const { | |
207 return phishing_scorer_.get(); | |
208 } | |
209 | |
210 bool plugin_refresh_allowed() const { return plugin_refresh_allowed_; } | 199 bool plugin_refresh_allowed() const { return plugin_refresh_allowed_; } |
211 | 200 |
212 // Do DNS prefetch resolution of a hostname. | 201 // Do DNS prefetch resolution of a hostname. |
213 void Resolve(const char* name, size_t length); | 202 void Resolve(const char* name, size_t length); |
214 | 203 |
215 // Send all the Histogram data to browser. | 204 // Send all the Histogram data to browser. |
216 void SendHistograms(int sequence_number); | 205 void SendHistograms(int sequence_number); |
217 | 206 |
218 // Invokes InformHostOfCacheStats after a short delay. Used to move this | 207 // Invokes InformHostOfCacheStats after a short delay. Used to move this |
219 // bookkeeping operation off the critical latency path. | 208 // bookkeeping operation off the critical latency path. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 // A task we invoke periodically to assist with idle cleanup. | 328 // A task we invoke periodically to assist with idle cleanup. |
340 void IdleHandler(); | 329 void IdleHandler(); |
341 | 330 |
342 // Schedule a call to IdleHandler with the given initial delay. | 331 // Schedule a call to IdleHandler with the given initial delay. |
343 void ScheduleIdleHandler(double initial_delay_s); | 332 void ScheduleIdleHandler(double initial_delay_s); |
344 | 333 |
345 // Registers the given V8 extension with WebKit, and also tracks what pages | 334 // Registers the given V8 extension with WebKit, and also tracks what pages |
346 // it is allowed to run on. | 335 // it is allowed to run on. |
347 void RegisterExtension(v8::Extension* extension, bool restrict_to_extensions); | 336 void RegisterExtension(v8::Extension* extension, bool restrict_to_extensions); |
348 | 337 |
349 // Callback to be run once the phishing Scorer has been created. | |
350 void PhishingScorerCreated(safe_browsing::Scorer* scorer); | |
351 | |
352 // These objects live solely on the render thread. | 338 // These objects live solely on the render thread. |
353 scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > task_factory_; | 339 scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > task_factory_; |
354 scoped_ptr<base::ScopedCallbackFactory<RenderThread> > callback_factory_; | |
355 scoped_ptr<VisitedLinkSlave> visited_link_slave_; | 340 scoped_ptr<VisitedLinkSlave> visited_link_slave_; |
356 scoped_ptr<UserScriptSlave> user_script_slave_; | 341 scoped_ptr<UserScriptSlave> user_script_slave_; |
357 scoped_ptr<RendererNetPredictor> renderer_net_predictor_; | 342 scoped_ptr<RendererNetPredictor> renderer_net_predictor_; |
358 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; | 343 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; |
359 scoped_ptr<IndexedDBDispatcher> indexed_db_dispatcher_; | 344 scoped_ptr<IndexedDBDispatcher> indexed_db_dispatcher_; |
360 scoped_refptr<DevToolsAgentFilter> devtools_agent_filter_; | 345 scoped_refptr<DevToolsAgentFilter> devtools_agent_filter_; |
361 scoped_ptr<RendererHistogramSnapshots> histogram_snapshots_; | 346 scoped_ptr<RendererHistogramSnapshots> histogram_snapshots_; |
362 scoped_ptr<RendererWebKitClientImpl> webkit_client_; | 347 scoped_ptr<RendererWebKitClientImpl> webkit_client_; |
363 scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; | 348 scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; |
364 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; | 349 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; |
365 scoped_ptr<SpellCheck> spellchecker_; | 350 scoped_ptr<SpellCheck> spellchecker_; |
366 scoped_ptr<const safe_browsing::Scorer> phishing_scorer_; | |
367 | 351 |
368 // Used on the renderer and IPC threads. | 352 // Used on the renderer and IPC threads. |
369 scoped_refptr<DBMessageFilter> db_message_filter_; | 353 scoped_refptr<DBMessageFilter> db_message_filter_; |
370 scoped_refptr<CookieMessageFilter> cookie_message_filter_; | 354 scoped_refptr<CookieMessageFilter> cookie_message_filter_; |
371 | 355 |
372 #if defined(OS_POSIX) | 356 #if defined(OS_POSIX) |
373 scoped_refptr<IPC::ChannelProxy::MessageFilter> | 357 scoped_refptr<IPC::ChannelProxy::MessageFilter> |
374 suicide_on_channel_error_filter_; | 358 suicide_on_channel_error_filter_; |
375 #endif | 359 #endif |
376 | 360 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 // contexts. | 404 // contexts. |
421 std::map<std::string, bool> v8_extensions_; | 405 std::map<std::string, bool> v8_extensions_; |
422 | 406 |
423 // Contains all loaded extensions. | 407 // Contains all loaded extensions. |
424 ExtensionSet extensions_; | 408 ExtensionSet extensions_; |
425 | 409 |
426 DISALLOW_COPY_AND_ASSIGN(RenderThread); | 410 DISALLOW_COPY_AND_ASSIGN(RenderThread); |
427 }; | 411 }; |
428 | 412 |
429 #endif // CHROME_RENDERER_RENDER_THREAD_H_ | 413 #endif // CHROME_RENDERER_RENDER_THREAD_H_ |
OLD | NEW |