Skip to content

Commit 9ae0a78

Browse files
authored
Update SharedBuffer.md
1 parent 6750146 commit 9ae0a78

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

specs/SharedBuffer.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The script code will look like this:
6060
6161
function SharedBufferReceived(e) {
6262
if (e.additionalData && e.additionalData.contosoBufferKind == "contosoDisplayBuffer") {
63-
let displayBuffer = e.buffer;
63+
let displayBuffer = e.getBuffer();
6464
// Consume the data from the buffer (in the form of an ArrayBuffer)
6565
let displayBufferArray = new Uint8Array(displayBuffer);
6666
DisplaySharedBufferData(displayBufferArray);
@@ -142,7 +142,7 @@ The script code will look like this:
142142
if (displayBuffer)
143143
chrome.webview.releaseBuffer(displayBuffer);
144144
// Hold the shared buffer and the typed array view of it.
145-
displayBuffer = e.buffer;
145+
displayBuffer = e.getBuffer();
146146
displayBufferArray = new Uint8Array(displayBuffer);
147147
}
148148
});
@@ -349,8 +349,8 @@ typedef enum COREWEBVIEW2_SHARED_BUFFER_ACCESS {
349349
interface ICoreWebView2_14 : IUnknown {
350350
/// Share a shared buffer object with script of the main frame in the WebView.
351351
/// The script will receive a `SharedBufferReceived` event from chrome.webview.
352-
/// The event arg for that event will have the following properties:
353-
/// `buffer()`: an ArrayBuffer object with the backing content from the shared buffer.
352+
/// The event arg for that event will have the following methods and properties:
353+
/// `getBuffer()`: return an ArrayBuffer object with the backing content from the shared buffer.
354354
/// `additionalData`: an object as the result of parsing `additionalDataAsJson` as JSON string.
355355
/// This property will be `undefined` if `additionalDataAsJson` is nullptr or empty string.
356356
/// `source`: with a value set as `chrome.webview` object.
@@ -382,8 +382,8 @@ interface ICoreWebView2_14 : IUnknown {
382382
interface ICoreWebView2Frame4 : IUnknown {
383383
/// Share a shared buffer object with script of the iframe in the WebView.
384384
/// The script will receive a `SharedBufferReceived` event from chrome.webview.
385-
/// The event arg for that event will have the following properties:
386-
/// `buffer()`: an ArrayBuffer object with the backing content from the shared buffer.
385+
/// The event arg for that event will have the following methods and properties:
386+
/// `getBuffer()`: return an ArrayBuffer object with the backing content from the shared buffer.
387387
/// `additionalData`: an object as the result of parsing `additionalDataAsJson` as JSON string.
388388
/// This property will be `undefined` if `additionalDataAsJson` is nullptr or empty string.
389389
/// `source`: with a value set as `chrome.webview` object.

0 commit comments

Comments
 (0)