OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef V8ThrowDOMException_h | |
6 #define V8ThrowDOMException_h | |
7 | |
8 #include "core/CoreExport.h" | |
9 #include "core/dom/ExceptionCode.h" | |
10 #include "platform/wtf/Allocator.h" | |
11 #include "platform/wtf/text/WTFString.h" | |
12 #include "v8/include/v8.h" | |
13 | |
14 namespace blink { | |
15 | |
16 class CORE_EXPORT V8ThrowDOMException { | |
haraken
2017/04/19 22:15:10
Add a class-level comment?
| |
17 STATIC_ONLY(V8ThrowDOMException); | |
18 | |
19 public: | |
20 // Creates and returns an exception object, or returns an empty handle if | |
21 // failed. |unsanitizedMessage| should not be specified unless it's | |
22 // SecurityError. | |
23 static v8::Local<v8::Value> CreateDOMException( | |
24 v8::Isolate*, | |
25 ExceptionCode, | |
26 const String& sanitized_message, | |
27 const String& unsanitized_message = String()); | |
28 | |
29 // Creates and throws an exception object, or does nothing if creation of the | |
30 // DOMException fails. |unsanitizedMessage| should not be specified unless | |
31 // it's SecurityError. | |
32 static void ThrowDOMException(v8::Isolate*, | |
33 ExceptionCode, | |
34 const String& sanitized_message, | |
35 const String& unsanitized_message = String()); | |
36 }; | |
37 | |
38 } // namespace blink | |
39 | |
40 #endif // V8ThrowDOMException_h | |
OLD | NEW |