Skip to content

Commit

Permalink
Remove clipboard crate to due disallowed usage of GPL code
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbergstrom committed Jul 20, 2016
1 parent efa5a03 commit ecabb18
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 142 deletions.
1 change: 0 additions & 1 deletion components/constellation/Cargo.toml
Expand Up @@ -13,7 +13,6 @@ path = "lib.rs"
backtrace = "0.2.1"
canvas = {path = "../canvas"}
canvas_traits = {path = "../canvas_traits"}
clipboard = {git = "https://github.com/aweinstock314/rust-clipboard"}
compositing = {path = "../compositing"}
devtools_traits = {path = "../devtools_traits"}
euclid = "0.7.1"
Expand Down
28 changes: 2 additions & 26 deletions components/constellation/constellation.rs
Expand Up @@ -13,7 +13,6 @@ use backtrace::Backtrace;
use canvas::canvas_paint_thread::CanvasPaintThread;
use canvas::webgl_paint_thread::WebGLPaintThread;
use canvas_traits::CanvasMsg;
use clipboard::ClipboardContext;
use compositing::SendableFrameTree;
use compositing::compositor_thread::CompositorProxy;
use compositing::compositor_thread::Msg as ToCompositorMsg;
Expand Down Expand Up @@ -172,9 +171,6 @@ pub struct Constellation<Message, LTF, STF> {

window_size: WindowSizeData,

/// Means of accessing the clipboard
clipboard_ctx: Option<ClipboardContext>,

/// Bits of state used to interact with the webdriver implementation
webdriver: WebDriverData,

Expand Down Expand Up @@ -476,11 +472,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
ScaleFactor::new(opts::get().device_pixels_per_px.unwrap_or(1.0)),
},
phantom: PhantomData,
clipboard_ctx: if state.supports_clipboard {
ClipboardContext::new().ok()
} else {
None
},
webdriver: WebDriverData::new(),
scheduler_chan: TimerScheduler::start(),
child_processes: Vec::new(),
Expand Down Expand Up @@ -851,26 +842,11 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
}
}
FromScriptMsg::GetClipboardContents(sender) => {
let result = match self.clipboard_ctx {
Some(ref ctx) => match ctx.get_contents() {
Ok(result) => result,
Err(e) => {
warn!("Error getting clipboard contents ({}), defaulting to empty string", e);
"".to_owned()
},
},
None => "".to_owned()
};
if let Err(e) = sender.send(result) {
if let Err(e) = sender.send("".to_owned()) {
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::SetClipboardContents(_) => {
}
FromScriptMsg::SetVisible(pipeline_id, visible) => {
debug!("constellation got set visible messsage");
Expand Down
1 change: 0 additions & 1 deletion components/constellation/lib.rs
Expand Up @@ -15,7 +15,6 @@
extern crate backtrace;
extern crate canvas;
extern crate canvas_traits;
extern crate clipboard;
extern crate compositing;
extern crate devtools_traits;
extern crate euclid;
Expand Down
56 changes: 0 additions & 56 deletions components/servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 0 additions & 56 deletions ports/cef/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ports/cef/window.rs
Expand Up @@ -504,7 +504,7 @@ impl WindowMethods for Window {
}

fn supports_clipboard(&self) -> bool {
true
false
}
}

Expand Down
2 changes: 1 addition & 1 deletion ports/glutin/window.rs
Expand Up @@ -930,7 +930,7 @@ impl WindowMethods for Window {
}

fn supports_clipboard(&self) -> bool {
true
false
}
}

Expand Down

0 comments on commit ecabb18

Please sign in to comment.