@@ -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 {
349349interface 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 {
382382interface 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