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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ExceptionState.h

Issue 2718663004: Add const char* overloads to blink::ExceptionState (Closed)
Patch Set: Devirtualize Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #endif // DCHECK_IS_ON() 97 #endif // DCHECK_IS_ON()
98 } 98 }
99 99
100 ~ExceptionState() { 100 ~ExceptionState() {
101 if (!m_exception.isEmpty()) { 101 if (!m_exception.isEmpty()) {
102 V8ThrowException::throwException(m_isolate, 102 V8ThrowException::throwException(m_isolate,
103 m_exception.newLocal(m_isolate)); 103 m_exception.newLocal(m_isolate));
104 } 104 }
105 } 105 }
106 106
107 void throwDOMException(ExceptionCode, const char* message);
108 void throwRangeError(const char* message);
109 void throwSecurityError(const char* sanitizedMessage,
110 const char* unsanitizedMessage = nullptr);
111 void throwTypeError(const char* message);
112
107 virtual void throwDOMException(ExceptionCode, const String& message); 113 virtual void throwDOMException(ExceptionCode, const String& message);
108 virtual void throwRangeError(const String& message); 114 virtual void throwRangeError(const String& message);
109 virtual void throwSecurityError(const String& sanitizedMessage, 115 virtual void throwSecurityError(const String& sanitizedMessage,
110 const String& unsanitizedMessage = String()); 116 const String& unsanitizedMessage = String());
111 virtual void throwTypeError(const String& message); 117 virtual void throwTypeError(const String& message);
112 virtual void rethrowV8Exception(v8::Local<v8::Value>); 118 virtual void rethrowV8Exception(v8::Local<v8::Value>);
113 119
114 bool hadException() const { return m_code; } 120 bool hadException() const { return m_code; }
115 void clearException(); 121 void clearException();
116 122
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // Syntax sugar for DummyExceptionStateForTesting. 219 // Syntax sugar for DummyExceptionStateForTesting.
214 // This can be used as a default value of an ExceptionState parameter like this: 220 // This can be used as a default value of an ExceptionState parameter like this:
215 // 221 //
216 // Node* removeChild(Node*, ExceptionState& = IGNORE_EXCEPTION_FOR_TESTING); 222 // Node* removeChild(Node*, ExceptionState& = IGNORE_EXCEPTION_FOR_TESTING);
217 #define IGNORE_EXCEPTION_FOR_TESTING \ 223 #define IGNORE_EXCEPTION_FOR_TESTING \
218 (::blink::DummyExceptionStateForTesting().returnThis()) 224 (::blink::DummyExceptionStateForTesting().returnThis())
219 225
220 } // namespace blink 226 } // namespace blink
221 227
222 #endif // ExceptionState_h 228 #endif // ExceptionState_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698