Skip to content
Permalink
Browse files

style: Add ToShmem impl for URLValueSource.

  • Loading branch information...
heycam authored and emilio committed Mar 30, 2019
1 parent b8506e4 commit 41f6e67893f3c6cdc6a4700fa479c892b0c59db8
Showing with 11 additions and 0 deletions.
  1. +11 −0 components/style/gecko/url.rs
@@ -19,8 +19,10 @@ use nsstring::nsCString;
use servo_arc::Arc;
use std::collections::HashMap;
use std::fmt::{self, Write};
use std::mem::ManuallyDrop;
use std::sync::RwLock;
use style_traits::{CssWriter, ParseError, ToCss};
use to_shmem::{SharedMemoryBuilder, ToShmem};

/// A CSS url() value for gecko.
#[css(function = "url")]
@@ -138,6 +140,15 @@ pub enum URLValueSource {
CORSMode(CORSMode),
}

impl ToShmem for URLValueSource {
fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> ManuallyDrop<Self> {
ManuallyDrop::new(match self {
URLValueSource::URLValue(r) => URLValueSource::CORSMode(r.mCORSMode),
URLValueSource::CORSMode(c) => URLValueSource::CORSMode(*c),
})
}
}

/// A specified non-image `url()` value.
#[derive(Clone, Debug, SpecifiedValueInfo, ToCss)]
pub struct SpecifiedUrl {

0 comments on commit 41f6e67

Please sign in to comment.
You can’t perform that action at this time.