Skip to content

Commit

Permalink
Send message to profiler if layout is busy
Browse files Browse the repository at this point in the history
  • Loading branch information
pylbrecht committed Apr 8, 2019
1 parent 3e60918 commit 1beeef5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions components/script/dom/window.rs
Expand Up @@ -92,7 +92,7 @@ use net_traits::{ReferrerPolicy, ResourceThreads};
use num_traits::ToPrimitive;
use profile_traits::ipc as ProfiledIpc;
use profile_traits::mem::ProfilerChan as MemProfilerChan;
use profile_traits::time::ProfilerChan as TimeProfilerChan;
use profile_traits::time::{ProfilerChan as TimeProfilerChan, ProfilerMsg};
use script_layout_interface::message::{Msg, QueryMsg, Reflow, ReflowGoal, ScriptReflow};
use script_layout_interface::rpc::{ContentBoxResponse, ContentBoxesResponse, LayoutRPC};
use script_layout_interface::rpc::{
Expand Down Expand Up @@ -1563,9 +1563,9 @@ impl Window {

pub fn layout_reflow(&self, query_msg: QueryMsg) -> bool {
if self.layout_is_busy.load(Ordering::Relaxed) {
// TODO(pylbrecht)
// send message to profiler that layout thread is busy
panic!("TODO(pylbrecht): layout thread is busy");
let url = self.get_url().into_string();
self.time_profiler_chan()
.send(ProfilerMsg::BlockedLayoutQuery(url));
}

self.reflow(
Expand Down
2 changes: 1 addition & 1 deletion components/script/script_thread.rs
Expand Up @@ -219,7 +219,7 @@ impl InProgressLoad {
window_size: WindowSizeData,
url: ServoUrl,
origin: MutableOrigin,
layout_is_busy: Arc<AtomicBool>
layout_is_busy: Arc<AtomicBool>,
) -> InProgressLoad {
let current_time = get_time();
let navigation_start_precise = precise_time_ns();
Expand Down
2 changes: 1 addition & 1 deletion components/script_layout_interface/message.rs
Expand Up @@ -19,8 +19,8 @@ use script_traits::{ScrollState, UntrustedNodeAddress, WindowSizeData};
use servo_arc::Arc as ServoArc;
use servo_atoms::Atom;
use servo_url::ServoUrl;
use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use style::context::QuirksMode;
use style::dom::OpaqueNode;
use style::properties::PropertyId;
Expand Down

0 comments on commit 1beeef5

Please sign in to comment.