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

Unified Diff: src/value-serializer.h

Issue 2307603002: Throw exceptions for errors in v8::ValueSerializer. (Closed)
Patch Set: fix comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.h ('k') | src/value-serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/value-serializer.h
diff --git a/src/value-serializer.h b/src/value-serializer.h
index 93fc15166d4d0b375039b6e548d2c324011c8950..382370ff2f440a66e3108f679d4ae63a6f70f59c 100644
--- a/src/value-serializer.h
+++ b/src/value-serializer.h
@@ -12,6 +12,7 @@
#include "src/base/compiler-specific.h"
#include "src/base/macros.h"
#include "src/identity-map.h"
+#include "src/messages.h"
#include "src/vector.h"
#include "src/zone.h"
@@ -41,7 +42,7 @@ enum class SerializationTag : uint8_t;
*/
class ValueSerializer {
public:
- explicit ValueSerializer(Isolate* isolate);
+ ValueSerializer(Isolate* isolate, v8::ValueSerializer::Delegate* delegate);
~ValueSerializer();
/*
@@ -105,7 +106,16 @@ class ValueSerializer {
Maybe<uint32_t> WriteJSObjectProperties(
Handle<JSObject> object, Handle<FixedArray> keys) WARN_UNUSED_RESULT;
+ /*
+ * Asks the delegate to handle an error that occurred during data cloning, by
+ * throwing an exception appropriate for the host.
+ */
+ void ThrowDataCloneError(MessageTemplate::Template template_index);
+ V8_NOINLINE void ThrowDataCloneError(MessageTemplate::Template template_index,
+ Handle<Object> arg0);
+
Isolate* const isolate_;
+ v8::ValueSerializer::Delegate* const delegate_;
std::vector<uint8_t> buffer_;
Zone zone_;
« no previous file with comments | « src/messages.h ('k') | src/value-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698