Commit dc5bd4b0 authored by tasak@google.com's avatar tasak@google.com

Add RELEASE_ASSERT for ensuring that we have no empty context to V8WrapperInstantiationScope.

BUG=369451

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176002 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0c1605b3
...@@ -90,10 +90,8 @@ v8::Handle<v8::Object> CustomElementWrapper<ElementType, WrapperType>::wrap(Pass ...@@ -90,10 +90,8 @@ v8::Handle<v8::Object> CustomElementWrapper<ElementType, WrapperType>::wrap(Pass
{ {
ASSERT(DOMDataStore::getWrapper<V8Element>(element.get(), isolate).IsEmpty()); ASSERT(DOMDataStore::getWrapper<V8Element>(element.get(), isolate).IsEmpty());
// FIXME: creationContext.IsEmpty() should never happen. Remove ASSERT(!creationContext.IsEmpty());
// this when callers (like InspectorController::inspect) are fixed v8::Handle<v8::Context> context = creationContext->CreationContext();
// to never pass an empty creation context.
v8::Handle<v8::Context> context = creationContext.IsEmpty() ? isolate->GetCurrentContext() : creationContext->CreationContext();
if (!element->isUpgradedCustomElement() || DOMWrapperWorld::world(context).isIsolatedWorld()) if (!element->isUpgradedCustomElement() || DOMWrapperWorld::world(context).isIsolatedWorld())
return createUpgradeCandidateWrapper(element.get(), creationContext, isolate, createSpecificWrapper); return createUpgradeCandidateWrapper(element.get(), creationContext, isolate, createSpecificWrapper);
......
...@@ -148,11 +148,10 @@ struct WrapperTypeInfo; ...@@ -148,11 +148,10 @@ struct WrapperTypeInfo;
: m_didEnterContext(false) : m_didEnterContext(false)
, m_context(isolate->GetCurrentContext()) , m_context(isolate->GetCurrentContext())
{ {
// FIXME: Remove all empty creationContexts from caller sites. // creationContext should not be empty. Because if we have an
// If a creationContext is empty, we will end up creating a new object // empty creationContext, we will end up creating
// in the context currently entered. This is wrong. // a new object in the context currently entered. This is wrong.
if (creationContext.IsEmpty()) RELEASE_ASSERT(!creationContext.IsEmpty());
return;
v8::Handle<v8::Context> contextForWrapper = creationContext->CreationContext(); v8::Handle<v8::Context> contextForWrapper = creationContext->CreationContext();
// For performance, we enter the context only if the currently running context // For performance, we enter the context only if the currently running context
// is different from the context that we are about to enter. // is different from the context that we are about to enter.
......
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