Commit 488433ae authored by haraken's avatar haraken Committed by Commit bot

Minor clean-up on WindowProxy::disposeContext()

We don't need to check isContextInitialized() in clearForClose() and
clearForNavigation() because it is already checked in WindowProxy::disposeContext().

Also this CL moves the ScriptState::Scope into disposeContext()
Though we don't need to enter ScriptState::Scope in case of clearForClose()
by accident, it looks safer to enter the scope always.

BUG=677253

Review-Url: https://codereview.chromium.org/2601033002
Cr-Commit-Position: refs/heads/master@{#440839}
parent 2d88572a
...@@ -99,7 +99,7 @@ void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior) { ...@@ -99,7 +99,7 @@ void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior) {
if (!isContextInitialized()) if (!isContextInitialized())
return; return;
v8::HandleScope handleScope(m_isolate); ScriptState::Scope scope(m_scriptState.get());
v8::Local<v8::Context> context = m_scriptState->context(); v8::Local<v8::Context> context = m_scriptState->context();
if (m_frame->isLocalFrame()) { if (m_frame->isLocalFrame()) {
LocalFrame* frame = toLocalFrame(m_frame); LocalFrame* frame = toLocalFrame(m_frame);
...@@ -136,18 +136,10 @@ void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior) { ...@@ -136,18 +136,10 @@ void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior) {
} }
void WindowProxy::clearForClose() { void WindowProxy::clearForClose() {
if (!isContextInitialized())
return;
disposeContext(DoNotDetachGlobal); disposeContext(DoNotDetachGlobal);
} }
void WindowProxy::clearForNavigation() { void WindowProxy::clearForNavigation() {
if (!isContextInitialized())
return;
ScriptState::Scope scope(m_scriptState.get());
disposeContext(DetachGlobal); disposeContext(DetachGlobal);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment