| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior) | 90 void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior) |
| 91 { | 91 { |
| 92 if (!isContextInitialized()) | 92 if (!isContextInitialized()) |
| 93 return; | 93 return; |
| 94 | 94 |
| 95 v8::HandleScope handleScope(m_isolate); | 95 v8::HandleScope handleScope(m_isolate); |
| 96 v8::Handle<v8::Context> context = m_scriptState->context(); | 96 v8::Handle<v8::Context> context = m_scriptState->context(); |
| 97 m_frame->loader().client()->willReleaseScriptContext(context, m_world->world
Id()); | 97 m_frame->loader().client()->willReleaseScriptContext(context, m_world->world
Id()); |
| 98 | 98 |
| 99 if (behavior == DetachGlobal) | 99 if (behavior == DetachGlobal) |
| 100 context->DetachGlobal(); | 100 m_scriptState->detachGlobalObject(); |
| 101 | 101 |
| 102 m_scriptState->disposePerContextData(); | 102 m_scriptState->disposePerContextData(); |
| 103 | 103 |
| 104 // It's likely that disposing the context has created a lot of | 104 // It's likely that disposing the context has created a lot of |
| 105 // garbage. Notify V8 about this so it'll have a chance of cleaning | 105 // garbage. Notify V8 about this so it'll have a chance of cleaning |
| 106 // it up when idle. | 106 // it up when idle. |
| 107 V8GCForContextDispose::instanceTemplate().notifyContextDisposed(m_frame->isM
ainFrame()); | 107 V8GCForContextDispose::instanceTemplate().notifyContextDisposed(m_frame->isM
ainFrame()); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void WindowProxy::clearForClose() | 110 void WindowProxy::clearForClose() |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 | 484 |
| 485 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) | 485 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) |
| 486 { | 486 { |
| 487 ASSERT(m_world->isMainWorld()); | 487 ASSERT(m_world->isMainWorld()); |
| 488 if (!isContextInitialized()) | 488 if (!isContextInitialized()) |
| 489 return; | 489 return; |
| 490 setSecurityToken(origin); | 490 setSecurityToken(origin); |
| 491 } | 491 } |
| 492 | 492 |
| 493 } // namespace blink | 493 } // namespace blink |
| OLD | NEW |