diff options
author | Corey Farwell <coreyf@rwell.org> | 2015-05-31 12:45:04 -0400 |
---|---|---|
committer | Corey Farwell <coreyf@rwell.org> | 2015-06-02 08:54:44 -0400 |
commit | 435e551753c1d693ed6dc69238fc466896ed48e4 (patch) | |
tree | 2ab9c3a1e82016472cbb8a47971ad40a2dd68869 | |
parent | c63fc4dc13a23cf5b9f8c0972111b3f9436d2143 (diff) | |
download | servo-435e551753c1d693ed6dc69238fc466896ed48e4.tar.gz servo-435e551753c1d693ed6dc69238fc466896ed48e4.zip |
Remove `get_` prefix on getters
Part of #6224
I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`
-rw-r--r-- | components/compositing/compositor.rs | 8 | ||||
-rw-r--r-- | components/compositing/compositor_layer.rs | 12 | ||||
-rw-r--r-- | components/compositing/compositor_task.rs | 2 | ||||
-rw-r--r-- | components/devtools/actor.rs | 2 | ||||
-rw-r--r-- | components/devtools/actors/network_event.rs | 4 | ||||
-rw-r--r-- | components/devtools/actors/timeline.rs | 8 | ||||
-rw-r--r-- | components/devtools/lib.rs | 4 | ||||
-rw-r--r-- | components/gfx/font.rs | 4 | ||||
-rw-r--r-- | components/gfx/font_context.rs | 3 | ||||
-rw-r--r-- | components/gfx/paint_context.rs | 19 | ||||
-rw-r--r-- | components/gfx/paint_task.rs | 5 | ||||
-rw-r--r-- | components/gfx/platform/freetype/font.rs | 10 | ||||
-rw-r--r-- | components/gfx/platform/macos/font.rs | 5 | ||||
-rw-r--r-- | components/gfx/text/text_run.rs | 2 | ||||
-rw-r--r-- | components/layout/construct.rs | 17 | ||||
-rw-r--r-- | components/layout/fragment.rs | 7 | ||||
-rw-r--r-- | components/layout/wrapper.rs | 6 | ||||
-rw-r--r-- | components/msg/compositor_msg.rs | 2 | ||||
-rw-r--r-- | components/net/fetch/cors_cache.rs | 4 | ||||
-rw-r--r-- | components/script/clipboard_provider.rs | 6 | ||||
-rw-r--r-- | components/script/textinput.rs | 2 |
21 files changed, 62 insertions, 70 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index f039d7bee27..923324d1f3a 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -885,7 +885,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { let url = Url::parse(&url_string).unwrap(); self.window.set_page_url(url.clone()); let msg = match self.scene.root { - Some(ref layer) => ConstellationMsg::LoadUrl(layer.get_pipeline_id(), LoadData::new(url)), + Some(ref layer) => ConstellationMsg::LoadUrl(layer.pipeline_id(), LoadData::new(url)), None => ConstellationMsg::InitLoadUrl(url) }; @@ -1117,7 +1117,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { let mut results: HashMap<PipelineId, Vec<PaintRequest>> = HashMap::new(); for (layer, mut layer_requests) in requests.into_iter() { - let pipeline_id = layer.get_pipeline_id(); + let pipeline_id = layer.pipeline_id(); let current_epoch = self.pipeline_details.get(&pipeline_id).unwrap().current_epoch; layer.extra_data.borrow_mut().requested_epoch = current_epoch; let vec = match results.entry(pipeline_id) { @@ -1151,7 +1151,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { Vec<Box<LayerBuffer>>)>) { for (layer, buffers) in unused_buffers.into_iter() { if !buffers.is_empty() { - let pipeline = self.get_pipeline(layer.get_pipeline_id()); + let pipeline = self.get_pipeline(layer.pipeline_id()); let _ = pipeline.paint_chan.send_opt(PaintMsg::UnusedBuffer(buffers)); } } @@ -1161,7 +1161,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { if layer.extra_data.borrow().id == LayerId::null() { let layer_rect = Rect(-layer.extra_data.borrow().scroll_offset.to_untyped(), layer.bounds.borrow().size.to_untyped()); - let pipeline = self.get_pipeline(layer.get_pipeline_id()); + let pipeline = self.get_pipeline(layer.pipeline_id()); let ScriptControlChan(ref chan) = pipeline.script_chan; chan.send(ConstellationControlMsg::Viewport(pipeline.id.clone(), layer_rect)).unwrap(); } diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs index 0a37340c4f9..240923410ad 100644 --- a/components/compositing/compositor_layer.rs +++ b/components/compositing/compositor_layer.rs @@ -141,7 +141,7 @@ pub trait CompositorLayer { fn wants_scroll_events(&self) -> WantsScrollEventsFlag; /// Return the pipeline id associated with this layer. - fn get_pipeline_id(&self) -> PipelineId; + fn pipeline_id(&self) -> PipelineId; } #[derive(Copy, PartialEq, Clone)] @@ -225,7 +225,7 @@ impl CompositorLayer for Layer<CompositorData> { let unused_buffers = self.collect_unused_buffers(); if !unused_buffers.is_empty() { // send back unused buffers - let pipeline = compositor.get_pipeline(self.get_pipeline_id()); + let pipeline = compositor.get_pipeline(self.pipeline_id()); let _ = pipeline.paint_chan.send(PaintMsg::UnusedBuffer(unused_buffers)); } } @@ -241,7 +241,7 @@ impl CompositorLayer for Layer<CompositorData> { buffer.mark_wont_leak() } - let pipeline = compositor.get_pipeline(self.get_pipeline_id()); + let pipeline = compositor.get_pipeline(self.pipeline_id()); let _ = pipeline.paint_chan.send(PaintMsg::UnusedBuffer(buffers)); } } @@ -370,7 +370,7 @@ impl CompositorLayer for Layer<CompositorData> { MouseUpEvent(button, event_point), }; - let pipeline = compositor.get_pipeline(self.get_pipeline_id()); + let pipeline = compositor.get_pipeline(self.pipeline_id()); let ScriptControlChan(ref chan) = pipeline.script_chan; let _ = chan.send(ConstellationControlMsg::SendEvent(pipeline.id.clone(), message)); } @@ -380,7 +380,7 @@ impl CompositorLayer for Layer<CompositorData> { cursor: TypedPoint2D<LayerPixel, f32>) where Window: WindowMethods { let message = MouseMoveEvent(cursor.to_untyped()); - let pipeline = compositor.get_pipeline(self.get_pipeline_id()); + let pipeline = compositor.get_pipeline(self.pipeline_id()); let ScriptControlChan(ref chan) = pipeline.script_chan; let _ = chan.send(ConstellationControlMsg::SendEvent(pipeline.id.clone(), message)); } @@ -409,7 +409,7 @@ impl CompositorLayer for Layer<CompositorData> { self.extra_data.borrow().wants_scroll_events } - fn get_pipeline_id(&self) -> PipelineId { + fn pipeline_id(&self) -> PipelineId { self.extra_data.borrow().pipeline_id } } diff --git a/components/compositing/compositor_task.rs b/components/compositing/compositor_task.rs index 9a47fce1600..be134d751bc 100644 --- a/components/compositing/compositor_task.rs +++ b/components/compositing/compositor_task.rs @@ -91,7 +91,7 @@ impl ScriptListener for Box<CompositorProxy+'static+Send> { /// Implementation of the abstract `PaintListener` interface. impl PaintListener for Box<CompositorProxy+'static+Send> { - fn get_graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata> { + fn graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata> { let (chan, port) = channel(); self.send(Msg::GetGraphicsMetadata(chan)); // If the compositor is shutting down when a paint task diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs index ee12104b209..2f0169a3a22 100644 --- a/components/devtools/actor.rs +++ b/components/devtools/actor.rs @@ -120,7 +120,7 @@ impl ActorRegistry { } /// Get start stamp when registry was started - pub fn get_start_stamp(&self) -> PreciseTime { + pub fn start_stamp(&self) -> PreciseTime { self.start_stamp.clone() } diff --git a/components/devtools/actors/network_event.rs b/components/devtools/actors/network_event.rs index 9a741913cdd..37de41a0722 100644 --- a/components/devtools/actors/network_event.rs +++ b/components/devtools/actors/network_event.rs @@ -138,7 +138,7 @@ impl NetworkEventActor { self.response.body = body.clone(); } - pub fn get_event_actor(&self) -> EventActor { + pub fn event_actor(&self) -> EventActor { // TODO: Send the correct values for startedDateTime, isXHR, private EventActor { actor: self.name(), @@ -150,7 +150,7 @@ impl NetworkEventActor { } } - pub fn get_response_start(&self) -> ResponseStartMsg { + pub fn response_start(&self) -> ResponseStartMsg { // TODO: Send the correct values for all these fields. // This is a fake message. ResponseStartMsg { diff --git a/components/devtools/actors/timeline.rs b/components/devtools/actors/timeline.rs index dc29b8a80b7..8b45f61e2c9 100644 --- a/components/devtools/actors/timeline.rs +++ b/components/devtools/actors/timeline.rs @@ -264,7 +264,7 @@ impl Actor for TimelineActor { } let emitter = Emitter::new(self.name(), registry.get_shareable(), - registry.get_start_stamp(), + registry.start_stamp(), stream.try_clone().unwrap(), self.memory_actor.borrow().clone(), self.framerate_actor.borrow().clone()); @@ -273,8 +273,7 @@ impl Actor for TimelineActor { let msg = StartReply { from: self.name(), - value: HighResolutionStamp::new(registry.get_start_stamp(), - PreciseTime::now()), + value: HighResolutionStamp::new(registry.start_stamp(), PreciseTime::now()), }; stream.write_json_packet(&msg); true @@ -283,8 +282,7 @@ impl Actor for TimelineActor { "stop" => { let msg = StopReply { from: self.name(), - value: HighResolutionStamp::new(registry.get_start_stamp(), - PreciseTime::now()), + value: HighResolutionStamp::new(registry.start_stamp(), PreciseTime::now()), }; stream.write_json_packet(&msg); diff --git a/components/devtools/lib.rs b/components/devtools/lib.rs index 71fa0b0a614..ee600e6f587 100644 --- a/components/devtools/lib.rs +++ b/components/devtools/lib.rs @@ -309,7 +309,7 @@ fn run_server(sender: Sender<DevtoolsControlMsg>, let msg = NetworkEventMsg { from: console_actor_name, __type__: "networkEvent".to_string(), - eventActor: actor.get_event_actor(), + eventActor: actor.event_actor(), }; for stream in connections.iter_mut() { stream.write_json_packet(&msg); @@ -324,7 +324,7 @@ fn run_server(sender: Sender<DevtoolsControlMsg>, from: netevent_actor_name, __type__: "networkEventUpdate".to_string(), updateType: "responseStart".to_string(), - response: actor.get_response_start() + response: actor.response_start() }; for stream in connections.iter_mut() { diff --git a/components/gfx/font.rs b/components/gfx/font.rs index 258a1782d28..ec0fd7ac9d4 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -31,7 +31,7 @@ use platform::font_template::FontTemplateData; pub trait FontHandleMethods { fn new_from_template(fctx: &FontContextHandle, template: Arc<FontTemplateData>, pt_size: Option<Au>) -> Result<Self,()>; - fn get_template(&self) -> Arc<FontTemplateData>; + fn template(&self) -> Arc<FontTemplateData>; fn family_name(&self) -> String; fn face_name(&self) -> String; fn is_italic(&self) -> bool; @@ -41,7 +41,7 @@ pub trait FontHandleMethods { fn glyph_index(&self, codepoint: char) -> Option<GlyphId>; fn glyph_h_advance(&self, GlyphId) -> Option<FractionalPixel>; fn glyph_h_kerning(&self, GlyphId, GlyphId) -> FractionalPixel; - fn get_metrics(&self) -> FontMetrics; + fn metrics(&self) -> FontMetrics; fn get_table_for_tag(&self, FontTableTag) -> Option<FontTable>; } diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index cd6f1fa69f5..6e6b16f25a2 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -113,7 +113,7 @@ impl FontContext { Some(actual_pt_size)); handle.map(|handle| { - let metrics = handle.get_metrics(); + let metrics = handle.metrics(); Font { handle: handle, @@ -314,4 +314,3 @@ impl borrow::Borrow<usize> for LayoutFontGroupCacheKey { &self.address } } - diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index 6e86b77c97a..33efa9c1b61 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -71,7 +71,7 @@ enum DashSize { } impl<'a> PaintContext<'a> { - pub fn get_draw_target(&self) -> &DrawTarget { + pub fn draw_target(&self) -> &DrawTarget { &self.draw_target } @@ -675,10 +675,10 @@ impl<'a> PaintContext<'a> { self.draw_border_path(&rect, direction, border, radius, color); } - fn get_scaled_bounds(&self, - bounds: &Rect<Au>, - border: &SideOffsets2D<f32>, - shrink_factor: f32) -> Rect<f32> { + fn compute_scaled_bounds(&self, + bounds: &Rect<Au>, + border: &SideOffsets2D<f32>, + shrink_factor: f32) -> Rect<f32> { let rect = bounds.to_nearest_azure_rect(); let scaled_border = SideOffsets2D::new(shrink_factor * border.top, shrink_factor * border.right, @@ -709,7 +709,7 @@ impl<'a> PaintContext<'a> { (1.0/3.0) * border.right, (1.0/3.0) * border.bottom, (1.0/3.0) * border.left); - let inner_scaled_bounds = self.get_scaled_bounds(bounds, border, 2.0/3.0); + let inner_scaled_bounds = self.compute_scaled_bounds(bounds, border, 2.0/3.0); // draw the outer portion of the double border. self.draw_solid_border_segment(direction, bounds, &scaled_border, radius, color); // draw the inner portion of the double border. @@ -724,9 +724,9 @@ impl<'a> PaintContext<'a> { color: Color, style: border_style::T) { // original bounds as a Rect<f32>, with no scaling. - let original_bounds = self.get_scaled_bounds(bounds, border, 0.0); + let original_bounds = self.compute_scaled_bounds(bounds, border, 0.0); // shrink the bounds by 1/2 of the border, leaving the innermost 1/2 of the border - let inner_scaled_bounds = self.get_scaled_bounds(bounds, border, 0.5); + let inner_scaled_bounds = self.compute_scaled_bounds(bounds, border, 0.5); let scaled_border = SideOffsets2D::new(0.5 * border.top, 0.5 * border.right, 0.5 * border.bottom, @@ -779,7 +779,7 @@ impl<'a> PaintContext<'a> { _ => panic!("invalid border style") }; // original bounds as a Rect<f32> - let original_bounds = self.get_scaled_bounds(bounds, border, 0.0); + let original_bounds = self.compute_scaled_bounds(bounds, border, 0.0); // You can't scale black color (i.e. 'scaled = 0 * scale', equals black). let mut scaled_color = color::black(); @@ -1419,4 +1419,3 @@ impl TemporaryDrawTarget { } } - diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index f02077608b8..e46a2a7e033 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -177,9 +177,9 @@ impl<C> PaintTask<C> where C: PaintListener + Send + 'static { // Ensures that the paint task and graphics context are destroyed before the // shutdown message. let mut compositor = compositor; - let native_graphics_context = compositor.get_graphics_metadata().map( + let native_graphics_context = compositor.graphics_metadata().map( |md| NativePaintingGraphicsContext::from_metadata(&md)); - let worker_threads = WorkerThreadProxy::spawn(compositor.get_graphics_metadata(), + let worker_threads = WorkerThreadProxy::spawn(compositor.graphics_metadata(), font_cache_task, time_profiler_chan.clone()); @@ -724,4 +724,3 @@ pub static THREAD_TINT_COLORS: [Color; 8] = [ Color { r: 255.0/255.0, g: 249.0/255.0, b: 201.0/255.0, a: 0.7 }, Color { r: 137.0/255.0, g: 196.0/255.0, b: 78.0/255.0, a: 0.7 }, ]; - diff --git a/components/gfx/platform/freetype/font.rs b/components/gfx/platform/freetype/font.rs index f65104aa649..a4b48c06991 100644 --- a/components/gfx/platform/freetype/font.rs +++ b/components/gfx/platform/freetype/font.rs @@ -113,7 +113,7 @@ impl FontHandleMethods for FontHandle { } } } - fn get_template(&self) -> Arc<FontTemplateData> { + fn template(&self) -> Arc<FontTemplateData> { self.font_data.clone() } fn family_name(&self) -> String { @@ -204,9 +204,9 @@ impl FontHandleMethods for FontHandle { } } - fn get_metrics(&self) -> FontMetrics { + fn metrics(&self) -> FontMetrics { /* TODO(Issue #76): complete me */ - let face = self.get_face_rec(); + let face = self.face_rec_mut(); let underline_size = self.font_units_to_au(face.underline_thickness as f64); let underline_offset = self.font_units_to_au(face.underline_position as f64); @@ -276,14 +276,14 @@ impl<'a> FontHandle { } } - fn get_face_rec(&'a self) -> &'a mut FT_FaceRec { + fn face_rec_mut(&'a self) -> &'a mut FT_FaceRec { unsafe { &mut (*self.face) } } fn font_units_to_au(&self, value: f64) -> Au { - let face = self.get_face_rec(); + let face = self.face_rec_mut(); // face.size is a *c_void in the bindings, presumably to avoid // recursive structural types diff --git a/components/gfx/platform/macos/font.rs b/components/gfx/platform/macos/font.rs index f45177521c8..23c14b3fd61 100644 --- a/components/gfx/platform/macos/font.rs +++ b/components/gfx/platform/macos/font.rs @@ -77,7 +77,7 @@ impl FontHandleMethods for FontHandle { } } - fn get_template(&self) -> Arc<FontTemplateData> { + fn template(&self) -> Arc<FontTemplateData> { self.font_data.clone() } @@ -157,7 +157,7 @@ impl FontHandleMethods for FontHandle { Some(advance as FractionalPixel) } - fn get_metrics(&self) -> FontMetrics { + fn metrics(&self) -> FontMetrics { let bounding_rect: CGRect = self.ctfont.bounding_box(); let ascent = self.ctfont.ascent() as f64; let descent = self.ctfont.descent() as f64; @@ -203,4 +203,3 @@ impl FontHandleMethods for FontHandle { }) } } - diff --git a/components/gfx/text/text_run.rs b/components/gfx/text/text_run.rs index 20c1f8fb4da..35ffeef7caf 100644 --- a/components/gfx/text/text_run.rs +++ b/components/gfx/text/text_run.rs @@ -191,7 +191,7 @@ impl<'a> TextRun { let run = TextRun { text: Arc::new(text), font_metrics: font.metrics.clone(), - font_template: font.handle.get_template(), + font_template: font.handle.template(), actual_pt_size: font.actual_pt_size, glyphs: Arc::new(glyphs), }; diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 25296e9c89b..cbd77fbc211 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -297,7 +297,7 @@ impl<'a> FlowConstructor<'a> { Some(NodeTypeId::Element(ElementTypeId::HTMLElement( HTMLElementTypeId::HTMLObjectElement))) => { let image_info = box ImageFragmentInfo::new(node, - node.get_object_data(), + node.object_data(), &self.layout_context); SpecificFragmentInfo::Image(image_info) } @@ -1254,7 +1254,7 @@ impl<'a> FlowConstructor<'a> { let layout_data = layout_data_ref.as_mut().expect("no layout data"); let style = (*node.get_style(&layout_data)).clone(); let damage = layout_data.data.restyle_damage; - match node.get_construction_result(layout_data) { + match node.construction_result_mut(layout_data) { &mut ConstructionResult::None => true, &mut ConstructionResult::Flow(ref mut flow, _) => { // The node's flow is of the same type and has the same set of children and can @@ -1474,7 +1474,7 @@ trait NodeUtils { /// Returns true if this node doesn't render its kids and false otherwise. fn is_replaced_content(&self) -> bool; - fn get_construction_result<'a>(self, layout_data: &'a mut LayoutDataWrapper) + fn construction_result_mut<'a>(self, layout_data: &'a mut LayoutDataWrapper) -> &'a mut ConstructionResult; /// Sets the construction result of a flow. @@ -1505,7 +1505,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> { } } - fn get_construction_result<'a>(self, layout_data: &'a mut LayoutDataWrapper) -> &'a mut ConstructionResult { + fn construction_result_mut<'a>(self, layout_data: &'a mut LayoutDataWrapper) -> &'a mut ConstructionResult { match self.get_pseudo_element_type() { PseudoElementType::Before(_) => &mut layout_data.data.before_flow_construction_result, PseudoElementType::After (_) => &mut layout_data.data.after_flow_construction_result, @@ -1518,7 +1518,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> { let mut layout_data_ref = self.mutate_layout_data(); let layout_data = layout_data_ref.as_mut().expect("no layout data"); - let dst = self.get_construction_result(layout_data); + let dst = self.construction_result_mut(layout_data); *dst = result; } @@ -1528,7 +1528,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> { let mut layout_data_ref = self.mutate_layout_data(); let layout_data = layout_data_ref.as_mut().expect("no layout data"); - self.get_construction_result(layout_data).swap_out() + self.construction_result_mut(layout_data).swap_out() } } @@ -1541,7 +1541,7 @@ trait ObjectElement<'a> { fn has_object_data(&self) -> bool; /// Returns the "data" attribute value parsed as a URL - fn get_object_data(&self) -> Option<Url>; + fn object_data(&self) -> Option<Url>; } impl<'ln> ObjectElement<'ln> for ThreadSafeLayoutNode<'ln> { @@ -1557,7 +1557,7 @@ impl<'ln> ObjectElement<'ln> for ThreadSafeLayoutNode<'ln> { } } - fn get_object_data(&self) -> Option<Url> { + fn object_data(&self) -> Option<Url> { match self.get_type_and_data() { (None, Some(uri)) if is_image_data(uri) => Url::parse(uri).ok(), _ => None @@ -1632,4 +1632,3 @@ pub fn strip_ignorable_whitespace_from_end(this: &mut LinkedList<Fragment>) { drop(this.pop_back()); } } - diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index db4a8c9c54a..85b6959ad88 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -294,9 +294,9 @@ impl CanvasFragmentInfo { pub fn new(node: &ThreadSafeLayoutNode) -> CanvasFragmentInfo { CanvasFragmentInfo { replaced_image_fragment_info: ReplacedImageFragmentInfo::new(node, - Some(Au::from_px(node.get_canvas_width() as i32)), - Some(Au::from_px(node.get_canvas_height() as i32))), - renderer: node.get_renderer().map(|rec| Arc::new(Mutex::new(rec))), + Some(Au::from_px(node.canvas_width() as i32)), + Some(Au::from_px(node.canvas_height() as i32))), + renderer: node.renderer().map(|rec| Arc::new(Mutex::new(rec))), } } @@ -2208,4 +2208,3 @@ impl<'a> InlineStyleIterator<'a> { } } } - diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 5cdc9e9a16a..06bc39be93f 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -123,7 +123,7 @@ pub trait TLayoutNode { } } - fn get_renderer(&self) -> Option<Sender<CanvasMsg>> { + fn renderer(&self) -> Option<Sender<CanvasMsg>> { unsafe { let canvas_element: Option<LayoutJS<HTMLCanvasElement>> = HTMLCanvasElementCast::to_layout_js(self.get_jsmanaged()); @@ -131,7 +131,7 @@ pub trait TLayoutNode { } } - fn get_canvas_width(&self) -> u32 { + fn canvas_width(&self) -> u32 { unsafe { let canvas_element: Option<LayoutJS<HTMLCanvasElement>> = HTMLCanvasElementCast::to_layout_js(self.get_jsmanaged()); @@ -139,7 +139,7 @@ pub trait TLayoutNode { } } - fn get_canvas_height(&self) -> u32 { + fn canvas_height(&self) -> u32 { unsafe { let canvas_element: Option<LayoutJS<HTMLCanvasElement>> = HTMLCanvasElementCast::to_layout_js(self.get_jsmanaged()); diff --git a/components/msg/compositor_msg.rs b/components/msg/compositor_msg.rs index ed7844dd995..526ac86018b 100644 --- a/components/msg/compositor_msg.rs +++ b/components/msg/compositor_msg.rs @@ -77,7 +77,7 @@ pub struct LayerProperties { /// The interface used by the painter to acquire draw targets for each paint frame and /// submit them to be drawn to the display. pub trait PaintListener { - fn get_graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata>; + fn graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata>; /// Informs the compositor of the layers for the given pipeline. The compositor responds by /// creating and/or destroying paint layers as necessary. diff --git a/components/net/fetch/cors_cache.rs b/components/net/fetch/cors_cache.rs index e88bfc26e40..658beec6808 100644 --- a/components/net/fetch/cors_cache.rs +++ b/components/net/fetch/cors_cache.rs @@ -263,7 +263,7 @@ impl CORSCache for CORSCacheSender { /// ```ignore /// let task = CORSCacheTask::new(); /// let builder = TaskBuilder::new().named("XHRTask"); -/// let mut sender = task.get_sender(); +/// let mut sender = task.sender(); /// builder.spawn(move || { task.run() }); /// sender.insert(CORSCacheEntry::new(/* parameters here */)); /// ``` @@ -284,7 +284,7 @@ impl CORSCacheTask { } /// Provides a sender to the cache task - pub fn get_sender(&self) -> CORSCacheSender { + pub fn sender(&self) -> CORSCacheSender { self.sender.clone() } diff --git a/components/script/clipboard_provider.rs b/components/script/clipboard_provider.rs index 060c857b64b..2b5253f22e8 100644 --- a/components/script/clipboard_provider.rs +++ b/components/script/clipboard_provider.rs @@ -10,13 +10,13 @@ use std::sync::mpsc::channel; pub trait ClipboardProvider { // blocking method to get the clipboard contents - fn get_clipboard_contents(&mut self) -> String; + fn clipboard_contents(&mut self) -> String; // blocking method to set the clipboard contents fn set_clipboard_contents(&mut self, &str); } impl ClipboardProvider for ConstellationChan { - fn get_clipboard_contents(&mut self) -> String { + fn clipboard_contents(&mut self) -> String { let (tx, rx) = channel(); self.0.send(ConstellationMsg::GetClipboardContents(tx)).unwrap(); rx.recv().unwrap() @@ -39,7 +39,7 @@ impl DummyClipboardContext { } impl ClipboardProvider for DummyClipboardContext { - fn get_clipboard_contents(&mut self) -> String { + fn clipboard_contents(&mut self) -> String { self.content.clone() } fn set_clipboard_contents(&mut self, s: &str) { diff --git a/components/script/textinput.rs b/components/script/textinput.rs index abe74f2f330..59d6752daef 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -315,7 +315,7 @@ impl<T: ClipboardProvider> TextInput<T> { KeyReaction::Nothing }, Key::V if is_control_key(mods) => { - let contents = self.clipboard_provider.get_clipboard_contents(); + let contents = self.clipboard_provider.clipboard_contents(); self.insert_string(&contents); KeyReaction::DispatchInput }, |