| 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> serialize(v8::Isolate*, v8::Local<v
8::Value>, Transferables*, WebBlobInfoArray*, ExceptionState&); |
| 76 static PassRefPtr<SerializedScriptValue> serialize(const String&); |
| 77 static PassRefPtr<SerializedScriptValue> serializeAndSwallowExceptions(v8::I
solate*, v8::Local<v8::Value>); |
| 78 |
| 79 // TODO(peria): Make these create()s private. |
| 75 static PassRefPtr<SerializedScriptValue> create(); | 80 static PassRefPtr<SerializedScriptValue> create(); |
| 76 static PassRefPtr<SerializedScriptValue> create(const String&); | 81 static PassRefPtr<SerializedScriptValue> create(const String&); |
| 77 static PassRefPtr<SerializedScriptValue> create(const char* data, size_t len
gth); | 82 static PassRefPtr<SerializedScriptValue> create(const char* data, size_t len
gth); |
| 78 | 83 |
| 79 virtual ~SerializedScriptValue(); | 84 virtual ~SerializedScriptValue(); |
| 80 | 85 |
| 81 static PassRefPtr<SerializedScriptValue> nullValue(); | 86 static PassRefPtr<SerializedScriptValue> nullValue(); |
| 82 | 87 |
| 83 String toWireString() const { return m_data; } | 88 String toWireString() const { return m_data; } |
| 84 void toWireBytes(Vector<char>&) const; | 89 void toWireBytes(Vector<char>&) const; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 OwnPtr<ImageBitmapContentsArray> m_imageBitmapContentsArray; | 135 OwnPtr<ImageBitmapContentsArray> m_imageBitmapContentsArray; |
| 131 BlobDataHandleMap m_blobDataHandles; | 136 BlobDataHandleMap m_blobDataHandles; |
| 132 intptr_t m_externallyAllocatedMemory; | 137 intptr_t m_externallyAllocatedMemory; |
| 133 | 138 |
| 134 friend class SerializedScriptValueFactory; | 139 friend class SerializedScriptValueFactory; |
| 135 }; | 140 }; |
| 136 | 141 |
| 137 } // namespace blink | 142 } // namespace blink |
| 138 | 143 |
| 139 #endif // SerializedScriptValue_h | 144 #endif // SerializedScriptValue_h |
| OLD | NEW |