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

Side by Side Diff: include/v8.h

Issue 2579963002: Revert of Disallow passing a SharedArrayBuffer in the transfer list. (Closed)
Patch Set: 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 /*
1726 * Allocates memory for the buffer of at least the size provided. The actual 1713 * Allocates memory for the buffer of at least the size provided. The actual
1727 * size (which may be greater or equal) is written to |actual_size|. If no 1714 * size (which may be greater or equal) is written to |actual_size|. If no
1728 * buffer has been allocated yet, nullptr will be provided. 1715 * buffer has been allocated yet, nullptr will be provided.
1729 */ 1716 */
1730 virtual void* ReallocateBufferMemory(void* old_buffer, size_t size, 1717 virtual void* ReallocateBufferMemory(void* old_buffer, size_t size,
1731 size_t* actual_size); 1718 size_t* actual_size);
1732 1719
1733 /* 1720 /*
1734 * Frees a buffer allocated with |ReallocateBufferMemory|. 1721 * Frees a buffer allocated with |ReallocateBufferMemory|.
1735 */ 1722 */
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 * Marks an ArrayBuffer as havings its contents transferred out of band. 1756 * Marks an ArrayBuffer as havings its contents transferred out of band.
1770 * Pass the corresponding JSArrayBuffer in the deserializing context to 1757 * Pass the corresponding JSArrayBuffer in the deserializing context to
1771 * ValueDeserializer::TransferArrayBuffer. 1758 * ValueDeserializer::TransferArrayBuffer.
1772 */ 1759 */
1773 void TransferArrayBuffer(uint32_t transfer_id, 1760 void TransferArrayBuffer(uint32_t transfer_id,
1774 Local<ArrayBuffer> array_buffer); 1761 Local<ArrayBuffer> array_buffer);
1775 1762
1776 /* 1763 /*
1777 * Similar to TransferArrayBuffer, but for SharedArrayBuffer. 1764 * Similar to TransferArrayBuffer, but for SharedArrayBuffer.
1778 */ 1765 */
1779 V8_DEPRECATE_SOON("Use Delegate::GetSharedArrayBufferId", 1766 void TransferSharedArrayBuffer(uint32_t transfer_id,
1780 void TransferSharedArrayBuffer( 1767 Local<SharedArrayBuffer> shared_array_buffer);
1781 uint32_t transfer_id,
1782 Local<SharedArrayBuffer> shared_array_buffer));
1783 1768
1784 /* 1769 /*
1785 * Write raw data in various common formats to the buffer. 1770 * Write raw data in various common formats to the buffer.
1786 * Note that integer types are written in base-128 varint format, not with a 1771 * Note that integer types are written in base-128 varint format, not with a
1787 * binary copy. For use during an override of Delegate::WriteHostObject. 1772 * binary copy. For use during an override of Delegate::WriteHostObject.
1788 */ 1773 */
1789 void WriteUint32(uint32_t value); 1774 void WriteUint32(uint32_t value);
1790 void WriteUint64(uint64_t value); 1775 void WriteUint64(uint64_t value);
1791 void WriteDouble(double value); 1776 void WriteDouble(double value);
1792 void WriteRawBytes(const void* source, size_t length); 1777 void WriteRawBytes(const void* source, size_t length);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 1824
1840 /* 1825 /*
1841 * Accepts the array buffer corresponding to the one passed previously to 1826 * Accepts the array buffer corresponding to the one passed previously to
1842 * ValueSerializer::TransferArrayBuffer. 1827 * ValueSerializer::TransferArrayBuffer.
1843 */ 1828 */
1844 void TransferArrayBuffer(uint32_t transfer_id, 1829 void TransferArrayBuffer(uint32_t transfer_id,
1845 Local<ArrayBuffer> array_buffer); 1830 Local<ArrayBuffer> array_buffer);
1846 1831
1847 /* 1832 /*
1848 * Similar to TransferArrayBuffer, but for SharedArrayBuffer. 1833 * Similar to TransferArrayBuffer, but for SharedArrayBuffer.
1849 * The id is not necessarily in the same namespace as unshared ArrayBuffer 1834 * transfer_id exists in the same namespace as unshared ArrayBuffer objects.
1850 * objects.
1851 */ 1835 */
1852 void TransferSharedArrayBuffer(uint32_t id, 1836 void TransferSharedArrayBuffer(uint32_t transfer_id,
1853 Local<SharedArrayBuffer> shared_array_buffer); 1837 Local<SharedArrayBuffer> shared_array_buffer);
1854 1838
1855 /* 1839 /*
1856 * Must be called before ReadHeader to enable support for reading the legacy 1840 * Must be called before ReadHeader to enable support for reading the legacy
1857 * wire format (i.e., which predates this being shipped). 1841 * wire format (i.e., which predates this being shipped).
1858 * 1842 *
1859 * Don't use this unless you need to read data written by previous versions of 1843 * Don't use this unless you need to read data written by previous versions of
1860 * blink::ScriptValueSerializer. 1844 * blink::ScriptValueSerializer.
1861 */ 1845 */
1862 void SetSupportsLegacyWireFormat(bool supports_legacy_wire_format); 1846 void SetSupportsLegacyWireFormat(bool supports_legacy_wire_format);
(...skipping 7857 matching lines...) Expand 10 before | Expand all | Expand 10 after
9720 */ 9704 */
9721 9705
9722 9706
9723 } // namespace v8 9707 } // namespace v8
9724 9708
9725 9709
9726 #undef TYPE_CHECK 9710 #undef TYPE_CHECK
9727 9711
9728 9712
9729 #endif // INCLUDE_V8_H_ 9713 #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