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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // | 207 // |
208 // When a frame navigates to a new page, the inner window is cut off | 208 // When a frame navigates to a new page, the inner window is cut off |
209 // the outer window, and the outer window identify is preserved for | 209 // the outer window, and the outer window identify is preserved for |
210 // the frame. However, a new inner window is created for the new page. | 210 // the frame. However, a new inner window is created for the new page. |
211 // If there are JS code holds a closure to the old inner window, | 211 // If there are JS code holds a closure to the old inner window, |
212 // it won't be able to reach the outer window via its global object. | 212 // it won't be able to reach the outer window via its global object. |
213 void WindowProxy::initializeIfNeeded() { | 213 void WindowProxy::initializeIfNeeded() { |
214 if (isContextInitialized()) | 214 if (isContextInitialized()) |
215 return; | 215 return; |
216 initialize(); | 216 initialize(); |
| 217 |
| 218 if (m_world->isMainWorld() && m_frame->isLocalFrame()) |
| 219 toLocalFrame(m_frame)->loader().dispatchDidClearWindowObjectInMainWorld(); |
217 } | 220 } |
218 | 221 |
219 void WindowProxy::initialize() { | 222 void WindowProxy::initialize() { |
220 TRACE_EVENT1("v8", "WindowProxy::initialize", "isMainWindow", | 223 TRACE_EVENT1("v8", "WindowProxy::initialize", "isMainWindow", |
221 m_frame->isMainFrame()); | 224 m_frame->isMainFrame()); |
222 SCOPED_BLINK_UMA_HISTOGRAM_TIMER( | 225 SCOPED_BLINK_UMA_HISTOGRAM_TIMER( |
223 m_frame->isMainFrame() ? "Blink.Binding.InitializeMainWindowProxy" | 226 m_frame->isMainFrame() ? "Blink.Binding.InitializeMainWindowProxy" |
224 : "Blink.Binding.InitializeNonMainWindowProxy"); | 227 : "Blink.Binding.InitializeNonMainWindowProxy"); |
225 | 228 |
226 ScriptForbiddenScope::AllowUserAgentScript allowScript; | 229 ScriptForbiddenScope::AllowUserAgentScript allowScript; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 .ToChecked(); | 553 .ToChecked(); |
551 } | 554 } |
552 | 555 |
553 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) { | 556 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) { |
554 if (!isContextInitialized()) | 557 if (!isContextInitialized()) |
555 return; | 558 return; |
556 setSecurityToken(origin); | 559 setSecurityToken(origin); |
557 } | 560 } |
558 | 561 |
559 } // namespace blink | 562 } // namespace blink |
OLD | NEW |