diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-02-09 14:28:37 -0600 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-03-14 14:36:03 -0500 |
commit | 1f61a549a35ae317479f914c454fbee3580869d6 (patch) | |
tree | 1bdfd0d2c1da680af0ffd21278fe439558417061 /components/script/script_thread.rs | |
parent | 628cd7de6d6229af61d44b586da74176c21cc2ae (diff) | |
download | servo-1f61a549a35ae317479f914c454fbee3580869d6.tar.gz servo-1f61a549a35ae317479f914c454fbee3580869d6.zip |
Added some same-origin-domain checks.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index e877e904ceb..15604c5b7cf 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -27,7 +27,6 @@ use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; use dom::bindings::codegen::Bindings::EventBinding::EventInit; -use dom::bindings::codegen::Bindings::LocationBinding::LocationMethods; use dom::bindings::codegen::Bindings::TransitionEventBinding::TransitionEventInit; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::conversions::{ConversionResult, FromJSValConvertible, StringificationBehavior}; @@ -644,6 +643,14 @@ impl ScriptThread { })) } + pub fn find_browsing_context(id: FrameId) -> Option<Root<BrowsingContext>> { + SCRIPT_THREAD_ROOT.with(|root| root.get().and_then(|script_thread| { + let script_thread = unsafe { &*script_thread }; + script_thread.browsing_contexts.borrow().get(&id) + .map(|context| Root::from_ref(&**context)) + })) + } + /// Creates a new script thread. pub fn new(state: InitialScriptState, port: Receiver<MainThreadScriptMsg>, @@ -2101,7 +2108,7 @@ impl ScriptThread { fn handle_reload(&self, pipeline_id: PipelineId) { let window = self.documents.borrow().find_window(pipeline_id); if let Some(window) = window { - window.Location().Reload(); + window.Location().reload_without_origin_check(); } } |