Skip to content

Commit

Permalink
Switch some uses of Arc<AtomicRefCell<T>> over to ArcRefCell<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton committed Mar 17, 2020
1 parent 5b3f277 commit 1d9f669
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 4 additions & 3 deletions components/layout_2020/dom_traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use crate::cell::ArcRefCell;
use crate::context::LayoutContext;
use crate::element_data::{LayoutBox, LayoutDataForElement};
use crate::geom::PhysicalSize;
use crate::replaced::{CanvasInfo, CanvasSource, ReplacedContent};
use crate::style_ext::{Display, DisplayGeneratingBox, DisplayInside, DisplayOutside};
use crate::wrapper::GetRawData;
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
use atomic_refcell::AtomicRefMut;
use html5ever::LocalName;
use net_traits::image::base::Image as NetImage;
use script_layout_interface::wrapper_traits::{
Expand Down Expand Up @@ -317,12 +318,12 @@ where
}

pub struct BoxSlot<'dom> {
slot: Option<ServoArc<AtomicRefCell<Option<LayoutBox>>>>,
slot: Option<ArcRefCell<Option<LayoutBox>>>,
marker: marker<&'dom ()>,
}

impl BoxSlot<'_> {
pub(crate) fn new(slot: ServoArc<AtomicRefCell<Option<LayoutBox>>>) -> Self {
pub(crate) fn new(slot: ArcRefCell<Option<LayoutBox>>) -> Self {
*slot.borrow_mut() = None;
let slot = Some(slot);
Self { slot, marker }
Expand Down
8 changes: 3 additions & 5 deletions components/layout_2020/element_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@
use crate::cell::ArcRefCell;
use crate::flow::inline::InlineLevelBox;
use crate::flow::BlockLevelBox;
use atomic_refcell::AtomicRefCell;
use servo_arc::Arc;

#[derive(Default)]
pub struct LayoutDataForElement {
pub(super) self_box: Arc<AtomicRefCell<Option<LayoutBox>>>,
pub(super) self_box: ArcRefCell<Option<LayoutBox>>,
pub(super) pseudo_elements: Option<Box<PseudoElementBoxes>>,
}

#[derive(Default)]
pub(super) struct PseudoElementBoxes {
pub before: Arc<AtomicRefCell<Option<LayoutBox>>>,
pub after: Arc<AtomicRefCell<Option<LayoutBox>>>,
pub before: ArcRefCell<Option<LayoutBox>>,
pub after: ArcRefCell<Option<LayoutBox>>,
}

pub(super) enum LayoutBox {
Expand Down

0 comments on commit 1d9f669

Please sign in to comment.