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

Side by Side Diff: Source/bindings/core/v8/WindowProxy.cpp

Issue 559503002: CSP: Move policy parsing out of Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/Document.h » ('j') | Source/core/dom/Document.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 disposeContext(DoNotDetachGlobal); 210 disposeContext(DoNotDetachGlobal);
211 return false; 211 return false;
212 } 212 }
213 213
214 if (m_world->isMainWorld()) { 214 if (m_world->isMainWorld()) {
215 // ActivityLogger for main world is updated within updateDocument(). 215 // ActivityLogger for main world is updated within updateDocument().
216 updateDocument(); 216 updateDocument();
217 if (m_frame->document()) { 217 if (m_frame->document()) {
218 setSecurityToken(m_frame->document()->securityOrigin()); 218 setSecurityToken(m_frame->document()->securityOrigin());
219 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol icy(); 219 ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPol icy();
220 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSec urityPolicy::SuppressReport)); 220 if (csp) {
221 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isol ate, csp->evalDisabledErrorMessage())); 221 context->AllowCodeGenerationFromStrings(csp->allowEval(0, Conten tSecurityPolicy::SuppressReport));
222 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_ isolate, csp->evalDisabledErrorMessage()));
223 }
222 } 224 }
223 } else { 225 } else {
224 updateActivityLogger(); 226 updateActivityLogger();
225 SecurityOrigin* origin = m_world->isolatedWorldSecurityOrigin(); 227 SecurityOrigin* origin = m_world->isolatedWorldSecurityOrigin();
226 setSecurityToken(origin); 228 setSecurityToken(origin);
227 if (origin && InspectorInstrumentation::hasFrontends()) { 229 if (origin && InspectorInstrumentation::hasFrontends()) {
228 InspectorInstrumentation::didCreateIsolatedContext(m_frame, m_script State.get(), origin); 230 InspectorInstrumentation::didCreateIsolatedContext(m_frame, m_script State.get(), origin);
229 } 231 }
230 } 232 }
231 m_frame->loader().client()->didCreateScriptContext(context, m_world->extensi onGroup(), m_world->worldId()); 233 m_frame->loader().client()->didCreateScriptContext(context, m_world->extensi onGroup(), m_world->worldId());
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 486
485 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 487 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
486 { 488 {
487 ASSERT(m_world->isMainWorld()); 489 ASSERT(m_world->isMainWorld());
488 if (!isContextInitialized()) 490 if (!isContextInitialized())
489 return; 491 return;
490 setSecurityToken(origin); 492 setSecurityToken(origin);
491 } 493 }
492 494
493 } // namespace blink 495 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Document.h » ('j') | Source/core/dom/Document.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698