Move media backend initialization to process startup.

This commit is contained in:
Josh Matthews 2019-03-29 15:31:01 -04:00
parent 17204544d9
commit eebd831ea5
8 changed files with 12 additions and 11 deletions

View file

@ -103,6 +103,8 @@ use profile_traits::time;
use script_traits::{ConstellationMsg, SWManagerSenders, ScriptToConstellationChan};
use servo_config::opts;
use servo_config::{pref, prefs};
use servo_media::ServoMedia;
use servo_media_auto::Backend;
use std::borrow::Cow;
use std::cmp::max;
use std::path::PathBuf;
@ -182,6 +184,10 @@ where
// Global configuration options, parsed from the command line.
let opts = opts::get();
if !opts.multiprocess {
ServoMedia::init::<Backend>();
}
// Make sure the gl context is made current.
window.prepare_for_composite();
@ -751,6 +757,8 @@ pub fn run_content_process(token: String) {
script::init();
script::init_service_workers(sw_senders);
ServoMedia::init::<Backend>();
unprivileged_content.start_all::<script_layout_interface::message::Msg,
layout_thread::LayoutThread,
script::script_thread::ScriptThread>(