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

Side by Side Diff: Source/bindings/v8/SerializedScriptValue.h

Issue 195543002: [webcrypto] Implement structured clone of keys (blink-side). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update serialized-script-value.html for version bump Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray; 53 typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray;
54 typedef Vector<RefPtr<WTF::ArrayBuffer>, 1> ArrayBufferArray; 54 typedef Vector<RefPtr<WTF::ArrayBuffer>, 1> ArrayBufferArray;
55 typedef HashMap<String, RefPtr<BlobDataHandle> > BlobDataHandleMap; 55 typedef HashMap<String, RefPtr<BlobDataHandle> > BlobDataHandleMap;
56 56
57 class SerializedScriptValue FINAL : public ThreadSafeRefCounted<SerializedScript Value> { 57 class SerializedScriptValue FINAL : public ThreadSafeRefCounted<SerializedScript Value> {
58 public: 58 public:
59 // Increment this for each incompatible change to the wire format. 59 // Increment this for each incompatible change to the wire format.
60 // Version 2: Added StringUCharTag for UChar v8 strings. 60 // Version 2: Added StringUCharTag for UChar v8 strings.
61 // Version 3: Switched to using uuids as blob data identifiers. 61 // Version 3: Switched to using uuids as blob data identifiers.
62 // Version 4: Extended File serialization to be complete. 62 // Version 4: Extended File serialization to be complete.
63 static const uint32_t wireFormatVersion = 4; 63 // Version 5: Added CryptoKeyTag for Key objects.
64 static const uint32_t wireFormatVersion = 5;
64 65
65 ~SerializedScriptValue(); 66 ~SerializedScriptValue();
66 67
67 // If a serialization error occurs (e.g., cyclic input value) this 68 // If a serialization error occurs (e.g., cyclic input value) this
68 // function returns an empty representation, schedules a V8 exception to 69 // function returns an empty representation, schedules a V8 exception to
69 // be thrown using v8::ThrowException(), and sets |didThrow|. In this case 70 // be thrown using v8::ThrowException(), and sets |didThrow|. In this case
70 // the caller must not invoke any V8 operations until control returns to 71 // the caller must not invoke any V8 operations until control returns to
71 // V8. When serialization is successful, |didThrow| is false. 72 // V8. When serialization is successful, |didThrow| is false.
72 static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, Messa gePortArray*, ArrayBufferArray*, ExceptionState&, v8::Isolate*); 73 static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, Messa gePortArray*, ArrayBufferArray*, ExceptionState&, v8::Isolate*);
73 static PassRefPtr<SerializedScriptValue> createFromWire(const String&); 74 static PassRefPtr<SerializedScriptValue> createFromWire(const String&);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 123
123 String m_data; 124 String m_data;
124 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray; 125 OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray;
125 BlobDataHandleMap m_blobDataHandles; 126 BlobDataHandleMap m_blobDataHandles;
126 intptr_t m_externallyAllocatedMemory; 127 intptr_t m_externallyAllocatedMemory;
127 }; 128 };
128 129
129 } // namespace WebCore 130 } // namespace WebCore
130 131
131 #endif // SerializedScriptValue_h 132 #endif // SerializedScriptValue_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/storage/resources/serialized-script-value.js ('k') | Source/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698