diff options
author | Sadman Kazi <sadman@sadmansk.com> | 2017-04-23 20:17:36 -0400 |
---|---|---|
committer | Sadman Kazi <sadman@sadmansk.com> | 2017-06-08 19:05:39 -0700 |
commit | 708c561ae698788c39d7d0ef7d796f349d7f218b (patch) | |
tree | 14b6f62faa6ab3b43f1b7c81e973fb416fdec44c /components/servo | |
parent | a6b3bf1517b8329e26c6b8dec84b294bf7d257be (diff) | |
download | servo-708c561ae698788c39d7d0ef7d796f349d7f218b.tar.gz servo-708c561ae698788c39d7d0ef7d796f349d7f218b.zip |
Pass URL to Browser::new(), delegate url checking logic to third party
Use Option instead of ServoUrl for url in opts
Cleaner mapping from parse_url to url_opt
Add comment about url parsing error
Print reason for parsing error
Remove comment about warning
Add home url when openning new browser window in CEF
Fix merge error
Diffstat (limited to 'components/servo')
-rw-r--r-- | components/servo/lib.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 22279a4189b..899ccec9986 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -122,7 +122,7 @@ pub struct Browser<Window: WindowMethods + 'static> { } impl<Window> Browser<Window> where Window: WindowMethods + 'static { - pub fn new(window: Rc<Window>) -> Browser<Window> { + pub fn new(window: Rc<Window>, target_url: ServoUrl) -> Browser<Window> { // Global configuration options, parsed from the command line. let opts = opts::get(); @@ -203,7 +203,7 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static { // as the navigation context. let (constellation_chan, sw_senders) = create_constellation(opts.user_agent.clone(), opts.config_dir.clone(), - opts.url.clone(), + target_url, compositor_proxy.clone_compositor_proxy(), time_profiler_chan.clone(), mem_profiler_chan.clone(), @@ -287,7 +287,7 @@ fn create_compositor_channel(event_loop_waker: Box<compositor_thread::EventLoopW fn create_constellation(user_agent: Cow<'static, str>, config_dir: Option<PathBuf>, - url: Option<ServoUrl>, + url: ServoUrl, compositor_proxy: CompositorProxy, time_profiler_chan: time::ProfilerChan, mem_profiler_chan: mem::ProfilerChan, @@ -337,9 +337,7 @@ fn create_constellation(user_agent: Cow<'static, str>, constellation_chan.send(ConstellationMsg::SetWebVRThread(webvr_thread)).unwrap(); } - if let Some(url) = url { - constellation_chan.send(ConstellationMsg::InitLoadUrl(url)).unwrap(); - }; + constellation_chan.send(ConstellationMsg::InitLoadUrl(url)).unwrap(); // channels to communicate with Service Worker Manager let sw_senders = SWManagerSenders { |