Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8ThrowDOMException.h |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ThrowDOMException.h b/third_party/WebKit/Source/bindings/core/v8/V8ThrowDOMException.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..17f03e7e9ebbc9ef9468d49cc808927c68baabb7 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8ThrowDOMException.h |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef V8ThrowDOMException_h |
| +#define V8ThrowDOMException_h |
| + |
| +#include "core/CoreExport.h" |
| +#include "core/dom/ExceptionCode.h" |
| +#include "platform/wtf/Allocator.h" |
| +#include "platform/wtf/text/WTFString.h" |
| +#include "v8/include/v8.h" |
| + |
| +namespace blink { |
| + |
| +class CORE_EXPORT V8ThrowDOMException { |
|
haraken
2017/04/19 22:15:10
Add a class-level comment?
|
| + STATIC_ONLY(V8ThrowDOMException); |
| + |
| + public: |
| + // Creates and returns an exception object, or returns an empty handle if |
| + // failed. |unsanitizedMessage| should not be specified unless it's |
| + // SecurityError. |
| + static v8::Local<v8::Value> CreateDOMException( |
| + v8::Isolate*, |
| + ExceptionCode, |
| + const String& sanitized_message, |
| + const String& unsanitized_message = String()); |
| + |
| + // Creates and throws an exception object, or does nothing if creation of the |
| + // DOMException fails. |unsanitizedMessage| should not be specified unless |
| + // it's SecurityError. |
| + static void ThrowDOMException(v8::Isolate*, |
| + ExceptionCode, |
| + const String& sanitized_message, |
| + const String& unsanitized_message = String()); |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // V8ThrowDOMException_h |