Use ByteBuf for the canvas messages

The type Vec<u8> is super unefficient to work with in Serde if all you want
to represent is a simple blob.
This commit is contained in:
Anthony Ramine 2018-03-23 18:41:32 +01:00
parent 3ce3f39383
commit ce81420bef
19 changed files with 170 additions and 62 deletions

View file

@ -35,6 +35,7 @@ use ipc_channel::ipc::IpcSender;
use profile_traits::ipc;
use script_runtime::CommonScriptMsg;
use script_runtime::ScriptThreadEventCategory::WebVREvent;
use serde_bytes::ByteBuf;
use std::cell::Cell;
use std::mem;
use std::ops::Deref;
@ -68,7 +69,7 @@ pub struct VRDisplay {
// Compositor VRFrameData synchonization
frame_data_status: Cell<VRFrameDataStatus>,
#[ignore_malloc_size_of = "closures are hard"]
frame_data_receiver: DomRefCell<Option<WebGLReceiver<Result<Vec<u8>, ()>>>>,
frame_data_receiver: DomRefCell<Option<WebGLReceiver<Result<ByteBuf, ()>>>>,
running_display_raf: Cell<bool>,
paused: Cell<bool>,
stopped_on_pause: Cell<bool>,