| Index: third_party/WebKit/Source/bindings/core/v8/ExceptionState.h
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ExceptionState.h b/third_party/WebKit/Source/bindings/core/v8/ExceptionState.h
|
| index c1628c187509d3eb8bfa7b874dca565552f371bb..d426914a23d67d067a25aca6b18b67682077ddbc 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/ExceptionState.h
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ExceptionState.h
|
| @@ -104,18 +104,22 @@ class CORE_EXPORT ExceptionState {
|
| }
|
| }
|
|
|
| + virtual bool shouldThrow() const;
|
| +
|
| + // const char* versions to avoid code bloat from inlined temporary Strings.
|
| void throwDOMException(ExceptionCode, const char* message);
|
| void throwRangeError(const char* message);
|
| void throwSecurityError(const char* sanitizedMessage,
|
| const char* unsanitizedMessage = nullptr);
|
| void throwTypeError(const char* message);
|
|
|
| - virtual void throwDOMException(ExceptionCode, const String& message);
|
| - virtual void throwRangeError(const String& message);
|
| - virtual void throwSecurityError(const String& sanitizedMessage,
|
| - const String& unsanitizedMessage = String());
|
| - virtual void throwTypeError(const String& message);
|
| - virtual void rethrowV8Exception(v8::Local<v8::Value>);
|
| + void throwDOMException(ExceptionCode, const String& message);
|
| + void throwRangeError(const String& message);
|
| + void throwSecurityError(const String& sanitizedMessage,
|
| + const String& unsanitizedMessage = String());
|
| + void throwTypeError(const String& message);
|
| +
|
| + void rethrowV8Exception(v8::Local<v8::Value>);
|
|
|
| bool hadException() const { return m_code; }
|
| void clearException();
|
| @@ -146,7 +150,6 @@ class CORE_EXPORT ExceptionState {
|
|
|
| void setException(ExceptionCode, const String&, v8::Local<v8::Value>);
|
|
|
| - private:
|
| ExceptionCode m_code;
|
| ContextType m_context;
|
| String m_message;
|
| @@ -165,14 +168,11 @@ class CORE_EXPORT NonThrowableExceptionState final : public ExceptionState {
|
| NonThrowableExceptionState();
|
| NonThrowableExceptionState(const char*, int);
|
|
|
| - void throwDOMException(ExceptionCode, const String& message) override;
|
| - void throwTypeError(const String& message) override;
|
| - void throwSecurityError(const String& sanitizedMessage,
|
| - const String& unsanitizedMessage) override;
|
| - void throwRangeError(const String& message) override;
|
| - void rethrowV8Exception(v8::Local<v8::Value>) override;
|
| ExceptionState& returnThis() { return *this; }
|
|
|
| + // ExceptionState overrides:
|
| + bool shouldThrow() const override;
|
| +
|
| private:
|
| const char* m_file;
|
| const int m_line;
|
| @@ -201,19 +201,12 @@ class CORE_EXPORT DummyExceptionStateForTesting final : public ExceptionState {
|
| ExceptionState::UnknownContext,
|
| nullptr,
|
| nullptr) {}
|
| - ~DummyExceptionStateForTesting() {
|
| - // Prevent the base class throw an exception.
|
| - if (hadException()) {
|
| - clearException();
|
| - }
|
| - }
|
| - void throwDOMException(ExceptionCode, const String& message) override;
|
| - void throwTypeError(const String& message) override;
|
| - void throwSecurityError(const String& sanitizedMessage,
|
| - const String& unsanitizedMessage) override;
|
| - void throwRangeError(const String& message) override;
|
| - void rethrowV8Exception(v8::Local<v8::Value>) override;
|
| + ~DummyExceptionStateForTesting() {}
|
| +
|
| ExceptionState& returnThis() { return *this; }
|
| +
|
| + // ExceptionState overrides:
|
| + bool shouldThrow() const override;
|
| };
|
|
|
| // Syntax sugar for DummyExceptionStateForTesting.
|
|
|