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

Side by Side Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 6873040: Move the content settings code out of RenderView, since it belongs in the Chrome layer. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 #include "chrome/renderer/chrome_render_process_observer.h" 5 #include "chrome/renderer/chrome_render_process_observer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/process_util.h" 11 #include "base/process_util.h"
12 #include "chrome/common/chrome_paths.h" 12 #include "chrome/common/chrome_paths.h"
13 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/common/render_messages.h" 14 #include "chrome/common/render_messages.h"
15 #include "chrome/renderer/content_settings_observer.h"
15 #include "content/common/view_messages.h" 16 #include "content/common/view_messages.h"
16 #include "content/renderer/render_thread.h" 17 #include "content/renderer/render_thread.h"
17 #include "content/renderer/render_view.h" 18 #include "content/renderer/render_view.h"
18 #include "content/renderer/render_view_visitor.h" 19 #include "content/renderer/render_view_visitor.h"
19 #include "crypto/nss_util.h" 20 #include "crypto/nss_util.h"
20 #include "third_party/sqlite/sqlite3.h" 21 #include "third_party/sqlite/sqlite3.h"
21 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" 22 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflig htResultCache.h" 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflig htResultCache.h"
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h" 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 77
77 class RenderViewContentSettingsSetter : public RenderViewVisitor { 78 class RenderViewContentSettingsSetter : public RenderViewVisitor {
78 public: 79 public:
79 RenderViewContentSettingsSetter(const GURL& url, 80 RenderViewContentSettingsSetter(const GURL& url,
80 const ContentSettings& content_settings) 81 const ContentSettings& content_settings)
81 : url_(url), 82 : url_(url),
82 content_settings_(content_settings) { 83 content_settings_(content_settings) {
83 } 84 }
84 85
85 virtual bool Visit(RenderView* render_view) { 86 virtual bool Visit(RenderView* render_view) {
86 if (GURL(render_view->webview()->mainFrame()->url()) == url_) 87 if (GURL(render_view->webview()->mainFrame()->url()) == url_) {
87 render_view->SetContentSettings(content_settings_); 88 ContentSettingsObserver::Get(render_view)->SetContentSettings(
89 content_settings_);
90 }
88 return true; 91 return true;
89 } 92 }
90 93
91 private: 94 private:
92 GURL url_; 95 GURL url_;
93 ContentSettings content_settings_; 96 ContentSettings content_settings_;
94 97
95 DISALLOW_COPY_AND_ASSIGN(RenderViewContentSettingsSetter); 98 DISALLOW_COPY_AND_ASSIGN(RenderViewContentSettingsSetter);
96 }; 99 };
97 100
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // a new "delete everything" pass because object references make it difficult 234 // a new "delete everything" pass because object references make it difficult
232 // to free everything possible in just one pass. 235 // to free everything possible in just one pass.
233 while (!v8::V8::IdleNotification()) { 236 while (!v8::V8::IdleNotification()) {
234 } 237 }
235 238
236 #if (defined(OS_WIN) || defined(OS_LINUX)) && defined(USE_TCMALLOC) 239 #if (defined(OS_WIN) || defined(OS_LINUX)) && defined(USE_TCMALLOC)
237 // Tell tcmalloc to release any free pages it's still holding. 240 // Tell tcmalloc to release any free pages it's still holding.
238 MallocExtension::instance()->ReleaseFreeMemory(); 241 MallocExtension::instance()->ReleaseFreeMemory();
239 #endif 242 #endif
240 } 243 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698