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

Unified Diff: chrome/renderer/chrome_content_renderer_client.h

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: Fix constructor 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
Index: chrome/renderer/chrome_content_renderer_client.h
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
index ad629bd7abeee5c0bcd6e2bc7b33dd97373138fc..ec3ba90d9dbc1c4cdf5c10c8b3730714bbf67576 100644
--- a/chrome/renderer/chrome_content_renderer_client.h
+++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -8,6 +8,8 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "content/common/notification_observer.h"
+#include "content/common/notification_registrar.h"
#include "content/renderer/content_renderer_client.h"
class ChromeRenderProcessObserver;
@@ -15,6 +17,7 @@ class ExtensionDispatcher;
class RendererHistogramSnapshots;
class RendererNetPredictor;
class SpellCheck;
+class SpellCheckProvider;
class VisitedLinkSlave;
namespace safe_browsing {
@@ -29,7 +32,8 @@ class PluginGroup;
namespace chrome {
-class ChromeContentRendererClient : public content::ContentRendererClient {
+class ChromeContentRendererClient : public content::ContentRendererClient,
+ public NotificationObserver {
public:
ChromeContentRendererClient();
virtual ~ChromeContentRendererClient();
@@ -73,6 +77,15 @@ class ChromeContentRendererClient : public content::ContentRendererClient {
// For testing.
void SetExtensionDispatcher(ExtensionDispatcher* extension_dispatcher);
+ // NotificationObserver
+ void Observe(int type,
+ const NotificationSource& source,
+ const NotificationDetails& details) OVERRIDE;
+
+ // Called in low-memory conditions to dump the memory used by the spellchecker
+ // and start over.
+ void ResetSpellCheck();
+
private:
WebKit::WebPlugin* CreatePluginPlaceholder(
RenderView* render_view,
@@ -93,8 +106,11 @@ class ChromeContentRendererClient : public content::ContentRendererClient {
scoped_ptr<RendererHistogramSnapshots> histogram_snapshots_;
scoped_ptr<RendererNetPredictor> net_predictor_;
scoped_ptr<SpellCheck> spellcheck_;
+ scoped_ptr<SpellCheckProvider> spellcheck_provider_;
scoped_ptr<VisitedLinkSlave> visited_link_slave_;
scoped_ptr<safe_browsing::PhishingClassifierFilter> phishing_classifier_;
+
+ NotificationRegistrar registrar_;
};
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698