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

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

Issue 1142123002: Remove swapped-out usage in --site-per-process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DisownOpener. Created 5 years, 6 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
OLDNEW
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 #include "chrome/renderer/content_settings_observer.h" 5 #include "chrome/renderer/content_settings_observer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "components/content_settings/content/common/content_settings_messages.h " 9 #include "components/content_settings/content/common/content_settings_messages.h "
10 #include "content/public/common/url_constants.h" 10 #include "content/public/common/url_constants.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 allow_displaying_insecure_content_(false), 163 allow_displaying_insecure_content_(false),
164 allow_running_insecure_content_(false), 164 allow_running_insecure_content_(false),
165 content_setting_rules_(NULL), 165 content_setting_rules_(NULL),
166 is_interstitial_page_(false), 166 is_interstitial_page_(false),
167 npapi_plugins_blocked_(false), 167 npapi_plugins_blocked_(false),
168 current_request_id_(0), 168 current_request_id_(0),
169 should_whitelist_(should_whitelist) { 169 should_whitelist_(should_whitelist) {
170 ClearBlockedContentSettings(); 170 ClearBlockedContentSettings();
171 render_frame->GetWebFrame()->setContentSettingsClient(this); 171 render_frame->GetWebFrame()->setContentSettingsClient(this);
172 172
173 if (render_frame->GetRenderView()->GetMainRenderFrame() != render_frame) { 173 content::RenderFrame* main_frame =
174 render_frame->GetRenderView()->GetMainRenderFrame();
175 if (main_frame && main_frame != render_frame) {
174 // Copy all the settings from the main render frame to avoid race conditions 176 // Copy all the settings from the main render frame to avoid race conditions
175 // when initializing this data. See http://crbug.com/333308. 177 // when initializing this data. See http://crbug.com/333308.
Charlie Reis 2015/06/04 00:02:11 Unrelated: Will this bug regress for OOPIFs, since
nasko 2015/06/04 14:57:12 I think it deserves a bug and attention, as with O
176 ContentSettingsObserver* parent = ContentSettingsObserver::Get( 178 ContentSettingsObserver* parent = ContentSettingsObserver::Get(main_frame);
177 render_frame->GetRenderView()->GetMainRenderFrame());
178 allow_displaying_insecure_content_ = 179 allow_displaying_insecure_content_ =
179 parent->allow_displaying_insecure_content_; 180 parent->allow_displaying_insecure_content_;
180 allow_running_insecure_content_ = parent->allow_running_insecure_content_; 181 allow_running_insecure_content_ = parent->allow_running_insecure_content_;
181 temporarily_allowed_plugins_ = parent->temporarily_allowed_plugins_; 182 temporarily_allowed_plugins_ = parent->temporarily_allowed_plugins_;
182 is_interstitial_page_ = parent->is_interstitial_page_; 183 is_interstitial_page_ = parent->is_interstitial_page_;
183 npapi_plugins_blocked_ = parent->npapi_plugins_blocked_; 184 npapi_plugins_blocked_ = parent->npapi_plugins_blocked_;
184 } 185 }
185 } 186 }
186 187
187 ContentSettingsObserver::~ContentSettingsObserver() { 188 ContentSettingsObserver::~ContentSettingsObserver() {
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 return true; // Browser UI elements should still work. 698 return true; // Browser UI elements should still work.
698 699
699 if (EqualsASCII(origin.protocol(), content::kChromeDevToolsScheme)) 700 if (EqualsASCII(origin.protocol(), content::kChromeDevToolsScheme))
700 return true; // DevTools UI elements should still work. 701 return true; // DevTools UI elements should still work.
701 702
702 #if defined(ENABLE_EXTENSIONS) 703 #if defined(ENABLE_EXTENSIONS)
703 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) 704 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme))
704 return true; 705 return true;
705 #endif 706 #endif
706 707
707 // TODO(creis, fsamuel): Remove this once the concept of swapped out 708 // TODO(creis, fsamuel): Remove this once the concept of swapped out
Charlie Reis 2015/06/04 00:02:11 Ooh, just saw this as I was scrolling through. :)
nasko 2015/06/04 14:57:12 Acknowledged.
708 // RenderFrames goes away. 709 // RenderFrames goes away.
709 if (document_url == GURL(content::kSwappedOutURL)) 710 if (document_url == GURL(content::kSwappedOutURL))
710 return true; 711 return true;
711 712
712 // If the scheme is file:, an empty file name indicates a directory listing, 713 // If the scheme is file:, an empty file name indicates a directory listing,
713 // which requires JavaScript to function properly. 714 // which requires JavaScript to function properly.
714 if (EqualsASCII(origin.protocol(), url::kFileScheme)) { 715 if (EqualsASCII(origin.protocol(), url::kFileScheme)) {
715 return document_url.SchemeIs(url::kFileScheme) && 716 return document_url.SchemeIs(url::kFileScheme) &&
716 document_url.ExtractFileName().empty(); 717 document_url.ExtractFileName().empty();
717 } 718 }
718 719
719 return false; 720 return false;
720 } 721 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698