Chromium Code Reviews| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 | 91 |
| 92 void V8WindowShell::disposeContext(GlobalDetachmentBehavior behavior) | 92 void V8WindowShell::disposeContext(GlobalDetachmentBehavior behavior) |
| 93 { | 93 { |
| 94 m_perContextData.clear(); | 94 m_perContextData.clear(); |
| 95 | 95 |
| 96 if (!m_contextHolder) | 96 if (!m_contextHolder) |
| 97 return; | 97 return; |
| 98 | 98 |
| 99 v8::HandleScope handleScope(m_isolate); | 99 v8::HandleScope handleScope(m_isolate); |
| 100 v8::Handle<v8::Context> context = m_contextHolder->context(); | 100 v8::Handle<v8::Context> context = m_contextHolder->context(); |
| 101 m_frame->loader().client()->willReleaseScriptContext(context, m_world->world Id()); | 101 // FIXME: This is probably wrong. |
|
eseidel
2013/12/21 01:17:34
A bit more context?
dcheng
2013/12/28 01:04:29
I've found a better way to fix this. Normally, thi
| |
| 102 if (m_frame->loader().client()) | |
| 103 m_frame->loader().client()->willReleaseScriptContext(context, m_world->w orldId()); | |
| 102 | 104 |
| 103 if (behavior == DetachGlobal) | 105 if (behavior == DetachGlobal) |
| 104 context->DetachGlobal(); | 106 context->DetachGlobal(); |
| 105 | 107 |
| 106 m_contextHolder.clear(); | 108 m_contextHolder.clear(); |
| 107 | 109 |
| 108 // It's likely that disposing the context has created a lot of | 110 // It's likely that disposing the context has created a lot of |
| 109 // garbage. Notify V8 about this so it'll have a chance of cleaning | 111 // garbage. Notify V8 about this so it'll have a chance of cleaning |
| 110 // it up when idle. | 112 // it up when idle. |
| 111 V8GCForContextDispose::instanceTemplate().notifyContextDisposed(m_frame->isM ainFrame()); | 113 V8GCForContextDispose::instanceTemplate().notifyContextDisposed(m_frame->isM ainFrame()); |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 500 void V8WindowShell::updateSecurityOrigin() | 502 void V8WindowShell::updateSecurityOrigin() |
| 501 { | 503 { |
| 502 ASSERT(m_world->isMainWorld()); | 504 ASSERT(m_world->isMainWorld()); |
| 503 if (!m_contextHolder) | 505 if (!m_contextHolder) |
| 504 return; | 506 return; |
| 505 v8::HandleScope handleScope(m_isolate); | 507 v8::HandleScope handleScope(m_isolate); |
| 506 setSecurityToken(); | 508 setSecurityToken(); |
| 507 } | 509 } |
| 508 | 510 |
| 509 } // WebCore | 511 } // WebCore |
| OLD | NEW |