aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/compositor_interface.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/compositor_interface.rs')
-rw-r--r--src/components/script/compositor_interface.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/script/compositor_interface.rs b/src/components/script/compositor_interface.rs
new file mode 100644
index 00000000000..78e74f5fee1
--- /dev/null
+++ b/src/components/script/compositor_interface.rs
@@ -0,0 +1,19 @@
+/* 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/. */
+
+//! The high-level interface from script to compositor. Using this abstract interface helps reduce
+/// coupling between these two components
+
+pub enum ReadyState {
+ /// Informs the compositor that a page is loading. Used for setting status
+ Loading,
+ /// Informs the compositor that a page is rendering. Used for setting status
+ Rendering,
+ /// Informs the compositor that a page is finished loading. Used for setting status
+ FinishedLoading,
+}
+
+pub trait CompositorInterface: Clone {
+ fn send_compositor_msg(&self, ReadyState);
+}