Bug 1352025 part 1 - Use a UrlExtraData type alias to unify url handling logic. r=manishearth
authorXidorn Quan <me@upsuper.org>
Fri, 31 Mar 2017 12:03:45 +1100
changeset 350932 b5e5c568c04fa3dbcb2f5c99b2f83c174ee20b0b
parent 350931 4487ef34d11058888d6335f28cd049efc0861db6
child 350933 3952d677963ea0c9d255c71524b2bf4249b8128c
push id39990
push userxquan@mozilla.com
push dateMon, 03 Apr 2017 12:52:37 +0000
treeherderautoland@07acdc80806e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmanishearth
bugs1352025
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1352025 part 1 - Use a UrlExtraData type alias to unify url handling logic. r=manishearth MozReview-Commit-ID: 6gZHGQWbpAW
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -2,16 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ServoBindings.h"
 
 #include "ChildIterator.h"
+#include "NullPrincipalURI.h"
 #include "gfxFontFamilyList.h"
 #include "nsAnimationManager.h"
 #include "nsAttrValueInlines.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsCSSProps.h"
 #include "nsCSSParser.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCSSRuleProcessor.h"
@@ -1572,16 +1573,25 @@ Gecko_LoadStyleSheet(css::Loader* aLoade
     // silently do nothing.  Eventually we should be able to assert that the
     // NS_NewURI succeeds, here.
     return;
   }
 
   aLoader->LoadChildSheet(aParent, uri, media, nullptr, aChildSheet, nullptr);
 }
 
+RawGeckoURLExtraData*
+Gecko_URLExtraData_CreateDummy()
+{
+  RefPtr<css::URLExtraData> data =
+    new css::URLExtraData(NullPrincipalURI::Create(), nullptr,
+                          NullPrincipal::Create());
+  return data.forget().take();
+}
+
 const nsMediaFeature*
 Gecko_GetMediaFeatures()
 {
   return nsMediaFeatures::features;
 }
 
 nsCSSFontFaceRule*
 Gecko_CSSFontFaceRule_Create()
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -113,16 +113,20 @@ void Gecko_LoadStyleSheet(mozilla::css::
                           mozilla::ServoStyleSheet* parent,
                           RawServoStyleSheetBorrowed child_sheet,
                           RawGeckoURLExtraData* base_url_data,
                           const uint8_t* url_bytes,
                           uint32_t url_length,
                           const uint8_t* media_bytes,
                           uint32_t media_length);
 
+// URLExtraData
+// Create a new addrefed URLExtraData.
+RawGeckoURLExtraData* Gecko_URLExtraData_CreateDummy();
+
 // By default, Servo walks the DOM by traversing the siblings of the DOM-view
 // first child. This generally works, but misses anonymous children, which we
 // want to traverse during styling. To support these cases, we create an
 // optional heap-allocated iterator for nodes that need it. If the creation
 // method returns null, Servo falls back to the aforementioned simpler (and
 // faster) sibling traversal.
 StyleChildrenIteratorOwnedOrNull Gecko_MaybeCreateStyleChildrenIterator(RawGeckoNodeBorrowed node);
 void Gecko_DropStyleChildrenIterator(StyleChildrenIteratorOwned it);