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 if (!m_frame->client()) | 248 // This can get called after a frame is already detached... |
| 249 // FIXME: Fix the code so we don't need this check. |
| 250 if (m_frame->isLocalFrame() && !toLocalFrame(m_frame)->loader().documentLoad
er()) |
249 return; | 251 return; |
250 | 252 |
251 // Create a new environment using an empty template for the shadow | 253 // Create a new environment using an empty template for the shadow |
252 // object. Reuse the global object if one has been created earlier. | 254 // object. Reuse the global object if one has been created earlier. |
253 v8::Local<v8::ObjectTemplate> globalTemplate = V8Window::getShadowObjectTemp
late(m_isolate); | 255 v8::Local<v8::ObjectTemplate> globalTemplate = V8Window::getShadowObjectTemp
late(m_isolate); |
254 if (globalTemplate.IsEmpty()) | 256 if (globalTemplate.IsEmpty()) |
255 return; | 257 return; |
256 | 258 |
257 double contextCreationStartInSeconds = currentTime(); | 259 double contextCreationStartInSeconds = currentTime(); |
258 | 260 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 487 |
486 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 488 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
487 { | 489 { |
488 ASSERT(m_world->isMainWorld()); | 490 ASSERT(m_world->isMainWorld()); |
489 if (!isContextInitialized()) | 491 if (!isContextInitialized()) |
490 return; | 492 return; |
491 setSecurityToken(origin); | 493 setSecurityToken(origin); |
492 } | 494 } |
493 | 495 |
494 } // namespace blink | 496 } // namespace blink |
OLD | NEW |