OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |