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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 1072933006: Support whitelisting to handle insecure origins as trustworthy origins (chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/origin_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index acda8a70f33dea4c697f4dadd93a8e3e830c7042..56f69160d3350a2ca68cb68669870dd97115fbd6 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -135,6 +135,7 @@
#include "third_party/WebKit/public/web/WebPopupMenu.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/WebKit/public/web/WebScriptController.h"
+#include "third_party/WebKit/public/web/WebSecurityOrigin.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "third_party/skia/include/core/SkGraphics.h"
@@ -186,6 +187,7 @@ using blink::WebFrame;
using blink::WebNetworkStateNotifier;
using blink::WebRuntimeFeatures;
using blink::WebScriptController;
+using blink::WebSecurityOrigin;
using blink::WebSecurityPolicy;
using blink::WebString;
using blink::WebView;
@@ -386,6 +388,15 @@ blink::WebGraphicsContext3D::Attributes GetOffscreenAttribs() {
return attributes;
}
+void RegisterSecureOriginsWhitelist() {
jochen (gone - plz use gerrit) 2015/04/30 07:15:32 this can be moved to chrome now, no? somewhere in
kinuko 2015/04/30 08:16:25 Oops, yes actually I already had the code in chrom
+ std::set<std::string> schemes;
+ std::set<GURL> origins;
+ GetContentClient()->AddSecureSchemesAndOrigins(&schemes, &origins);
+ for (const auto& origin : origins)
+ WebSecurityPolicy::addOriginTrustworthyWhiteList(
+ WebSecurityOrigin::create(origin));
+}
+
} // namespace
// For measuring memory usage after each task. Behind a command line flag.
@@ -566,6 +577,8 @@ void RenderThreadImpl::Init() {
InitSkiaEventTracer();
+ RegisterSecureOriginsWhitelist();
+
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
« no previous file with comments | « content/public/common/origin_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698