Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: chrome/renderer/render_thread.h

Issue 155944: Switch the first thread in a child process to be the main thread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/gfx/native_widget_types.h" 11 #include "base/gfx/native_widget_types.h"
12 #include "base/shared_memory.h" 12 #include "base/shared_memory.h"
13 #include "base/task.h" 13 #include "base/task.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "chrome/common/child_thread.h" 15 #include "chrome/common/child_thread.h"
16 #include "chrome/renderer/renderer_histogram_snapshots.h" 16 #include "chrome/renderer/renderer_histogram_snapshots.h"
17 #include "chrome/renderer/visitedlink_slave.h" 17 #include "chrome/renderer/visitedlink_slave.h"
18 18
19 class AppCacheDispatcher; 19 class AppCacheDispatcher;
20 class DevToolsAgentFilter; 20 class DevToolsAgentFilter;
21 class FilePath; 21 class FilePath;
22 class ListValue; 22 class ListValue;
23 class NotificationService; 23
24 class RenderDnsMaster; 24 class RenderDnsMaster;
25 class RendererHistogram; 25 class RendererHistogram;
26 class RendererWebKitClientImpl; 26 class RendererWebKitClientImpl;
27 class SkBitmap; 27 class SkBitmap;
28 class UserScriptSlave; 28 class UserScriptSlave;
29 struct ModalDialogEvent; 29 struct ModalDialogEvent;
30 struct RendererPreferences; 30 struct RendererPreferences;
31 struct WebPreferences; 31 struct WebPreferences;
32 32
33 // The RenderThreadBase is the minimal interface that a RenderView/Widget 33 // The RenderThreadBase is the minimal interface that a RenderView/Widget
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 // Sends a message to the browser to close all idle connections. 108 // Sends a message to the browser to close all idle connections.
109 void CloseIdleConnections(); 109 void CloseIdleConnections();
110 110
111 // Sends a message to the browser to enable or disable the disk cache. 111 // Sends a message to the browser to enable or disable the disk cache.
112 void SetCacheMode(bool enabled); 112 void SetCacheMode(bool enabled);
113 113
114 private: 114 private:
115 virtual void OnControlMessageReceived(const IPC::Message& msg); 115 virtual void OnControlMessageReceived(const IPC::Message& msg);
116 116
117 // Called by the thread base class. 117 void Init();
118 virtual void Init();
119 virtual void CleanUp();
120 118
121 void OnUpdateVisitedLinks(base::SharedMemoryHandle table); 119 void OnUpdateVisitedLinks(base::SharedMemoryHandle table);
122 void OnAddVisitedLinks(const VisitedLinkSlave::Fingerprints& fingerprints); 120 void OnAddVisitedLinks(const VisitedLinkSlave::Fingerprints& fingerprints);
123 void OnResetVisitedLinks(); 121 void OnResetVisitedLinks();
124 122
125 void OnUpdateUserScripts(base::SharedMemoryHandle table); 123 void OnUpdateUserScripts(base::SharedMemoryHandle table);
126 void OnSetExtensionFunctionNames(const std::vector<std::string>& names); 124 void OnSetExtensionFunctionNames(const std::vector<std::string>& names);
127 void OnPageActionsUpdated(const std::string& extension_id, 125 void OnPageActionsUpdated(const std::string& extension_id,
128 const std::vector<std::string>& page_actions); 126 const std::vector<std::string>& page_actions);
129 void OnSetNextPageID(int32 next_page_id); 127 void OnSetNextPageID(int32 next_page_id);
(...skipping 17 matching lines...) Expand all
147 145
148 // Gather usage statistics from the in-memory cache and inform our host. 146 // Gather usage statistics from the in-memory cache and inform our host.
149 // These functions should be call periodically so that the host can make 147 // These functions should be call periodically so that the host can make
150 // decisions about how to allocation resources using current information. 148 // decisions about how to allocation resources using current information.
151 void InformHostOfCacheStats(); 149 void InformHostOfCacheStats();
152 150
153 // We initialize WebKit as late as possible. 151 // We initialize WebKit as late as possible.
154 void EnsureWebKitInitialized(); 152 void EnsureWebKitInitialized();
155 153
156 // These objects live solely on the render thread. 154 // These objects live solely on the render thread.
155 scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > cache_stats_factory_;
157 scoped_ptr<VisitedLinkSlave> visited_link_slave_; 156 scoped_ptr<VisitedLinkSlave> visited_link_slave_;
158
159 scoped_ptr<UserScriptSlave> user_script_slave_; 157 scoped_ptr<UserScriptSlave> user_script_slave_;
160
161 scoped_ptr<RenderDnsMaster> dns_master_; 158 scoped_ptr<RenderDnsMaster> dns_master_;
162 159 scoped_ptr<AppCacheDispatcher> app_cache_dispatcher_;
160 scoped_refptr<DevToolsAgentFilter> devtools_agent_filter_;
163 scoped_ptr<RendererHistogramSnapshots> histogram_snapshots_; 161 scoped_ptr<RendererHistogramSnapshots> histogram_snapshots_;
164
165 scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > cache_stats_factory_;
166
167 scoped_ptr<NotificationService> notification_service_;
168
169 scoped_ptr<RendererWebKitClientImpl> webkit_client_; 162 scoped_ptr<RendererWebKitClientImpl> webkit_client_;
170 163
171 scoped_ptr<AppCacheDispatcher> app_cache_dispatcher_;
172
173 scoped_refptr<DevToolsAgentFilter> devtools_agent_filter_;
174
175 #if defined(OS_POSIX) 164 #if defined(OS_POSIX)
176 scoped_refptr<IPC::ChannelProxy::MessageFilter> 165 scoped_refptr<IPC::ChannelProxy::MessageFilter>
177 suicide_on_channel_error_filter_; 166 suicide_on_channel_error_filter_;
178 #endif 167 #endif
179 168
180 // If true, then a GetPlugins call is allowed to rescan the disk. 169 // If true, then a GetPlugins call is allowed to rescan the disk.
181 bool plugin_refresh_allowed_; 170 bool plugin_refresh_allowed_;
182 171
183 DISALLOW_COPY_AND_ASSIGN(RenderThread); 172 DISALLOW_COPY_AND_ASSIGN(RenderThread);
184 }; 173 };
185 174
186 #endif // CHROME_RENDERER_RENDER_THREAD_H_ 175 #endif // CHROME_RENDERER_RENDER_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698