Chromium Code Reviews| Index: content/renderer/render_thread.cc |
| diff --git a/content/renderer/render_thread.cc b/content/renderer/render_thread.cc |
| index 81caa2d8d084a98ab7b95d1c93d250a76718779e..c482c9ee84592d90a2afec2a8835bc15157eabab 100644 |
| --- a/content/renderer/render_thread.cc |
| +++ b/content/renderer/render_thread.cc |
| @@ -21,12 +21,16 @@ |
| #include "base/task.h" |
| #include "base/threading/thread_local.h" |
| #include "base/values.h" |
| +#include "chrome/common/render_messages.h" |
|
jam
2011/07/21 16:35:27
also, code in content can't include code in chrome
Greg Billock
2011/07/21 19:10:01
Is there a lint or presubmit to run that detects t
jam
2011/07/22 16:31:50
there's tools\checkdeps\checkdeps.py. We don't run
Greg Billock
2011/07/22 17:02:07
cool. I did see the check_deps fail on the trybots
|
| #include "content/common/appcache/appcache_dispatcher.h" |
| +#include "content/common/content_notification_types.h" |
| #include "content/common/content_switches.h" |
| #include "content/common/database_messages.h" |
| #include "content/common/db_message_filter.h" |
| #include "content/common/dom_storage_messages.h" |
| #include "content/common/gpu/gpu_messages.h" |
| +#include "content/common/notification_service.h" |
| +#include "content/common/notification_source.h" |
| #include "content/common/plugin_messages.h" |
| #include "content/common/renderer_preferences.h" |
| #include "content/common/resource_messages.h" |
| @@ -411,6 +415,7 @@ bool RenderThread::OnControlMessageReceived(const IPC::Message& msg) { |
| // TODO(port): removed from render_messages_internal.h; |
| // is there a new non-windows message I should add here? |
| IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) |
| + IPC_MESSAGE_HANDLER(ViewMsg_PurgeMemory, OnPurgeMemory) |
| IPC_MESSAGE_HANDLER(ViewMsg_PurgePluginListCache, OnPurgePluginListCache) |
| IPC_MESSAGE_HANDLER(ViewMsg_NetworkStateChanged, OnNetworkStateChanged) |
| IPC_MESSAGE_HANDLER(DOMStorageMsg_Event, OnDOMStorageEvent) |
| @@ -677,6 +682,13 @@ void RenderThread::ScheduleIdleHandler(double initial_delay_s) { |
| this, &RenderThread::IdleHandler); |
| } |
| +void RenderThread::OnPurgeMemory() { |
| + NotificationService::current()->Notify( |
| + content::NOTIFICATION_PURGE_MEMORY, |
| + Source<void>(NULL), |
| + NotificationService::NoDetails()); |
| +} |
| + |
| void RenderThread::OnPurgePluginListCache(bool reload_pages) { |
| EnsureWebKitInitialized(); |
| // The call below will cause a GetPlugins call with refresh=true, but at this |