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

Unified Diff: Source/bindings/v8/ExceptionState.h

Issue 87963002: Improve Crypto::getRandomValues exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: DEBUG. Created 7 years, 1 month 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 | « LayoutTests/crypto/worker-random-values-types-expected.txt ('k') | Source/bindings/v8/ExceptionState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ExceptionState.h
diff --git a/Source/bindings/v8/ExceptionState.h b/Source/bindings/v8/ExceptionState.h
index 576d370ee2553c3176ddb9e58bb33964d484633f..a58784fdfc13aa864f1fd9bc26e503f7eb3e2fce 100644
--- a/Source/bindings/v8/ExceptionState.h
+++ b/Source/bindings/v8/ExceptionState.h
@@ -44,11 +44,39 @@ typedef int ExceptionCode;
class ExceptionState {
WTF_MAKE_NONCOPYABLE(ExceptionState);
public:
+ enum Context {
+ ConstructionContext,
+ ExecutionContext,
+ DeletionContext,
+ GetterContext,
+ SetterContext,
+ UnknownContext, // FIXME: Remove this once we've flipped over to the new API.
+ };
+
explicit ExceptionState(const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate)
: m_code(0)
+ , m_context(UnknownContext)
+ , m_propertyName(0)
+ , m_interfaceName(0)
+ , m_creationContext(creationContext)
+ , m_isolate(isolate) { }
+
+ ExceptionState(Context context, const char* propertyName, const char* interfaceName, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate)
+ : m_code(0)
+ , m_context(context)
+ , m_propertyName(propertyName)
+ , m_interfaceName(interfaceName)
, m_creationContext(creationContext)
, m_isolate(isolate) { }
+ ExceptionState(Context context, const char* interfaceName, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate)
+ : m_code(0)
+ , m_context(context)
+ , m_propertyName(0)
+ , m_interfaceName(interfaceName)
+ , m_creationContext(creationContext)
+ , m_isolate(isolate) { ASSERT(m_context == ConstructionContext); }
+
virtual void throwDOMException(const ExceptionCode&, const String& message);
virtual void throwTypeError(const String& message);
virtual void throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage = String());
@@ -74,8 +102,15 @@ public:
return true;
}
+ Context context() { return m_context; }
+ const char* propertyName() { return m_propertyName; }
+ const char* interfaceName() { return m_interfaceName; }
+
protected:
ExceptionCode m_code;
+ Context m_context;
+ const char* m_propertyName;
+ const char* m_interfaceName;
private:
void setException(v8::Handle<v8::Value>);
« no previous file with comments | « LayoutTests/crypto/worker-random-values-types-expected.txt ('k') | Source/bindings/v8/ExceptionState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698