Remove clipboard handling from constellation, and remove ScriptMessage for getting/setting clipboard

This commit is contained in:
Michal Mieczkowski 2019-06-13 20:15:12 +02:00
parent 5b79711ece
commit 18434c9927
2 changed files with 0 additions and 40 deletions

View file

@ -341,9 +341,6 @@ pub struct Constellation<Message, LTF, STF> {
/// The size of the top-level window. /// The size of the top-level window.
window_size: WindowSizeData, window_size: WindowSizeData,
/// Means of accessing the clipboard
clipboard_ctx: Option<ClipboardContext>,
/// Bits of state used to interact with the webdriver implementation /// Bits of state used to interact with the webdriver implementation
webdriver: WebDriverData, webdriver: WebDriverData,
@ -692,13 +689,6 @@ where
), ),
}, },
phantom: PhantomData, phantom: PhantomData,
clipboard_ctx: match ClipboardContext::new() {
Ok(c) => Some(c),
Err(e) => {
warn!("Error creating clipboard context ({})", e);
None
},
},
webdriver: WebDriverData::new(), webdriver: WebDriverData::new(),
scheduler_chan: TimerScheduler::start(), scheduler_chan: TimerScheduler::start(),
document_states: HashMap::new(), document_states: HashMap::new(),
@ -1343,30 +1333,6 @@ where
FromScriptMsg::Focus => { FromScriptMsg::Focus => {
self.handle_focus_msg(source_pipeline_id); self.handle_focus_msg(source_pipeline_id);
}, },
FromScriptMsg::GetClipboardContents(sender) => {
let contents = match self.clipboard_ctx {
Some(ref mut ctx) => {
match ctx.get_contents() {
Ok(c) => c,
Err(e) => {
warn!("Error getting clipboard contents ({}), defaulting to empty string", e);
"".to_owned()
},
}
},
None => "".to_owned(),
};
if let Err(e) = sender.send(contents) {
warn!("Failed to send clipboard ({})", e);
}
},
FromScriptMsg::SetClipboardContents(s) => {
if let Some(ref mut ctx) = self.clipboard_ctx {
if let Err(e) = ctx.set_contents(s) {
warn!("Error setting clipboard contents ({})", e);
}
}
},
FromScriptMsg::VisibilityChangeComplete(is_visible) => { FromScriptMsg::VisibilityChangeComplete(is_visible) => {
self.handle_visibility_change_complete(source_pipeline_id, is_visible); self.handle_visibility_change_complete(source_pipeline_id, is_visible);
}, },

View file

@ -121,8 +121,6 @@ pub enum ScriptMsg {
CreateCanvasPaintThread(Size2D<u64>, IpcSender<(IpcSender<CanvasMsg>, CanvasId)>), CreateCanvasPaintThread(Size2D<u64>, IpcSender<(IpcSender<CanvasMsg>, CanvasId)>),
/// Notifies the constellation that this frame has received focus. /// Notifies the constellation that this frame has received focus.
Focus, Focus,
/// Requests that the constellation retrieve the current contents of the clipboard
GetClipboardContents(IpcSender<String>),
/// Get the top-level browsing context info for a given browsing context. /// Get the top-level browsing context info for a given browsing context.
GetTopForBrowsingContext( GetTopForBrowsingContext(
BrowsingContextId, BrowsingContextId,
@ -183,8 +181,6 @@ pub enum ScriptMsg {
AuxiliaryBrowsingContextLoadInfo, AuxiliaryBrowsingContextLoadInfo,
IpcSender<LayoutControlMsg>, IpcSender<LayoutControlMsg>,
), ),
/// Requests that the constellation set the contents of the clipboard
SetClipboardContents(String),
/// Mark a new document as active /// Mark a new document as active
ActivateDocument, ActivateDocument,
/// Set the document state for a pipeline (used by screenshot / reftests) /// Set the document state for a pipeline (used by screenshot / reftests)
@ -224,7 +220,6 @@ impl fmt::Debug for ScriptMsg {
ChangeRunningAnimationsState(..) => "ChangeRunningAnimationsState", ChangeRunningAnimationsState(..) => "ChangeRunningAnimationsState",
CreateCanvasPaintThread(..) => "CreateCanvasPaintThread", CreateCanvasPaintThread(..) => "CreateCanvasPaintThread",
Focus => "Focus", Focus => "Focus",
GetClipboardContents(..) => "GetClipboardContents",
GetBrowsingContextInfo(..) => "GetBrowsingContextInfo", GetBrowsingContextInfo(..) => "GetBrowsingContextInfo",
GetTopForBrowsingContext(..) => "GetParentBrowsingContext", GetTopForBrowsingContext(..) => "GetParentBrowsingContext",
GetChildBrowsingContextId(..) => "GetChildBrowsingContextId", GetChildBrowsingContextId(..) => "GetChildBrowsingContextId",
@ -242,7 +237,6 @@ impl fmt::Debug for ScriptMsg {
ScriptLoadedURLInIFrame(..) => "ScriptLoadedURLInIFrame", ScriptLoadedURLInIFrame(..) => "ScriptLoadedURLInIFrame",
ScriptNewIFrame(..) => "ScriptNewIFrame", ScriptNewIFrame(..) => "ScriptNewIFrame",
ScriptNewAuxiliary(..) => "ScriptNewAuxiliary", ScriptNewAuxiliary(..) => "ScriptNewAuxiliary",
SetClipboardContents(..) => "SetClipboardContents",
ActivateDocument => "ActivateDocument", ActivateDocument => "ActivateDocument",
SetDocumentState(..) => "SetDocumentState", SetDocumentState(..) => "SetDocumentState",
SetFinalUrl(..) => "SetFinalUrl", SetFinalUrl(..) => "SetFinalUrl",