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

Unified Diff: Source/bindings/core/v8/WindowProxy.cpp

Issue 1327263002: Modifies WindowProxy::setSecurityToken so that the frame's SecurityOrigin is taken into account whe… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/WindowProxy.cpp
diff --git a/Source/bindings/core/v8/WindowProxy.cpp b/Source/bindings/core/v8/WindowProxy.cpp
index 0feb32db4bbeed456e71777b4a2346a9e745af64..a6cec28c0ba6bd4a3615bf8fb3c065289dcd5937 100644
--- a/Source/bindings/core/v8/WindowProxy.cpp
+++ b/Source/bindings/core/v8/WindowProxy.cpp
@@ -454,8 +454,16 @@ void WindowProxy::setSecurityToken(SecurityOrigin* origin)
return;
}
- if (m_world->isPrivateScriptIsolatedWorld())
+ if (m_world->isPrivateScriptIsolatedWorld()) {
token = "private-script://" + token;
+ } else if (m_world->isIsolatedWorld()) {
+ String frameSecurityToken = m_frame->securityContext()->securityOrigin()->toString();
+ if (frameSecurityToken.isEmpty() || frameSecurityToken == "null") {
+ context->UseDefaultSecurityToken();
+ return;
+ }
+ token = frameSecurityToken + token;
haraken 2015/09/10 23:34:20 Just help me understand: Why do we need to add a p
epertoso 2015/09/11 13:18:22 The rationale here is: the extension can access so
+ }
CString utf8Token = token.utf8();
// NOTE: V8 does identity comparison in fast path, must use a symbol
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698