| OLD | NEW |
| 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 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 explicit ChromeRenderProcessObserver( | 34 explicit ChromeRenderProcessObserver( |
| 35 chrome::ChromeContentRendererClient* client); | 35 chrome::ChromeContentRendererClient* client); |
| 36 virtual ~ChromeRenderProcessObserver(); | 36 virtual ~ChromeRenderProcessObserver(); |
| 37 | 37 |
| 38 static bool is_incognito_process() { return is_incognito_process_; } | 38 static bool is_incognito_process() { return is_incognito_process_; } |
| 39 | 39 |
| 40 // Needs to be called by RenderViews in case of navigations to execute | 40 // Needs to be called by RenderViews in case of navigations to execute |
| 41 // any 'clear cache' commands that were delayed until the next navigation. | 41 // any 'clear cache' commands that were delayed until the next navigation. |
| 42 void ExecutePendingClearCache(); | 42 void ExecutePendingClearCache(); |
| 43 | 43 |
| 44 // Returns a pointer to the default content settings owned by | 44 // Returns a pointer to the content setting rules owned by |
| 45 // |ChromeRenderProcessObserver|. | 45 // |ChromeRenderProcessObserver|. |
| 46 const ContentSettings* default_content_settings() const; | 46 const RendererContentSettingRules* content_setting_rules() const; |
| 47 | |
| 48 // Returns a pointer to the image setting rules owned by | |
| 49 // |ChromeRenderProcessObserver|. | |
| 50 const ContentSettingsForOneType* image_setting_rules() const; | |
| 51 | 47 |
| 52 private: | 48 private: |
| 53 // RenderProcessObserver implementation. | 49 // RenderProcessObserver implementation. |
| 54 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 50 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| 55 virtual void WebKitInitialized() OVERRIDE; | 51 virtual void WebKitInitialized() OVERRIDE; |
| 56 | 52 |
| 57 void OnSetIsIncognitoProcess(bool is_incognito_process); | 53 void OnSetIsIncognitoProcess(bool is_incognito_process); |
| 58 void OnSetContentSettingsForCurrentURL( | 54 void OnSetContentSettingsForCurrentURL( |
| 59 const GURL& url, const ContentSettings& content_settings); | 55 const GURL& url, const ContentSettings& content_settings); |
| 60 void OnSetDefaultContentSettings(const ContentSettings& content_settings); | 56 void OnSetContentSettingRules(const RendererContentSettingRules& rules); |
| 61 void OnSetImageSettingRules(const ContentSettingsForOneType& settings); | |
| 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 OnGetRendererTcmalloc(); | 66 void OnGetRendererTcmalloc(); |
| 72 void OnSetTcmallocHeapProfiling(bool profiling, const std::string& prefix); | 67 void OnSetTcmallocHeapProfiling(bool profiling, const std::string& prefix); |
| 73 void OnWriteTcmallocHeapProfile(const FilePath::StringType& filename); | 68 void OnWriteTcmallocHeapProfile(const FilePath::StringType& filename); |
| 74 void OnGetV8HeapStats(); | 69 void OnGetV8HeapStats(); |
| 75 void OnPurgeMemory(); | 70 void OnPurgeMemory(); |
| 76 | 71 |
| 77 static bool is_incognito_process_; | 72 static bool is_incognito_process_; |
| 78 scoped_ptr<content::ResourceDispatcherDelegate> resource_delegate_; | 73 scoped_ptr<content::ResourceDispatcherDelegate> resource_delegate_; |
| 79 chrome::ChromeContentRendererClient* client_; | 74 chrome::ChromeContentRendererClient* client_; |
| 80 // If true, the web cache shall be cleared before the next navigation event. | 75 // If true, the web cache shall be cleared before the next navigation event. |
| 81 bool clear_cache_pending_; | 76 bool clear_cache_pending_; |
| 82 ContentSettings default_content_settings_; | 77 RendererContentSettingRules content_setting_rules_; |
| 83 ContentSettingsForOneType image_setting_rules_; | |
| 84 | 78 |
| 85 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); | 79 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); |
| 86 }; | 80 }; |
| 87 | 81 |
| 88 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ | 82 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ |
| OLD | NEW |