| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 frame->loader().client()->willReleaseScriptContext(context, | 113 frame->loader().client()->willReleaseScriptContext(context, |
| 114 m_world->worldId()); | 114 m_world->worldId()); |
| 115 MainThreadDebugger::instance()->contextWillBeDestroyed(m_scriptState.get()); | 115 MainThreadDebugger::instance()->contextWillBeDestroyed(m_scriptState.get()); |
| 116 } | 116 } |
| 117 | 117 |
| 118 m_document.clear(); | 118 m_document.clear(); |
| 119 | 119 |
| 120 if (behavior == DetachGlobal) { | 120 if (behavior == DetachGlobal) { |
| 121 // Clean up state on the global proxy, which will be reused. | 121 // Clean up state on the global proxy, which will be reused. |
| 122 if (!m_globalProxy.isEmpty()) { | 122 if (!m_globalProxy.isEmpty()) { |
| 123 CHECK(m_globalProxy == context->Global()); | 123 // TODO(yukishiino): This DCHECK failed on Canary (M57) and Dev (M56). |
| 124 CHECK_EQ(toScriptWrappable(context->Global()), | 124 // We need to figure out why m_globalProxy != context->Global(). |
| 125 toScriptWrappable( | 125 DCHECK(m_globalProxy == context->Global()); |
| 126 context->Global()->GetPrototype().As<v8::Object>())); | 126 DCHECK_EQ(toScriptWrappable(context->Global()), |
| 127 toScriptWrappable( |
| 128 context->Global()->GetPrototype().As<v8::Object>())); |
| 127 m_globalProxy.get().SetWrapperClassId(0); | 129 m_globalProxy.get().SetWrapperClassId(0); |
| 128 } | 130 } |
| 129 V8DOMWrapper::clearNativeInfo(m_isolate, context->Global()); | 131 V8DOMWrapper::clearNativeInfo(m_isolate, context->Global()); |
| 130 m_scriptState->detachGlobalObject(); | 132 m_scriptState->detachGlobalObject(); |
| 131 } | 133 } |
| 132 | 134 |
| 133 m_scriptState->disposePerContextData(); | 135 m_scriptState->disposePerContextData(); |
| 134 | 136 |
| 135 // It's likely that disposing the context has created a lot of | 137 // It's likely that disposing the context has created a lot of |
| 136 // garbage. Notify V8 about this so it'll have a chance of cleaning | 138 // garbage. Notify V8 about this so it'll have a chance of cleaning |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 v8String(m_isolate, name)); | 601 v8String(m_isolate, name)); |
| 600 } | 602 } |
| 601 | 603 |
| 602 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) { | 604 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) { |
| 603 if (!isContextInitialized()) | 605 if (!isContextInitialized()) |
| 604 return; | 606 return; |
| 605 setSecurityToken(origin); | 607 setSecurityToken(origin); |
| 606 } | 608 } |
| 607 | 609 |
| 608 } // namespace blink | 610 } // namespace blink |
| OLD | NEW |