Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: Source/bindings/core/v8/WindowProxy.cpp

Issue 538933002: ScriptState::contextIsEmpty shouldn't return true for a context whose global object is detached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp ('k') | Source/bindings/core/v8/custom/V8WindowCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698