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

Unified Diff: Source/core/testing/v8/WebCoreTestSupport.cpp

Issue 1309673004: Have resetInternalsObject() handle detached documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: syntax Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/v8/WebCoreTestSupport.cpp
diff --git a/Source/core/testing/v8/WebCoreTestSupport.cpp b/Source/core/testing/v8/WebCoreTestSupport.cpp
index 17cac5e093da930486c9883945d80937dcc76a10..b6f41a30319d95fbe33f99549ec950057a22c12e 100644
--- a/Source/core/testing/v8/WebCoreTestSupport.cpp
+++ b/Source/core/testing/v8/WebCoreTestSupport.cpp
@@ -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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698