Commit e1918110 authored by sigbjornf@opera.com's avatar sigbjornf@opera.com

Have resetInternalsObject() handle detached documents.

R=haraken
BUG=524261

Review URL: https://codereview.chromium.org/1309673004

git-svn-id: svn://svn.chromium.org/blink/trunk@201306 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 92753e23
......@@ -66,7 +66,13 @@ void resetInternalsObject(v8::Local<v8::Context> context)
ScriptState* scriptState = ScriptState::from(context);
ScriptState::Scope scope(scriptState);
Page* page = toDocument(scriptState->executionContext())->frame()->page();
Document* document = toDocument(scriptState->executionContext());
ASSERT(document);
LocalFrame* frame = document->frame();
// Should the document have been detached, the page is assumed being destroyed (=> no reset required.)
if (!frame)
return;
Page* page = frame->page();
ASSERT(page);
Internals::resetToConsistentState(page);
InternalSettings::from(*page)->resetToConsistentState();
......
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