OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // happen. If a few messages are related, they should probably have their own | 29 // happen. If a few messages are related, they should probably have their own |
30 // observer. | 30 // observer. |
31 class ChromeRenderProcessObserver : public content::RenderProcessObserver { | 31 class ChromeRenderProcessObserver : public content::RenderProcessObserver { |
32 public: | 32 public: |
33 explicit ChromeRenderProcessObserver( | 33 explicit ChromeRenderProcessObserver( |
34 chrome::ChromeContentRendererClient* client); | 34 chrome::ChromeContentRendererClient* client); |
35 virtual ~ChromeRenderProcessObserver(); | 35 virtual ~ChromeRenderProcessObserver(); |
36 | 36 |
37 static bool is_incognito_process() { return is_incognito_process_; } | 37 static bool is_incognito_process() { return is_incognito_process_; } |
38 | 38 |
39 static bool extension_activity_log_enabled() { | |
40 return extension_activity_log_enabled_; | |
41 } | |
42 | |
43 // Needs to be called by RenderViews in case of navigations to execute | 39 // Needs to be called by RenderViews in case of navigations to execute |
44 // any 'clear cache' commands that were delayed until the next navigation. | 40 // any 'clear cache' commands that were delayed until the next navigation. |
45 void ExecutePendingClearCache(); | 41 void ExecutePendingClearCache(); |
46 | 42 |
47 // Returns a pointer to the content setting rules owned by | 43 // Returns a pointer to the content setting rules owned by |
48 // |ChromeRenderProcessObserver|. | 44 // |ChromeRenderProcessObserver|. |
49 const RendererContentSettingRules* content_setting_rules() const; | 45 const RendererContentSettingRules* content_setting_rules() const; |
50 | 46 |
51 private: | 47 private: |
52 // RenderProcessObserver implementation. | 48 // RenderProcessObserver implementation. |
53 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 49 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
54 virtual void WebKitInitialized() OVERRIDE; | 50 virtual void WebKitInitialized() OVERRIDE; |
55 virtual void OnRenderProcessShutdown() OVERRIDE; | 51 virtual void OnRenderProcessShutdown() OVERRIDE; |
56 | 52 |
57 void OnSetIsIncognitoProcess(bool is_incognito_process); | 53 void OnSetIsIncognitoProcess(bool is_incognito_process); |
58 void OnSetExtensionActivityLogEnabled(bool extension_activity_log_enabled); | |
59 void OnSetContentSettingsForCurrentURL( | 54 void OnSetContentSettingsForCurrentURL( |
60 const GURL& url, const ContentSettings& content_settings); | 55 const GURL& url, const ContentSettings& content_settings); |
61 void OnSetContentSettingRules(const RendererContentSettingRules& rules); | 56 void OnSetContentSettingRules(const RendererContentSettingRules& rules); |
62 void OnSetCacheCapacities(size_t min_dead_capacity, | 57 void OnSetCacheCapacities(size_t min_dead_capacity, |
63 size_t max_dead_capacity, | 58 size_t max_dead_capacity, |
64 size_t capacity); | 59 size_t capacity); |
65 // If |on_navigation| is true, the clearing is delayed until the next | 60 // If |on_navigation| is true, the clearing is delayed until the next |
66 // navigation event. | 61 // navigation event. |
67 void OnClearCache(bool on_navigation); | 62 void OnClearCache(bool on_navigation); |
68 void OnGetCacheResourceStats(); | 63 void OnGetCacheResourceStats(); |
69 void OnSetFieldTrialGroup(const std::string& fiel_trial_name, | 64 void OnSetFieldTrialGroup(const std::string& fiel_trial_name, |
70 const std::string& group_name); | 65 const std::string& group_name); |
71 void OnGetV8HeapStats(); | 66 void OnGetV8HeapStats(); |
72 void OnPurgeMemory(); | 67 void OnPurgeMemory(); |
73 void OnToggleWebKitSharedTimer(bool suspend); | 68 void OnToggleWebKitSharedTimer(bool suspend); |
74 | 69 |
75 static bool is_incognito_process_; | 70 static bool is_incognito_process_; |
76 static bool extension_activity_log_enabled_; | |
77 scoped_ptr<content::ResourceDispatcherDelegate> resource_delegate_; | 71 scoped_ptr<content::ResourceDispatcherDelegate> resource_delegate_; |
78 chrome::ChromeContentRendererClient* client_; | 72 chrome::ChromeContentRendererClient* client_; |
79 // If true, the web cache shall be cleared before the next navigation event. | 73 // If true, the web cache shall be cleared before the next navigation event. |
80 bool clear_cache_pending_; | 74 bool clear_cache_pending_; |
81 RendererContentSettingRules content_setting_rules_; | 75 RendererContentSettingRules content_setting_rules_; |
82 | 76 |
83 bool webkit_initialized_; | 77 bool webkit_initialized_; |
84 size_t pending_cache_min_dead_capacity_; | 78 size_t pending_cache_min_dead_capacity_; |
85 size_t pending_cache_max_dead_capacity_; | 79 size_t pending_cache_max_dead_capacity_; |
86 size_t pending_cache_capacity_; | 80 size_t pending_cache_capacity_; |
87 | 81 |
88 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); | 82 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); |
89 }; | 83 }; |
90 | 84 |
91 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ | 85 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ |
OLD | NEW |