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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp

Issue 2272313003: binding: Makes ExceptionState STACK_ALLOCATED(). (Closed)
Patch Set: Synced. Created 4 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
Index: third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp b/third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp
index 3cc7a6d65799d1873b6dd9207a0ae332becdad5a..25568978226f7b0898eec396bd5f554f54ba8ff5 100644
--- a/third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/Dictionary.cpp
@@ -27,7 +27,6 @@
#include "bindings/core/v8/ArrayValue.h"
#include "bindings/core/v8/ExceptionMessages.h"
-#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/V8ArrayBufferView.h"
#include "bindings/core/v8/V8Binding.h"
@@ -43,51 +42,10 @@
namespace blink {
-static ExceptionState& emptyExceptionState()
-{
- DEFINE_THREAD_SAFE_STATIC_LOCAL(WTF::ThreadSpecific<NonThrowableExceptionState>, exceptionState, new ThreadSpecific<NonThrowableExceptionState>);
- return *exceptionState;
-}
-
-Dictionary::Dictionary()
- : m_isolate(0)
- , m_exceptionState(&emptyExceptionState())
-{
-}
-
-Dictionary::Dictionary(const v8::Local<v8::Value>& options, v8::Isolate* isolate, ExceptionState& exceptionState)
- : m_options(options)
- , m_isolate(isolate)
- , m_exceptionState(&exceptionState)
-{
- ASSERT(m_isolate);
- ASSERT(m_exceptionState);
-#if ENABLE(ASSERT)
- m_exceptionState->getOnStackObjectChecker().add(this);
-#endif
-}
-
-Dictionary::~Dictionary()
-{
-#if ENABLE(ASSERT)
- if (m_exceptionState)
- m_exceptionState->getOnStackObjectChecker().remove(this);
-#endif
-}
-
Dictionary& Dictionary::operator=(const Dictionary& optionsObject)
{
m_options = optionsObject.m_options;
m_isolate = optionsObject.m_isolate;
-#if ENABLE(ASSERT)
- if (m_exceptionState)
- m_exceptionState->getOnStackObjectChecker().remove(this);
-#endif
- m_exceptionState = optionsObject.m_exceptionState;
-#if ENABLE(ASSERT)
- if (m_exceptionState)
- m_exceptionState->getOnStackObjectChecker().add(this);
-#endif
return *this;
}
@@ -109,9 +67,8 @@ bool Dictionary::hasProperty(const String& key) const
if (!toObject(object))
return false;
- ASSERT(m_isolate);
- ASSERT(m_isolate == v8::Isolate::GetCurrent());
- ASSERT(m_exceptionState);
+ DCHECK(m_isolate);
+ DCHECK_EQ(m_isolate, v8::Isolate::GetCurrent());
v8::Local<v8::String> v8Key = v8String(m_isolate, key);
return v8CallBoolean(object->Has(v8Context(), v8Key));
}
@@ -152,7 +109,7 @@ bool Dictionary::get(const String& key, Dictionary& value) const
if (v8Value->IsObject()) {
ASSERT(m_isolate);
ASSERT(m_isolate == v8::Isolate::GetCurrent());
- value = Dictionary(v8Value, m_isolate, *m_exceptionState);
+ value = Dictionary(m_isolate, v8Value);
}
return true;
@@ -164,9 +121,8 @@ bool Dictionary::getInternal(const v8::Local<v8::Value>& key, v8::Local<v8::Valu
if (!toObject(object))
return false;
- ASSERT(m_isolate);
- ASSERT(m_isolate == v8::Isolate::GetCurrent());
- ASSERT(m_exceptionState);
+ DCHECK(m_isolate);
+ DCHECK_EQ(m_isolate, v8::Isolate::GetCurrent());
if (!v8CallBoolean(object->Has(v8Context(), key)))
return false;
return object->Get(v8Context(), key).ToLocal(&result);
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/Dictionary.h ('k') | third_party/WebKit/Source/bindings/core/v8/ExceptionState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698