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 19 matching lines...) Expand all Loading... |
30 explicit ChromeRenderProcessObserver( | 30 explicit ChromeRenderProcessObserver( |
31 ChromeContentRendererClient* client); | 31 ChromeContentRendererClient* client); |
32 virtual ~ChromeRenderProcessObserver(); | 32 virtual ~ChromeRenderProcessObserver(); |
33 | 33 |
34 static bool is_incognito_process() { return is_incognito_process_; } | 34 static bool is_incognito_process() { return is_incognito_process_; } |
35 | 35 |
36 // Needs to be called by RenderViews in case of navigations to execute | 36 // Needs to be called by RenderViews in case of navigations to execute |
37 // any 'clear cache' commands that were delayed until the next navigation. | 37 // any 'clear cache' commands that were delayed until the next navigation. |
38 void ExecutePendingClearCache(); | 38 void ExecutePendingClearCache(); |
39 | 39 |
40 // Returns a pointer to the content setting rules owned by | |
41 // |ChromeRenderProcessObserver|. | |
42 const RendererContentSettingRules* content_setting_rules() const; | |
43 | |
44 private: | 40 private: |
45 // RenderProcessObserver implementation. | 41 // RenderProcessObserver implementation. |
46 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 42 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
47 virtual void WebKitInitialized() OVERRIDE; | 43 virtual void WebKitInitialized() OVERRIDE; |
48 virtual void OnRenderProcessShutdown() OVERRIDE; | 44 virtual void OnRenderProcessShutdown() OVERRIDE; |
49 | 45 |
50 void OnSetIsIncognitoProcess(bool is_incognito_process); | 46 void OnSetIsIncognitoProcess(bool is_incognito_process); |
51 void OnSetContentSettingsForCurrentURL( | 47 void OnSetContentSettingsForCurrentURL( |
52 const GURL& url, const ContentSettings& content_settings); | 48 const GURL& url, const ContentSettings& content_settings); |
53 void OnSetContentSettingRules(const RendererContentSettingRules& rules); | |
54 void OnSetCacheCapacities(size_t min_dead_capacity, | 49 void OnSetCacheCapacities(size_t min_dead_capacity, |
55 size_t max_dead_capacity, | 50 size_t max_dead_capacity, |
56 size_t capacity); | 51 size_t capacity); |
57 // If |on_navigation| is true, the clearing is delayed until the next | 52 // If |on_navigation| is true, the clearing is delayed until the next |
58 // navigation event. | 53 // navigation event. |
59 void OnClearCache(bool on_navigation); | 54 void OnClearCache(bool on_navigation); |
60 void OnGetCacheResourceStats(); | 55 void OnGetCacheResourceStats(); |
61 void OnSetFieldTrialGroup(const std::string& fiel_trial_name, | 56 void OnSetFieldTrialGroup(const std::string& fiel_trial_name, |
62 const std::string& group_name); | 57 const std::string& group_name); |
63 void OnGetV8HeapStats(); | 58 void OnGetV8HeapStats(); |
64 void OnPurgeMemory(); | 59 void OnPurgeMemory(); |
65 void OnToggleWebKitSharedTimer(bool suspend); | 60 void OnToggleWebKitSharedTimer(bool suspend); |
66 | 61 |
67 static bool is_incognito_process_; | 62 static bool is_incognito_process_; |
68 scoped_ptr<content::ResourceDispatcherDelegate> resource_delegate_; | 63 scoped_ptr<content::ResourceDispatcherDelegate> resource_delegate_; |
69 ChromeContentRendererClient* client_; | 64 ChromeContentRendererClient* client_; |
70 // If true, the web cache shall be cleared before the next navigation event. | 65 // If true, the web cache shall be cleared before the next navigation event. |
71 bool clear_cache_pending_; | 66 bool clear_cache_pending_; |
72 RendererContentSettingRules content_setting_rules_; | |
73 | 67 |
74 bool webkit_initialized_; | 68 bool webkit_initialized_; |
75 size_t pending_cache_min_dead_capacity_; | 69 size_t pending_cache_min_dead_capacity_; |
76 size_t pending_cache_max_dead_capacity_; | 70 size_t pending_cache_max_dead_capacity_; |
77 size_t pending_cache_capacity_; | 71 size_t pending_cache_capacity_; |
78 | 72 |
79 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); | 73 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); |
80 }; | 74 }; |
81 | 75 |
82 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ | 76 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ |
OLD | NEW |