| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return; | 98 return; |
| 99 | 99 |
| 100 v8::HandleScope handleScope(m_isolate); | 100 v8::HandleScope handleScope(m_isolate); |
| 101 m_frame->loader().client()->willReleaseScriptContext(m_context.newLocal(m_is
olate), m_world->worldId()); | 101 m_frame->loader().client()->willReleaseScriptContext(m_context.newLocal(m_is
olate), m_world->worldId()); |
| 102 | 102 |
| 103 m_context.clear(); | 103 m_context.clear(); |
| 104 | 104 |
| 105 // It's likely that disposing the context has created a lot of | 105 // It's likely that disposing the context has created a lot of |
| 106 // garbage. Notify V8 about this so it'll have a chance of cleaning | 106 // garbage. Notify V8 about this so it'll have a chance of cleaning |
| 107 // it up when idle. | 107 // it up when idle. |
| 108 bool isMainFrame = m_frame->page() && (m_frame->page()->mainFrame() == m_fra
me); | 108 V8GCForContextDispose::instance().notifyContextDisposed(m_frame->isMainFrame
()); |
| 109 V8GCForContextDispose::instance().notifyContextDisposed(isMainFrame); | |
| 110 } | 109 } |
| 111 | 110 |
| 112 void V8WindowShell::clearForClose(bool destroyGlobal) | 111 void V8WindowShell::clearForClose(bool destroyGlobal) |
| 113 { | 112 { |
| 114 if (destroyGlobal) | 113 if (destroyGlobal) |
| 115 m_global.clear(); | 114 m_global.clear(); |
| 116 | 115 |
| 117 if (m_context.isEmpty()) | 116 if (m_context.isEmpty()) |
| 118 return; | 117 return; |
| 119 | 118 |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 void V8WindowShell::updateSecurityOrigin() | 494 void V8WindowShell::updateSecurityOrigin() |
| 496 { | 495 { |
| 497 ASSERT(m_world->isMainWorld()); | 496 ASSERT(m_world->isMainWorld()); |
| 498 if (m_context.isEmpty()) | 497 if (m_context.isEmpty()) |
| 499 return; | 498 return; |
| 500 v8::HandleScope handleScope(m_isolate); | 499 v8::HandleScope handleScope(m_isolate); |
| 501 setSecurityToken(); | 500 setSecurityToken(); |
| 502 } | 501 } |
| 503 | 502 |
| 504 } // WebCore | 503 } // WebCore |
| OLD | NEW |