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

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

Issue 2372473002: Add global objects to constructor mapping of V8PerContextData (Closed)
Patch Set: temp Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp » ('j') | no next file with comments »
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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 origin = m_frame->securityContext()->getSecurityOrigin(); 258 origin = m_frame->securityContext()->getSecurityOrigin();
259 // FIXME: Can this be removed when CSP moves to browser? 259 // FIXME: Can this be removed when CSP moves to browser?
260 ContentSecurityPolicy* csp = m_frame->securityContext()->contentSecurity Policy(); 260 ContentSecurityPolicy* csp = m_frame->securityContext()->contentSecurity Policy();
261 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurit yPolicy::SuppressReport)); 261 context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurit yPolicy::SuppressReport));
262 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage())); 262 context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage()));
263 } else { 263 } else {
264 updateActivityLogger(); 264 updateActivityLogger();
265 origin = m_world->isolatedWorldSecurityOrigin(); 265 origin = m_world->isolatedWorldSecurityOrigin();
266 setSecurityToken(origin); 266 setSecurityToken(origin);
267 } 267 }
268
269 // All interfaces must be registered to V8PerContextData.
270 // So we explicitly call constructorForType for the global object.
271 V8PerContextData::from(context)->constructorForType(&V8Window::wrapperTypeIn fo);
272
268 if (m_frame->isLocalFrame()) { 273 if (m_frame->isLocalFrame()) {
269 LocalFrame* frame = toLocalFrame(m_frame); 274 LocalFrame* frame = toLocalFrame(m_frame);
270 MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), fram e, origin); 275 MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), fram e, origin);
271 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId()); 276 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId());
272 } 277 }
273 // If Origin Trials have been registered before the V8 context was ready, 278 // If Origin Trials have been registered before the V8 context was ready,
274 // then inject them into the context now 279 // then inject them into the context now
275 if (m_world->isMainWorld()) { 280 if (m_world->isMainWorld()) {
276 ExecutionContext* executionContext = m_scriptState->getExecutionContext( ); 281 ExecutionContext* executionContext = m_scriptState->getExecutionContext( );
277 if (executionContext) { 282 if (executionContext) {
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } 558 }
554 559
555 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 560 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
556 { 561 {
557 if (!isContextInitialized()) 562 if (!isContextInitialized())
558 return; 563 return;
559 setSecurityToken(origin); 564 setSecurityToken(origin);
560 } 565 }
561 566
562 } // namespace blink 567 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698