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

Side by Side Diff: chrome/renderer/chrome_render_process_observer.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: Don't own SpellCheckProvider in renderer client. Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_CHROME_RENDER_PROCESS_OBSERVER_H_ 5 #ifndef CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_
6 #define CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ 6 #define CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "content/renderer/render_process_observer.h" 13 #include "content/renderer/render_process_observer.h"
14 14
15 namespace chrome {
16 class ChromeContentRendererClient;
17 }
18
15 class GURL; 19 class GURL;
16 class ResourceDispatcherDelegate; 20 class ResourceDispatcherDelegate;
17 struct ContentSettings; 21 struct ContentSettings;
18 22
19 // This class filters the incoming control messages (i.e. ones not destined for 23 // This class filters the incoming control messages (i.e. ones not destined for
20 // a RenderView) for Chrome specific messages that the content layer doesn't 24 // a RenderView) for Chrome specific messages that the content layer doesn't
21 // happen. If a few messages are related, they should probably have their own 25 // happen. If a few messages are related, they should probably have their own
22 // observer. 26 // observer.
23 class ChromeRenderProcessObserver : public RenderProcessObserver { 27 class ChromeRenderProcessObserver : public RenderProcessObserver {
24 public: 28 public:
25 ChromeRenderProcessObserver(); 29 explicit ChromeRenderProcessObserver(
30 chrome::ChromeContentRendererClient* client);
26 virtual ~ChromeRenderProcessObserver(); 31 virtual ~ChromeRenderProcessObserver();
27 32
28 static bool is_incognito_process() { return is_incognito_process_; } 33 static bool is_incognito_process() { return is_incognito_process_; }
29 34
30 private: 35 private:
31 // RenderProcessObserver implementation. 36 // RenderProcessObserver implementation.
32 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; 37 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
33 virtual void WebKitInitialized() OVERRIDE; 38 virtual void WebKitInitialized() OVERRIDE;
34 39
35 void OnSetIsIncognitoProcess(bool is_incognito_process); 40 void OnSetIsIncognitoProcess(bool is_incognito_process);
36 void OnSetContentSettingsForCurrentURL( 41 void OnSetContentSettingsForCurrentURL(
37 const GURL& url, const ContentSettings& content_settings); 42 const GURL& url, const ContentSettings& content_settings);
38 void OnSetDefaultContentSettings(const ContentSettings& content_settings); 43 void OnSetDefaultContentSettings(const ContentSettings& content_settings);
39 void OnSetCacheCapacities(size_t min_dead_capacity, 44 void OnSetCacheCapacities(size_t min_dead_capacity,
40 size_t max_dead_capacity, 45 size_t max_dead_capacity,
41 size_t capacity); 46 size_t capacity);
42 void OnClearCache(); 47 void OnClearCache();
43 void OnGetCacheResourceStats(); 48 void OnGetCacheResourceStats();
44 void OnSetFieldTrialGroup(const std::string& fiel_trial_name, 49 void OnSetFieldTrialGroup(const std::string& fiel_trial_name,
45 const std::string& group_name); 50 const std::string& group_name);
46 void OnGetRendererTcmalloc(); 51 void OnGetRendererTcmalloc();
47 void OnGetV8HeapStats(); 52 void OnGetV8HeapStats();
48 void OnPurgeMemory(); 53 void OnPurgeMemory();
49 54
50 static bool is_incognito_process_; 55 static bool is_incognito_process_;
51 scoped_ptr<ResourceDispatcherDelegate> resource_delegate_; 56 scoped_ptr<ResourceDispatcherDelegate> resource_delegate_;
57 chrome::ChromeContentRendererClient* client_;
52 58
53 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); 59 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver);
54 }; 60 };
55 61
56 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ 62 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/chrome_render_process_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698