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

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

Issue 2316763002: Implement v8::ValueSerializer::Delegate to throw DOMException for DataCloneError. (Closed)
Patch Set: V8ThrowException::createDOMException Created 4 years, 3 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/serialization/V8ScriptValueSerializer.h » ('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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // This method clears out the exception which |this| has. 124 // This method clears out the exception which |this| has.
125 ScriptPromise reject(ScriptState*); 125 ScriptPromise reject(ScriptState*);
126 126
127 // This method clears out the exception which |this| has. 127 // This method clears out the exception which |this| has.
128 void reject(ScriptPromiseResolver*); 128 void reject(ScriptPromiseResolver*);
129 129
130 const char* propertyName() const { return m_propertyName; } 130 const char* propertyName() const { return m_propertyName; }
131 const char* interfaceName() const { return m_interfaceName; } 131 const char* interfaceName() const { return m_interfaceName; }
132 132
133 String addExceptionContext(const String&) const;
134
133 protected: 135 protected:
134 // An ExceptionCode for the case that an exception is rethrown. In that 136 // An ExceptionCode for the case that an exception is rethrown. In that
135 // case, we cannot determine an exception code. 137 // case, we cannot determine an exception code.
136 static const int kRethrownException = UnknownError; 138 static const int kRethrownException = UnknownError;
137 139
138 void setException(ExceptionCode, const String&, v8::Local<v8::Value>); 140 void setException(ExceptionCode, const String&, v8::Local<v8::Value>);
139 141
140 private: 142 private:
141 String addExceptionContext(const String&) const;
142
143 ExceptionCode m_code; 143 ExceptionCode m_code;
144 ContextType m_context; 144 ContextType m_context;
145 String m_message; 145 String m_message;
146 const char* m_propertyName; 146 const char* m_propertyName;
147 const char* m_interfaceName; 147 const char* m_interfaceName;
148 // The exception is empty when it was thrown through TrackExceptionState. 148 // The exception is empty when it was thrown through TrackExceptionState.
149 ScopedPersistent<v8::Value> m_exception; 149 ScopedPersistent<v8::Value> m_exception;
150 v8::Isolate* m_isolate; 150 v8::Isolate* m_isolate;
151 }; 151 };
152 152
(...skipping 29 matching lines...) Expand all
182 void throwDOMException(const ExceptionCode&, const String& message) override ; 182 void throwDOMException(const ExceptionCode&, const String& message) override ;
183 void throwTypeError(const String& message) override; 183 void throwTypeError(const String& message) override;
184 void throwSecurityError(const String& sanitizedMessage, const String& unsani tizedMessage) override; 184 void throwSecurityError(const String& sanitizedMessage, const String& unsani tizedMessage) override;
185 void throwRangeError(const String& message) override; 185 void throwRangeError(const String& message) override;
186 void rethrowV8Exception(v8::Local<v8::Value>) override; 186 void rethrowV8Exception(v8::Local<v8::Value>) override;
187 }; 187 };
188 188
189 } // namespace blink 189 } // namespace blink
190 190
191 #endif // ExceptionState_h 191 #endif // ExceptionState_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698