OLD | NEW |
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 27 matching lines...) Expand all Loading... |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 void ExceptionState::throwDOMException(ExceptionCode ec, | 40 void ExceptionState::throwDOMException(ExceptionCode ec, |
41 const String& message) { | 41 const String& message) { |
42 // SecurityError is thrown via ::throwSecurityError, and _careful_ | 42 // SecurityError is thrown via ::throwSecurityError, and _careful_ |
43 // consideration must be given to the data exposed to JavaScript via the | 43 // consideration must be given to the data exposed to JavaScript via the |
44 // 'sanitizedMessage'. | 44 // 'sanitizedMessage'. |
45 DCHECK(ec != SecurityError); | 45 DCHECK(ec != SecurityError); |
46 | 46 |
47 const String& processedMessage = addExceptionContext(message); | 47 const String& processedMessage = addExceptionContext(message); |
48 setException(ec, processedMessage, V8ThrowException::createDOMException( | 48 setException( |
49 m_isolate, ec, processedMessage)); | 49 ec, processedMessage, |
| 50 V8ThrowException::createDOMException(m_isolate, ec, processedMessage)); |
50 } | 51 } |
51 | 52 |
52 void ExceptionState::throwRangeError(const String& message) { | 53 void ExceptionState::throwRangeError(const String& message) { |
53 setException(V8RangeError, message, | 54 setException(V8RangeError, message, |
54 V8ThrowException::createRangeError( | 55 V8ThrowException::createRangeError( |
55 m_isolate, addExceptionContext(message))); | 56 m_isolate, addExceptionContext(message))); |
56 } | 57 } |
57 | 58 |
58 void ExceptionState::throwSecurityError(const String& sanitizedMessage, | 59 void ExceptionState::throwSecurityError(const String& sanitizedMessage, |
59 const String& unsanitizedMessage) { | 60 const String& unsanitizedMessage) { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 196 |
196 void DummyExceptionStateForTesting::throwTypeError(const String& message) { | 197 void DummyExceptionStateForTesting::throwTypeError(const String& message) { |
197 setException(V8TypeError, message, v8::Local<v8::Value>()); | 198 setException(V8TypeError, message, v8::Local<v8::Value>()); |
198 } | 199 } |
199 | 200 |
200 void DummyExceptionStateForTesting::rethrowV8Exception(v8::Local<v8::Value>) { | 201 void DummyExceptionStateForTesting::rethrowV8Exception(v8::Local<v8::Value>) { |
201 setException(kRethrownException, String(), v8::Local<v8::Value>()); | 202 setException(kRethrownException, String(), v8::Local<v8::Value>()); |
202 } | 203 } |
203 | 204 |
204 } // namespace blink | 205 } // namespace blink |
OLD | NEW |