Auto merge of #14044 - servo:bluetooth, r=emilio

Split the bluetooth code out from the net crates.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14044)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-11-03 15:04:43 -05:00 committed by GitHub
commit 738f0eb974
28 changed files with 143 additions and 34 deletions

View file

@ -25,6 +25,7 @@ angle = {git = "https://github.com/servo/angle", branch = "servo"}
app_units = "0.3"
audio-video-metadata = "0.1.2"
bitflags = "0.7"
bluetooth_traits = {path = "../bluetooth_traits"}
canvas_traits = {path = "../canvas_traits"}
caseless = "0.1.0"
cookie = {version = "0.2.5", features = ["serialize-rustc"]}

View file

@ -3,6 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::{BluetoothError, BluetoothMethodMsg};
use bluetooth_traits::scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence};
use bluetooth_traits::scanfilter::{RequestDeviceoptions, ServiceUUIDSequence};
use core::clone::Clone;
use dom::bindings::codegen::Bindings::BluetoothBinding::{self, BluetoothMethods, BluetoothRequestDeviceFilter};
use dom::bindings::codegen::Bindings::BluetoothBinding::RequestDeviceOptions;
@ -18,9 +21,6 @@ use dom::globalscope::GlobalScope;
use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender};
use js::conversions::ToJSValConvertible;
use net_traits::bluetooth_scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence};
use net_traits::bluetooth_scanfilter::{RequestDeviceoptions, ServiceUUIDSequence};
use net_traits::bluetooth_thread::{BluetoothError, BluetoothMethodMsg};
use std::rc::Rc;
const FILTER_EMPTY_ERROR: &'static str = "'filters' member, if present, must be nonempty to find any devices.";

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::BluetoothMethodMsg;
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding::
BluetoothCharacteristicPropertiesMethods;
@ -25,7 +26,6 @@ use dom::bluetoothuuid::{BluetoothDescriptorUUID, BluetoothUUID};
use dom::globalscope::GlobalScope;
use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use std::rc::Rc;
// Maximum length of an attribute value.

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::BluetoothMethodMsg;
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding::
@ -21,7 +22,6 @@ use dom::bluetoothremotegattcharacteristic::{BluetoothRemoteGATTCharacteristic,
use dom::globalscope::GlobalScope;
use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use std::rc::Rc;
// http://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattdescriptor

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::BluetoothMethodMsg;
use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
@ -18,7 +19,6 @@ use dom::bluetoothuuid::{BluetoothServiceUUID, BluetoothUUID};
use dom::globalscope::GlobalScope;
use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use std::cell::Cell;
use std::rc::Rc;

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_blacklist::{Blacklist, uuid_is_blacklisted};
use bluetooth_traits::BluetoothMethodMsg;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
use dom::bindings::error::Error::{self, Security};
@ -18,7 +19,6 @@ use dom::bluetoothuuid::{BluetoothCharacteristicUUID, BluetoothServiceUUID, Blue
use dom::globalscope::GlobalScope;
use dom::promise::Promise;
use ipc_channel::ipc::{self, IpcSender};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use std::rc::Rc;
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattservice

View file

@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use bluetooth_traits::BluetoothMethodMsg;
use cssparser::Parser;
use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType};
use dom::bindings::callback::ExceptionHandling;
@ -53,7 +54,6 @@ use js::jsval::UndefinedValue;
use js::rust::Runtime;
use msg::constellation_msg::{FrameType, PipelineId, ReferrerPolicy};
use net_traits::ResourceThreads;
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread};
use net_traits::storage_thread::StorageType;
use num_traits::ToPrimitive;

View file

@ -32,6 +32,7 @@ extern crate audio_video_metadata;
#[allow(unused_extern_crates)]
#[macro_use]
extern crate bitflags;
extern crate bluetooth_traits;
extern crate canvas_traits;
extern crate caseless;
extern crate cookie as cookie_rs;

View file

@ -17,6 +17,7 @@
//! a page runs its course and the script thread returns to processing events in the main event
//! loop.
use bluetooth_traits::BluetoothMethodMsg;
use devtools;
use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo};
use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId};
@ -73,7 +74,6 @@ use layout_wrapper::ServoLayoutNode;
use mem::heap_size_of_self_and_children;
use msg::constellation_msg::{FrameType, PipelineId, PipelineNamespace, ReferrerPolicy};
use net_traits::{CoreResourceMsg, IpcSend, Metadata, ResourceThreads};
use net_traits::bluetooth_thread::BluetoothMethodMsg;
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheResult, ImageCacheThread};
use net_traits::request::{CredentialsMode, Destination, RequestInit};
use network_listener::NetworkListener;