@@ -60,7 +60,7 @@ The script code will look like this:
60
60
61
61
function SharedBufferReceived(e) {
62
62
if (e.additionalData && e.additionalData.contosoBufferKind == "contosoDisplayBuffer") {
63
- let displayBuffer = e.buffer ;
63
+ let displayBuffer = e.getBuffer() ;
64
64
// Consume the data from the buffer (in the form of an ArrayBuffer)
65
65
let displayBufferArray = new Uint8Array(displayBuffer);
66
66
DisplaySharedBufferData(displayBufferArray);
@@ -142,7 +142,7 @@ The script code will look like this:
142
142
if (displayBuffer)
143
143
chrome.webview.releaseBuffer(displayBuffer);
144
144
// Hold the shared buffer and the typed array view of it.
145
- displayBuffer = e.buffer ;
145
+ displayBuffer = e.getBuffer() ;
146
146
displayBufferArray = new Uint8Array(displayBuffer);
147
147
}
148
148
});
@@ -349,8 +349,8 @@ typedef enum COREWEBVIEW2_SHARED_BUFFER_ACCESS {
349
349
interface ICoreWebView2_14 : IUnknown {
350
350
/// Share a shared buffer object with script of the main frame in the WebView.
351
351
/// 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.
354
354
/// `additionalData`: an object as the result of parsing `additionalDataAsJson` as JSON string.
355
355
/// This property will be `undefined` if `additionalDataAsJson` is nullptr or empty string.
356
356
/// `source`: with a value set as `chrome.webview` object.
@@ -382,8 +382,8 @@ interface ICoreWebView2_14 : IUnknown {
382
382
interface ICoreWebView2Frame4 : IUnknown {
383
383
/// Share a shared buffer object with script of the iframe in the WebView.
384
384
/// 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.
387
387
/// `additionalData`: an object as the result of parsing `additionalDataAsJson` as JSON string.
388
388
/// This property will be `undefined` if `additionalDataAsJson` is nullptr or empty string.
389
389
/// `source`: with a value set as `chrome.webview` object.
0 commit comments