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

Side by Side Diff: include/v8.h

Issue 2570433005: Disallow passing a SharedArrayBuffer in the transfer list. (Closed)
Patch Set: TransferSharedArrayBuffer -> GetSharedArrayBufferId Created 4 years 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 virtual void ThrowDataCloneError(Local<String> message) = 0; 1703 virtual void ThrowDataCloneError(Local<String> message) = 0;
1704 1704
1705 /* 1705 /*
1706 * The embedder overrides this method to write some kind of host object, if 1706 * The embedder overrides this method to write some kind of host object, if
1707 * possible. If not, a suitable exception should be thrown and 1707 * possible. If not, a suitable exception should be thrown and
1708 * Nothing<bool>() returned. 1708 * Nothing<bool>() returned.
1709 */ 1709 */
1710 virtual Maybe<bool> WriteHostObject(Isolate* isolate, Local<Object> object); 1710 virtual Maybe<bool> WriteHostObject(Isolate* isolate, Local<Object> object);
1711 1711
1712 /* 1712 /*
1713 * Called when the ValueSerializer is going to serialize a
1714 * SharedArrayBuffer object. The embedder must return an ID for the
1715 * object, using the same ID if this SharedArrayBuffer has already been
1716 * serialized in this buffer. When deserializing, this ID will be passed to
1717 * ValueDeserializer::TransferSharedArrayBuffer as |transfer_id|.
1718 *
1719 * If the object cannot be serialized, an
1720 * exception should be thrown and Nothing<uint32_t>() returned.
1721 */
1722 virtual Maybe<uint32_t> GetSharedArrayBufferId(
1723 Isolate* isolate, Local<SharedArrayBuffer> shared_array_buffer);
1724
1725 /*
1713 * Allocates memory for the buffer of at least the size provided. The actual 1726 * Allocates memory for the buffer of at least the size provided. The actual
1714 * size (which may be greater or equal) is written to |actual_size|. If no 1727 * size (which may be greater or equal) is written to |actual_size|. If no
1715 * buffer has been allocated yet, nullptr will be provided. 1728 * buffer has been allocated yet, nullptr will be provided.
1716 */ 1729 */
1717 virtual void* ReallocateBufferMemory(void* old_buffer, size_t size, 1730 virtual void* ReallocateBufferMemory(void* old_buffer, size_t size,
1718 size_t* actual_size); 1731 size_t* actual_size);
1719 1732
1720 /* 1733 /*
1721 * Frees a buffer allocated with |ReallocateBufferMemory|. 1734 * Frees a buffer allocated with |ReallocateBufferMemory|.
1722 */ 1735 */
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 * Marks an ArrayBuffer as havings its contents transferred out of band. 1769 * Marks an ArrayBuffer as havings its contents transferred out of band.
1757 * Pass the corresponding JSArrayBuffer in the deserializing context to 1770 * Pass the corresponding JSArrayBuffer in the deserializing context to
1758 * ValueDeserializer::TransferArrayBuffer. 1771 * ValueDeserializer::TransferArrayBuffer.
1759 */ 1772 */
1760 void TransferArrayBuffer(uint32_t transfer_id, 1773 void TransferArrayBuffer(uint32_t transfer_id,
1761 Local<ArrayBuffer> array_buffer); 1774 Local<ArrayBuffer> array_buffer);
1762 1775
1763 /* 1776 /*
1764 * Similar to TransferArrayBuffer, but for SharedArrayBuffer. 1777 * Similar to TransferArrayBuffer, but for SharedArrayBuffer.
1765 */ 1778 */
1766 void TransferSharedArrayBuffer(uint32_t transfer_id, 1779 V8_DEPRECATE_SOON("Use Delegate::GetSharedArrayBufferId",
1767 Local<SharedArrayBuffer> shared_array_buffer); 1780 void TransferSharedArrayBuffer(
1781 uint32_t transfer_id,
1782 Local<SharedArrayBuffer> shared_array_buffer));
1768 1783
1769 /* 1784 /*
1770 * Write raw data in various common formats to the buffer. 1785 * Write raw data in various common formats to the buffer.
1771 * Note that integer types are written in base-128 varint format, not with a 1786 * Note that integer types are written in base-128 varint format, not with a
1772 * binary copy. For use during an override of Delegate::WriteHostObject. 1787 * binary copy. For use during an override of Delegate::WriteHostObject.
1773 */ 1788 */
1774 void WriteUint32(uint32_t value); 1789 void WriteUint32(uint32_t value);
1775 void WriteUint64(uint64_t value); 1790 void WriteUint64(uint64_t value);
1776 void WriteDouble(double value); 1791 void WriteDouble(double value);
1777 void WriteRawBytes(const void* source, size_t length); 1792 void WriteRawBytes(const void* source, size_t length);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 1839
1825 /* 1840 /*
1826 * Accepts the array buffer corresponding to the one passed previously to 1841 * Accepts the array buffer corresponding to the one passed previously to
1827 * ValueSerializer::TransferArrayBuffer. 1842 * ValueSerializer::TransferArrayBuffer.
1828 */ 1843 */
1829 void TransferArrayBuffer(uint32_t transfer_id, 1844 void TransferArrayBuffer(uint32_t transfer_id,
1830 Local<ArrayBuffer> array_buffer); 1845 Local<ArrayBuffer> array_buffer);
1831 1846
1832 /* 1847 /*
1833 * Similar to TransferArrayBuffer, but for SharedArrayBuffer. 1848 * Similar to TransferArrayBuffer, but for SharedArrayBuffer.
1834 * transfer_id exists in the same namespace as unshared ArrayBuffer objects. 1849 * The id is not necessarily in the same namespace as unshared ArrayBuffer
1850 * objects.
1835 */ 1851 */
1836 void TransferSharedArrayBuffer(uint32_t transfer_id, 1852 void TransferSharedArrayBuffer(uint32_t id,
1837 Local<SharedArrayBuffer> shared_array_buffer); 1853 Local<SharedArrayBuffer> shared_array_buffer);
1838 1854
1839 /* 1855 /*
1840 * Must be called before ReadHeader to enable support for reading the legacy 1856 * Must be called before ReadHeader to enable support for reading the legacy
1841 * wire format (i.e., which predates this being shipped). 1857 * wire format (i.e., which predates this being shipped).
1842 * 1858 *
1843 * Don't use this unless you need to read data written by previous versions of 1859 * Don't use this unless you need to read data written by previous versions of
1844 * blink::ScriptValueSerializer. 1860 * blink::ScriptValueSerializer.
1845 */ 1861 */
1846 void SetSupportsLegacyWireFormat(bool supports_legacy_wire_format); 1862 void SetSupportsLegacyWireFormat(bool supports_legacy_wire_format);
(...skipping 7857 matching lines...) Expand 10 before | Expand all | Expand 10 after
9704 */ 9720 */
9705 9721
9706 9722
9707 } // namespace v8 9723 } // namespace v8
9708 9724
9709 9725
9710 #undef TYPE_CHECK 9726 #undef TYPE_CHECK
9711 9727
9712 9728
9713 #endif // INCLUDE_V8_H_ 9729 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698