| OLD | NEW |
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Version 6: Added indexed serialization for File, Blob, and FileList. | 65 // Version 6: Added indexed serialization for File, Blob, and FileList. |
| 66 // Version 7: Extended File serialization with user visibility. | 66 // Version 7: Extended File serialization with user visibility. |
| 67 // Version 8: File.lastModified in milliseconds (seconds-based in earlier ve
rsions.) | 67 // Version 8: File.lastModified in milliseconds (seconds-based in earlier ve
rsions.) |
| 68 // Version 9: Added Map and Set support. | 68 // Version 9: Added Map and Set support. |
| 69 static const uint32_t wireFormatVersion = 9; | 69 static const uint32_t wireFormatVersion = 9; |
| 70 | 70 |
| 71 // VarInt encoding constants. | 71 // VarInt encoding constants. |
| 72 static const int varIntShift = 7; | 72 static const int varIntShift = 7; |
| 73 static const int varIntMask = (1 << varIntShift) - 1; | 73 static const int varIntMask = (1 << varIntShift) - 1; |
| 74 | 74 |
| 75 static PassRefPtr<SerializedScriptValue> create(); |
| 76 static PassRefPtr<SerializedScriptValue> create(const String&); |
| 77 static PassRefPtr<SerializedScriptValue> create(const char* data, size_t len
gth); |
| 78 |
| 75 virtual ~SerializedScriptValue(); | 79 virtual ~SerializedScriptValue(); |
| 76 | 80 |
| 77 static PassRefPtr<SerializedScriptValue> nullValue(); | 81 static PassRefPtr<SerializedScriptValue> nullValue(); |
| 78 | 82 |
| 79 String toWireString() const { return m_data; } | 83 String toWireString() const { return m_data; } |
| 80 void toWireBytes(Vector<char>&) const; | 84 void toWireBytes(Vector<char>&) const; |
| 81 | 85 |
| 82 // Deserializes the value (in the current context). Returns a null value in | 86 // Deserializes the value (in the current context). Returns a null value in |
| 83 // case of failure. | 87 // case of failure. |
| 84 v8::Local<v8::Value> deserialize(MessagePortArray* = 0); | 88 v8::Local<v8::Value> deserialize(MessagePortArray* = 0); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 OwnPtr<ImageBitmapContentsArray> m_imageBitmapContentsArray; | 130 OwnPtr<ImageBitmapContentsArray> m_imageBitmapContentsArray; |
| 127 BlobDataHandleMap m_blobDataHandles; | 131 BlobDataHandleMap m_blobDataHandles; |
| 128 intptr_t m_externallyAllocatedMemory; | 132 intptr_t m_externallyAllocatedMemory; |
| 129 | 133 |
| 130 friend class SerializedScriptValueFactory; | 134 friend class SerializedScriptValueFactory; |
| 131 }; | 135 }; |
| 132 | 136 |
| 133 } // namespace blink | 137 } // namespace blink |
| 134 | 138 |
| 135 #endif // SerializedScriptValue_h | 139 #endif // SerializedScriptValue_h |
| OLD | NEW |