aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2017-02-14 16:06:28 -0600
committerAlan Jeffrey <ajeffrey@mozilla.com>2017-03-15 14:57:25 -0500
commitf9c5d0c1175fe52ceed8f81ba4999cdad7002b56 (patch)
treeb49a74f418a95d2c35469bb30e19d9acc7d03d84 /components/script_traits
parentf5c67fda04195bd6d8ef10a73b9158eb60dbd6d7 (diff)
downloadservo-f9c5d0c1175fe52ceed8f81ba4999cdad7002b56.tar.gz
servo-f9c5d0c1175fe52ceed8f81ba4999cdad7002b56.zip
Implement dissimilar-origin postMessage.
Diffstat (limited to 'components/script_traits')
-rw-r--r--components/script_traits/lib.rs4
-rw-r--r--components/script_traits/script_msg.rs3
2 files changed, 7 insertions, 0 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index a1d97b8b232..96042083d39 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -63,6 +63,7 @@ use net_traits::storage_thread::StorageType;
use profile_traits::mem;
use profile_traits::time as profile_time;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
+use servo_url::ImmutableOrigin;
use servo_url::ServoUrl;
use std::collections::HashMap;
use std::fmt;
@@ -239,6 +240,8 @@ pub enum ConstellationControlMsg {
/// Notifies script thread that a url should be loaded in this iframe.
/// PipelineId is for the parent, FrameId is for the actual frame.
Navigate(PipelineId, FrameId, LoadData, bool),
+ /// Post a message to a given window.
+ PostMessage(PipelineId, Option<ImmutableOrigin>, Vec<u8>),
/// Requests the script thread forward a mozbrowser event to an iframe it owns,
/// or to the window if no child frame id is provided.
MozBrowserEvent(PipelineId, Option<FrameId>, MozBrowserEvent),
@@ -297,6 +300,7 @@ impl fmt::Debug for ConstellationControlMsg {
ChangeFrameVisibilityStatus(..) => "ChangeFrameVisibilityStatus",
NotifyVisibilityChange(..) => "NotifyVisibilityChange",
Navigate(..) => "Navigate",
+ PostMessage(..) => "PostMessage",
MozBrowserEvent(..) => "MozBrowserEvent",
UpdatePipelineId(..) => "UpdatePipelineId",
FocusIFrame(..) => "FocusIFrame",
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs
index 8aa606c02c5..2fd70174368 100644
--- a/components/script_traits/script_msg.rs
+++ b/components/script_traits/script_msg.rs
@@ -23,6 +23,7 @@ use msg::constellation_msg::{Key, KeyModifiers, KeyState};
use net_traits::CoreResourceMsg;
use net_traits::storage_thread::StorageType;
use offscreen_gl_context::{GLContextAttributes, GLLimits};
+use servo_url::ImmutableOrigin;
use servo_url::ServoUrl;
use style_traits::CSSPixel;
use style_traits::cursor::Cursor;
@@ -93,6 +94,8 @@ pub enum ScriptMsg {
/// A new load has been requested, with an option to replace the current entry once loaded
/// instead of adding a new entry.
LoadUrl(PipelineId, LoadData, bool),
+ /// Post a message to the currently active window of a given browsing context.
+ PostMessage(FrameId, Option<ImmutableOrigin>, Vec<u8>),
/// Dispatch a mozbrowser event to the parent of this pipeline.
/// The first PipelineId is for the parent, the second is for the originating pipeline.
MozBrowserEvent(PipelineId, PipelineId, MozBrowserEvent),