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

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

Issue 23842002: Whitelisting exts and plugins from cross-site document blocking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Exclude plugins from cross-site document data collection/blocking. Created 7 years, 3 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/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.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"
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 } 1298 }
1299 #endif // !defined(OS_ANDROID) 1299 #endif // !defined(OS_ANDROID)
1300 return false; 1300 return false;
1301 } 1301 }
1302 1302
1303 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( 1303 bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource(
1304 const base::string16& source) const { 1304 const base::string16& source) const {
1305 return extensions::IsSourceFromAnExtension(source); 1305 return extensions::IsSourceFromAnExtension(source);
1306 } 1306 }
1307 1307
1308 bool ChromeContentRendererClient::ShouldEnableSiteIsolationPolicy() const {
1309 // SiteIsolationPolicy is off by default. We would like to activate the
1310 // cross-site document blocking (for UMA data collection) for normal renderer
1311 // processes running an normal web page from the Internet. We only turn on
1312 // SiteIsolationPolicy for a renderer process without having the extension
Charlie Reis 2013/09/03 20:22:10 nit: without having -> that does not have
dsjang 2013/09/03 22:31:30 Done.
1313 // flag on. Currently, this cannot be turned off for resource requests from
1314 // plugins since they request resources via their embedding renderer process.
1315 CommandLine* command_line = CommandLine::ForCurrentProcess();
1316 const std::string process_type =
1317 command_line->GetSwitchValueASCII(switches::kProcessType);
1318 // We only turn on SiteIsolationPolicy for a renderer process without having
1319 // the extension flag on.
Charlie Reis 2013/09/03 20:22:10 This comment is redundant with the one above.
dsjang 2013/09/03 22:31:30 Done.
1320 DCHECK(process_type == switches::kRendererProcess);
Charlie Reis 2013/09/03 20:22:10 If this passes the try jobs, then I think we can r
dsjang 2013/09/03 22:31:30 Done.
1321 return !command_line->HasSwitch(switches::kExtensionProcess);
1322 }
1323
1308 } // namespace chrome 1324 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698