Files
firefox/devtools/shared/client/array-buffer-client.js
T
Nicolas Chevobbe 9518aed487 Bug 1403895 - split main.js in mulitple files; r=ochameau.
This patch keeps the main.js file so  we don't have to change
consumer code that uses objects fom this file.

MozReview-Commit-ID: KhFoPPApE2L
2017-09-28 17:29:55 +02:00

44 lines
1.0 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {arg, DebuggerClient} = require("./debugger-client");
/**
* A ArrayBufferClient provides a way to access ArrayBuffer from the
* debugger server.
*
* @param client DebuggerClient
* The debugger client parent.
* @param grip Object
* A pause-lifetime ArrayBuffer grip returned by the protocol.
*/
function ArrayBufferClient(client, grip) {
this._grip = grip;
this._client = client;
this.request = this._client.request;
}
ArrayBufferClient.prototype = {
get actor() {
return this._grip.actor;
},
get length() {
return this._grip.length;
},
get _transport() {
return this._client._transport;
},
valid: true,
slice: DebuggerClient.requester({
type: "slice",
start: arg(0),
count: arg(1)
}),
};
module.exports = ArrayBufferClient;