Chromium Code Reviews| 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 13 matching lines...) Expand all Loading... | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebSerializedScriptValueVersion_h | 31 #ifndef WebSerializedScriptValueVersion_h |
| 32 #define WebSerializedScriptValueVersion_h | 32 #define WebSerializedScriptValueVersion_h |
| 33 | 33 |
| 34 #include <cstdint> | |
| 35 | |
| 36 #include "third_party/WebKit/public/platform/WebCommon.h" | |
| 37 | |
| 34 namespace blink { | 38 namespace blink { |
| 35 | 39 |
| 36 // SerializedScriptValue wire format version. Versions higher than | 40 // The currently supported version data for serialized script values. |
| 37 // this value will not be deserializable by WebSerializedScriptValue. | 41 // This is the version that will be written. Values can be read only if they |
| 38 // Embedders may serialize this as out-of-band metadata along with | 42 // were written by a serializer for which both |v8_version| and |blink_version| |
| 39 // collections of serialized data so that version skew can be detected | 43 // were less than or equal to the current version. |
| 40 // before deserializing individual values. | 44 // |
| 41 const unsigned kSerializedScriptValueVersion = 16; | 45 // Versions higher than |current()| will not be deserializable by |
| 46 // WebSerializedScriptValue. Embedders may serialize this as out-of-band | |
| 47 // metadata along with collections of serialized data so that version skew can | |
| 48 // be detected before deserializing individual values. | |
| 49 // | |
| 50 // In general, both versions should monotonically increase. | |
| 51 struct WebSerializedScriptValueVersion { | |
| 52 uint32_t v8Version = 0; | |
|
cmumford
2017/04/05 21:23:18
v8 has a major and minor version (V8_MAJOR_VERSION
jbroman
2017/04/05 21:27:10
V8 has a wire format version, which is analogous t
| |
| 53 uint32_t blinkVersion = 0; | |
| 54 | |
| 55 BLINK_EXPORT static WebSerializedScriptValueVersion current(); | |
| 56 }; | |
| 42 | 57 |
| 43 } // namespace blink | 58 } // namespace blink |
| 44 | 59 |
| 45 #endif // WebSerializedScriptValueVersion_h | 60 #endif // WebSerializedScriptValueVersion_h |
| OLD | NEW |