mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Change postMessage to send only one object that holds the action and data.
This commit is contained in:
parent
a3d815074d
commit
da7f555fd7
4 changed files with 70 additions and 101 deletions
|
@ -11,10 +11,9 @@ var JpegStreamProxy = (function() {
|
|||
this.dict = dict;
|
||||
|
||||
// Tell the main thread to create an image.
|
||||
postMessage("jpeg_stream");
|
||||
postMessage({
|
||||
id: this.id,
|
||||
str: bytesToString(bytes)
|
||||
action: jpeg_stream,
|
||||
data: bytesToString(bytes)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -235,12 +234,14 @@ function CanvasProxy(width, height) {
|
|||
* resets the cmdQueue.
|
||||
*/
|
||||
CanvasProxy.prototype.flush = function() {
|
||||
postMessage("canvas_proxy_cmd_queue");
|
||||
postMessage({
|
||||
id: this.id,
|
||||
cmdQueue: this.cmdQueue,
|
||||
width: this.width,
|
||||
height: this.height
|
||||
action: "canvas_proxy_cmd_queue",
|
||||
data: {
|
||||
id: this.id,
|
||||
cmdQueue: this.cmdQueue,
|
||||
width: this.width,
|
||||
height: this.height
|
||||
}
|
||||
});
|
||||
this.cmdQueue.length = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue