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

Unified Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 7222023: Forward handling of low-mem message to the content renderer client. Add APIs to handle this case. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Don't own SpellCheckProvider in renderer client. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/chrome_render_process_observer.h ('k') | chrome/renderer/spellchecker/spellcheck.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_render_process_observer.cc
diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc
index d221d89550c0bef5e94949c28b1a099dc67dc720..7805e7bf1197a337e6f321f6f25ebdfecf257a20 100644
--- a/chrome/renderer/chrome_render_process_observer.cc
+++ b/chrome/renderer/chrome_render_process_observer.cc
@@ -17,6 +17,7 @@
#include "chrome/common/extensions/extension_localization_peer.h"
#include "chrome/common/net/net_resource_provider.h"
#include "chrome/common/render_messages.h"
+#include "chrome/renderer/chrome_content_renderer_client.h"
#include "chrome/renderer/content_settings_observer.h"
#include "chrome/renderer/security_filter_peer.h"
#include "content/common/resource_dispatcher.h"
@@ -305,7 +306,9 @@ class ShutdownDetector : public base::PlatformThread::Delegate {
bool ChromeRenderProcessObserver::is_incognito_process_ = false;
-ChromeRenderProcessObserver::ChromeRenderProcessObserver() {
+ChromeRenderProcessObserver::ChromeRenderProcessObserver(
+ chrome::ChromeContentRendererClient* client)
+ : client_(client) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kEnableWatchdog)) {
// TODO(JAR): Need to implement renderer IO msgloop watchdog.
@@ -502,4 +505,7 @@ void ChromeRenderProcessObserver::OnPurgeMemory() {
// Tell tcmalloc to release any free pages it's still holding.
MallocExtension::instance()->ReleaseFreeMemory();
#endif
+
+ if (client_)
+ client_->OnPurgeMemory();
}
« no previous file with comments | « chrome/renderer/chrome_render_process_observer.h ('k') | chrome/renderer/spellchecker/spellcheck.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698