mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
7792722d19
<!-- Please describe your changes on the following line: --> Combines #17892 with the patch to detach style_traits from webrender_api --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #17907 <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ new logic is added <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: e5527362f761ad082ca37a033bf5c3f8f196bcfb --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : f3e194197216c30c7f7df4545233c084973a6986
57 lines
2.1 KiB
Rust
57 lines
2.1 KiB
Rust
/* 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/. */
|
|
|
|
#![deny(unsafe_code)]
|
|
|
|
extern crate gfx;
|
|
extern crate ipc_channel;
|
|
extern crate metrics;
|
|
extern crate msg;
|
|
extern crate net_traits;
|
|
extern crate profile_traits;
|
|
extern crate script_traits;
|
|
extern crate servo_url;
|
|
extern crate webrender_api;
|
|
|
|
// This module contains traits in layout used generically
|
|
// in the rest of Servo.
|
|
// The traits are here instead of in layout so
|
|
// that these modules won't have to depend on layout.
|
|
|
|
use gfx::font_cache_thread::FontCacheThread;
|
|
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
|
use metrics::PaintTimeMetrics;
|
|
use msg::constellation_msg::PipelineId;
|
|
use msg::constellation_msg::TopLevelBrowsingContextId;
|
|
use net_traits::image_cache::ImageCache;
|
|
use profile_traits::{mem, time};
|
|
use script_traits::{ConstellationControlMsg, LayoutControlMsg};
|
|
use script_traits::LayoutMsg as ConstellationMsg;
|
|
use servo_url::ServoUrl;
|
|
use std::sync::Arc;
|
|
use std::sync::mpsc::{Receiver, Sender};
|
|
|
|
// A static method creating a layout thread
|
|
// Here to remove the compositor -> layout dependency
|
|
pub trait LayoutThreadFactory {
|
|
type Message;
|
|
fn create(id: PipelineId,
|
|
top_level_browsing_context_id: TopLevelBrowsingContextId,
|
|
url: ServoUrl,
|
|
is_iframe: bool,
|
|
chan: (Sender<Self::Message>, Receiver<Self::Message>),
|
|
pipeline_port: IpcReceiver<LayoutControlMsg>,
|
|
constellation_chan: IpcSender<ConstellationMsg>,
|
|
script_chan: IpcSender<ConstellationControlMsg>,
|
|
image_cache: Arc<ImageCache>,
|
|
font_cache_thread: FontCacheThread,
|
|
time_profiler_chan: time::ProfilerChan,
|
|
mem_profiler_chan: mem::ProfilerChan,
|
|
content_process_shutdown_chan: Option<IpcSender<()>>,
|
|
webrender_api_sender: webrender_api::RenderApiSender,
|
|
webrender_document: webrender_api::DocumentId,
|
|
layout_threads: usize,
|
|
paint_time_metrics: PaintTimeMetrics);
|
|
}
|