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

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

Issue 8409006: Take script URLs into account when applying script content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 9 years, 1 month 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/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 bool ChromeRenderProcessObserver::OnControlMessageReceived( 260 bool ChromeRenderProcessObserver::OnControlMessageReceived(
261 const IPC::Message& message) { 261 const IPC::Message& message) {
262 bool handled = true; 262 bool handled = true;
263 IPC_BEGIN_MESSAGE_MAP(ChromeRenderProcessObserver, message) 263 IPC_BEGIN_MESSAGE_MAP(ChromeRenderProcessObserver, message)
264 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsIncognitoProcess, 264 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsIncognitoProcess,
265 OnSetIsIncognitoProcess) 265 OnSetIsIncognitoProcess)
266 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetDefaultContentSettings, 266 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetDefaultContentSettings,
267 OnSetDefaultContentSettings) 267 OnSetDefaultContentSettings)
268 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetContentSettingsForCurrentURL, 268 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetContentSettingsForCurrentURL,
269 OnSetContentSettingsForCurrentURL) 269 OnSetContentSettingsForCurrentURL)
270 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetImageSettingRules, 270 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetContentSettingRules,
271 OnSetImageSettingRules) 271 OnSetContentSettingRules)
272 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetCacheCapacities, OnSetCacheCapacities) 272 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetCacheCapacities, OnSetCacheCapacities)
273 IPC_MESSAGE_HANDLER(ChromeViewMsg_ClearCache, OnClearCache) 273 IPC_MESSAGE_HANDLER(ChromeViewMsg_ClearCache, OnClearCache)
274 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetFieldTrialGroup, OnSetFieldTrialGroup) 274 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetFieldTrialGroup, OnSetFieldTrialGroup)
275 #if defined(USE_TCMALLOC) 275 #if defined(USE_TCMALLOC)
276 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetRendererTcmalloc, 276 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetRendererTcmalloc,
277 OnGetRendererTcmalloc) 277 OnGetRendererTcmalloc)
278 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetTcmallocHeapProfiling, 278 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetTcmallocHeapProfiling,
279 OnSetTcmallocHeapProfiling) 279 OnSetTcmallocHeapProfiling)
280 IPC_MESSAGE_HANDLER(ChromeViewMsg_WriteTcmallocHeapProfile, 280 IPC_MESSAGE_HANDLER(ChromeViewMsg_WriteTcmallocHeapProfile,
281 OnWriteTcmallocHeapProfile) 281 OnWriteTcmallocHeapProfile)
(...skipping 21 matching lines...) Expand all
303 const ContentSettings& content_settings) { 303 const ContentSettings& content_settings) {
304 RenderViewContentSettingsSetter setter(url, content_settings); 304 RenderViewContentSettingsSetter setter(url, content_settings);
305 content::RenderView::ForEach(&setter); 305 content::RenderView::ForEach(&setter);
306 } 306 }
307 307
308 void ChromeRenderProcessObserver::OnSetDefaultContentSettings( 308 void ChromeRenderProcessObserver::OnSetDefaultContentSettings(
309 const ContentSettings& content_settings) { 309 const ContentSettings& content_settings) {
310 default_content_settings_ = content_settings; 310 default_content_settings_ = content_settings;
311 } 311 }
312 312
313 void ChromeRenderProcessObserver::OnSetImageSettingRules( 313 void ChromeRenderProcessObserver::OnSetContentSettingRules(
314 const ContentSettingsForOneType& settings) { 314 const RendererContentSettingRules& rules) {
315 image_setting_rules_ = settings; 315 content_setting_rules_ = rules;
316 } 316 }
317 317
318 void ChromeRenderProcessObserver::OnSetCacheCapacities(size_t min_dead_capacity, 318 void ChromeRenderProcessObserver::OnSetCacheCapacities(size_t min_dead_capacity,
319 size_t max_dead_capacity, 319 size_t max_dead_capacity,
320 size_t capacity) { 320 size_t capacity) {
321 WebCache::setCapacities( 321 WebCache::setCapacities(
322 min_dead_capacity, max_dead_capacity, capacity); 322 min_dead_capacity, max_dead_capacity, capacity);
323 } 323 }
324 324
325 void ChromeRenderProcessObserver::OnClearCache(bool on_navigation) { 325 void ChromeRenderProcessObserver::OnClearCache(bool on_navigation) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 client_->OnPurgeMemory(); 423 client_->OnPurgeMemory();
424 } 424 }
425 425
426 void ChromeRenderProcessObserver::ExecutePendingClearCache() { 426 void ChromeRenderProcessObserver::ExecutePendingClearCache() {
427 if (clear_cache_pending_) { 427 if (clear_cache_pending_) {
428 clear_cache_pending_ = false; 428 clear_cache_pending_ = false;
429 WebCache::clear(); 429 WebCache::clear();
430 } 430 }
431 } 431 }
432 432
433 const ContentSettingsForOneType* 433 const RendererContentSettingRules*
434 ChromeRenderProcessObserver::image_setting_rules() const { 434 ChromeRenderProcessObserver::content_setting_rules() const {
435 return &image_setting_rules_; 435 return &content_setting_rules_;
436 } 436 }
437 437
438 const ContentSettings* 438 const ContentSettings*
439 ChromeRenderProcessObserver::default_content_settings() const { 439 ChromeRenderProcessObserver::default_content_settings() const {
440 return &default_content_settings_; 440 return &default_content_settings_;
441 } 441 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698