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 #include "chrome/renderer/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 void RenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) { | 90 void RenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) { |
91 channel()->RemoveFilter(filter); | 91 channel()->RemoveFilter(filter); |
92 } | 92 } |
93 | 93 |
94 void RenderThread::Resolve(const char* name, size_t length) { | 94 void RenderThread::Resolve(const char* name, size_t length) { |
95 return dns_master_->Resolve(name, length); | 95 return dns_master_->Resolve(name, length); |
96 } | 96 } |
97 | 97 |
98 void RenderThread::SendHistograms() { | 98 void RenderThread::SendHistograms(int sequence_number) { |
99 return histogram_snapshots_->SendHistograms(); | 99 return histogram_snapshots_->SendHistograms(sequence_number); |
100 } | 100 } |
101 | 101 |
102 static WebAppCacheContext* CreateAppCacheContextForRenderer() { | 102 static WebAppCacheContext* CreateAppCacheContextForRenderer() { |
103 return new AppCacheContextImpl(RenderThread::current()); | 103 return new AppCacheContextImpl(RenderThread::current()); |
104 } | 104 } |
105 | 105 |
106 #if defined(OS_POSIX) | 106 #if defined(OS_POSIX) |
107 class SuicideOnChannelErrorFilter : public IPC::ChannelProxy::MessageFilter { | 107 class SuicideOnChannelErrorFilter : public IPC::ChannelProxy::MessageFilter { |
108 void OnChannelError() { | 108 void OnChannelError() { |
109 // On POSIX, at least, one can install an unload handler which loops | 109 // On POSIX, at least, one can install an unload handler which loops |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 return; | 205 return; |
206 | 206 |
207 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) | 207 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) |
208 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks) | 208 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks) |
209 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) | 209 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) |
210 // TODO(port): removed from render_messages_internal.h; | 210 // TODO(port): removed from render_messages_internal.h; |
211 // is there a new non-windows message I should add here? | 211 // is there a new non-windows message I should add here? |
212 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) | 212 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) |
213 IPC_MESSAGE_HANDLER(ViewMsg_SetCacheCapacities, OnSetCacheCapacities) | 213 IPC_MESSAGE_HANDLER(ViewMsg_SetCacheCapacities, OnSetCacheCapacities) |
214 IPC_MESSAGE_HANDLER(ViewMsg_GetRendererHistograms, | 214 IPC_MESSAGE_HANDLER(ViewMsg_GetRendererHistograms, |
215 OnGetRendererHistograms) | 215 OnGetRendererHistograms) |
216 IPC_MESSAGE_HANDLER(ViewMsg_GetCacheResourceStats, | 216 IPC_MESSAGE_HANDLER(ViewMsg_GetCacheResourceStats, |
217 OnGetCacheResourceStats) | 217 OnGetCacheResourceStats) |
218 IPC_MESSAGE_HANDLER(ViewMsg_UserScripts_UpdatedScripts, | 218 IPC_MESSAGE_HANDLER(ViewMsg_UserScripts_UpdatedScripts, |
219 OnUpdateUserScripts) | 219 OnUpdateUserScripts) |
220 // TODO(rafaelw): create an ExtensionDispatcher that handles extension | 220 // TODO(rafaelw): create an ExtensionDispatcher that handles extension |
221 // messages seperates their handling from the RenderThread. | 221 // messages seperates their handling from the RenderThread. |
222 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionHandleConnect, | 222 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionHandleConnect, |
223 OnExtensionHandleConnect) | 223 OnExtensionHandleConnect) |
224 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionHandleMessage, | 224 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionHandleMessage, |
225 OnExtensionHandleMessage) | 225 OnExtensionHandleMessage) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 min_dead_capacity, max_dead_capacity, capacity); | 267 min_dead_capacity, max_dead_capacity, capacity); |
268 } | 268 } |
269 | 269 |
270 void RenderThread::OnGetCacheResourceStats() { | 270 void RenderThread::OnGetCacheResourceStats() { |
271 EnsureWebKitInitialized(); | 271 EnsureWebKitInitialized(); |
272 WebCache::ResourceTypeStats stats; | 272 WebCache::ResourceTypeStats stats; |
273 WebCache::getResourceTypeStats(&stats); | 273 WebCache::getResourceTypeStats(&stats); |
274 Send(new ViewHostMsg_ResourceTypeStats(stats)); | 274 Send(new ViewHostMsg_ResourceTypeStats(stats)); |
275 } | 275 } |
276 | 276 |
277 void RenderThread::OnGetRendererHistograms() { | 277 void RenderThread::OnGetRendererHistograms(int sequence_number) { |
278 SendHistograms(); | 278 SendHistograms(sequence_number); |
279 } | 279 } |
280 | 280 |
281 void RenderThread::InformHostOfCacheStats() { | 281 void RenderThread::InformHostOfCacheStats() { |
282 EnsureWebKitInitialized(); | 282 EnsureWebKitInitialized(); |
283 WebCache::UsageStats stats; | 283 WebCache::UsageStats stats; |
284 WebCache::getUsageStats(&stats); | 284 WebCache::getUsageStats(&stats); |
285 Send(new ViewHostMsg_UpdatedCacheStats(stats)); | 285 Send(new ViewHostMsg_UpdatedCacheStats(stats)); |
286 } | 286 } |
287 | 287 |
288 void RenderThread::InformHostOfCacheStatsLater() { | 288 void RenderThread::InformHostOfCacheStatsLater() { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 | 381 |
382 void RenderThread::OnPurgePluginListCache() { | 382 void RenderThread::OnPurgePluginListCache() { |
383 // The call below will cause a GetPlugins call with refresh=true, but at this | 383 // The call below will cause a GetPlugins call with refresh=true, but at this |
384 // point we already know that the browser has refreshed its list, so disable | 384 // point we already know that the browser has refreshed its list, so disable |
385 // refresh temporarily to prevent each renderer process causing the list to be | 385 // refresh temporarily to prevent each renderer process causing the list to be |
386 // regenerated. | 386 // regenerated. |
387 plugin_refresh_allowed_ = false; | 387 plugin_refresh_allowed_ = false; |
388 WebKit::resetPluginCache(); | 388 WebKit::resetPluginCache(); |
389 plugin_refresh_allowed_ = true; | 389 plugin_refresh_allowed_ = true; |
390 } | 390 } |
OLD | NEW |