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

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

Issue 854453003: Revert of Revert of Reland factor out window proxy management portions of ScriptController. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 5 years, 11 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
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 if (m_frame->isLocalFrame()) { 238 if (m_frame->isLocalFrame()) {
239 LocalFrame* frame = toLocalFrame(m_frame); 239 LocalFrame* frame = toLocalFrame(m_frame);
240 InspectorInstrumentation::didCreateScriptContext(frame, m_scriptState.ge t(), origin, m_world->isMainWorld()); 240 InspectorInstrumentation::didCreateScriptContext(frame, m_scriptState.ge t(), origin, m_world->isMainWorld());
241 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId()); 241 frame->loader().client()->didCreateScriptContext(context, m_world->exten sionGroup(), m_world->worldId());
242 } 242 }
243 return true; 243 return true;
244 } 244 }
245 245
246 void WindowProxy::createContext() 246 void WindowProxy::createContext()
247 { 247 {
248 // This can get called after a frame is already detached... 248 if (!m_frame->client())
249 // FIXME: Fix the code so we don't need this check.
250 if (m_frame->isLocalFrame() && !toLocalFrame(m_frame)->loader().documentLoad er())
251 return; 249 return;
252 250
253 // Create a new environment using an empty template for the shadow 251 // Create a new environment using an empty template for the shadow
254 // object. Reuse the global object if one has been created earlier. 252 // object. Reuse the global object if one has been created earlier.
255 v8::Local<v8::ObjectTemplate> globalTemplate = V8Window::getShadowObjectTemp late(m_isolate); 253 v8::Local<v8::ObjectTemplate> globalTemplate = V8Window::getShadowObjectTemp late(m_isolate);
256 if (globalTemplate.IsEmpty()) 254 if (globalTemplate.IsEmpty())
257 return; 255 return;
258 256
259 double contextCreationStartInSeconds = currentTime(); 257 double contextCreationStartInSeconds = currentTime();
260 258
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 485
488 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 486 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
489 { 487 {
490 ASSERT(m_world->isMainWorld()); 488 ASSERT(m_world->isMainWorld());
491 if (!isContextInitialized()) 489 if (!isContextInitialized())
492 return; 490 return;
493 setSecurityToken(origin); 491 setSecurityToken(origin);
494 } 492 }
495 493
496 } // namespace blink 494 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptController.cpp ('k') | Source/bindings/core/v8/WindowProxyManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698