Bug 1117337 - Make icon URIs constructable via XPCOM. r=seth
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 12 Feb 2015 15:41:21 -0800
changeset 256027 0792fde211c625b7093e60f4e811fd3d3d224112
parent 256026 ae4d683969e37bd7d651c347e1ccadceca4e1653
child 256028 0c38815d00a7a801ebd0562b62eeff11c0a64c99
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs1117337
milestone38.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 1117337 - Make icon URIs constructable via XPCOM. r=seth
b2g/installer/package-manifest.in
browser/installer/package-manifest.in
image/decoders/icon/moz.build
image/decoders/icon/nsIIconURI.idl
image/decoders/icon/nsIconModule.cpp
image/decoders/icon/nsIconURI.h
image/public/moz.build
image/public/nsIIconURI.idl
mobile/android/installer/package-manifest.in
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -232,17 +232,16 @@
 @BINPATH@/components/find.xpt
 @BINPATH@/components/fuel.xpt
 @BINPATH@/components/gfx.xpt
 @BINPATH@/components/hal.xpt
 @BINPATH@/components/html5.xpt
 @BINPATH@/components/htmlparser.xpt
 @BINPATH@/components/identity.xpt
 @BINPATH@/components/imglib2.xpt
-@BINPATH@/components/imgicon.xpt
 @BINPATH@/components/inspector.xpt
 @BINPATH@/components/intl.xpt
 @BINPATH@/components/jar.xpt
 @BINPATH@/components/jsdebugger.xpt
 @BINPATH@/components/jsdownloads.xpt
 @BINPATH@/components/jsinspector.xpt
 @BINPATH@/components/layout_base.xpt
 #ifdef NS_PRINTING
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -258,17 +258,16 @@
 #endif
 @RESPATH@/components/find.xpt
 @RESPATH@/browser/components/fuel.xpt
 @RESPATH@/components/gfx.xpt
 @RESPATH@/components/html5.xpt
 @RESPATH@/components/htmlparser.xpt
 @RESPATH@/components/identity.xpt
 @RESPATH@/components/imglib2.xpt
-@RESPATH@/components/imgicon.xpt
 @RESPATH@/components/inspector.xpt
 @RESPATH@/components/intl.xpt
 @RESPATH@/components/jar.xpt
 @RESPATH@/components/jsdebugger.xpt
 @RESPATH@/components/jsdownloads.xpt
 @RESPATH@/components/jsinspector.xpt
 @RESPATH@/components/layout_base.xpt
 #ifdef NS_PRINTING
--- a/image/decoders/icon/moz.build
+++ b/image/decoders/icon/moz.build
@@ -1,20 +1,14 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
-XPIDL_SOURCES += [
-    'nsIIconURI.idl',
-]
-
-XPIDL_MODULE = 'imgicon'
-
 UNIFIED_SOURCES += [
     'nsIconModule.cpp',
     'nsIconProtocolHandler.cpp',
     'nsIconURI.cpp',
 ]
 
 FAIL_ON_WARNINGS = True
 
--- a/image/decoders/icon/nsIconModule.cpp
+++ b/image/decoders/icon/nsIconModule.cpp
@@ -14,21 +14,24 @@
 // objects that just require generic constructors
 //*****************************************************************************
 // Protocol CIDs
 
 #define NS_ICONPROTOCOL_CID { 0xd0f9db12, 0x249c, 0x11d5, \
                               { 0x99, 0x5, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } }
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIconProtocolHandler)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsMozIconURI)
 
 NS_DEFINE_NAMED_CID(NS_ICONPROTOCOL_CID);
+NS_DEFINE_NAMED_CID(NS_MOZICONURI_CID);
 
 static const mozilla::Module::CIDEntry kIconCIDs[] = {
   { &kNS_ICONPROTOCOL_CID, false, nullptr, nsIconProtocolHandlerConstructor },
+  { &kNS_MOZICONURI_CID, false, nullptr, nsMozIconURIConstructor },
   { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kIconContracts[] = {
   { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-icon", &kNS_ICONPROTOCOL_CID },
   { nullptr }
 };
 
--- a/image/decoders/icon/nsIconURI.h
+++ b/image/decoders/icon/nsIconURI.h
@@ -6,24 +6,16 @@
 
 #ifndef nsMozIconURI_h__
 #define nsMozIconURI_h__
 
 #include "nsIIconURI.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 
-#define NS_MOZICONURI_CID                            \
-{                                                    \
-    0x43a88e0e,                                      \
-    0x2d37,                                          \
-    0x11d5,                                          \
-    { 0x99, 0x7, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b }   \
-}
-
 class nsMozIconURI MOZ_FINAL : public nsIMozIconURI
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURI
   NS_DECL_NSIMOZICONURI
 
   // nsMozIconURI
--- a/image/public/moz.build
+++ b/image/public/moz.build
@@ -10,16 +10,17 @@ XPIDL_SOURCES += [
     'imgIContainerDebug.idl',
     'imgIEncoder.idl',
     'imgILoader.idl',
     'imgINotificationObserver.idl',
     'imgIOnloadBlocker.idl',
     'imgIRequest.idl',
     'imgIScriptedNotificationObserver.idl',
     'imgITools.idl',
+    'nsIIconURI.idl',
 ]
 
 XPIDL_MODULE = 'imglib2'
 
 EXPORTS += [
     'ImageLogging.h',
 ]
 
rename from image/decoders/icon/nsIIconURI.idl
rename to image/public/nsIIconURI.idl
--- a/image/decoders/icon/nsIIconURI.idl
+++ b/image/public/nsIIconURI.idl
@@ -64,8 +64,21 @@ interface nsIMozIconURI : nsIURI
    readonly attribute ACString iconState;
 
   /// contentType: A valid mime type, or the empty string.
   attribute ACString contentType;
 
   /// fileExtension: The file extension of the file which we are looking up.
   readonly attribute ACString fileExtension;
 };
+
+%{C++
+
+// CID for nsMozIconURI, if implemented on this platform.
+#define NS_MOZICONURI_CID                            \
+{                                                    \
+    0x43a88e0e,                                      \
+    0x2d37,                                          \
+    0x11d5,                                          \
+    { 0x99, 0x7, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b }   \
+}
+
+%}
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -186,17 +186,16 @@
 @BINPATH@/components/fastfind.xpt
 @BINPATH@/components/feeds.xpt
 @BINPATH@/components/find.xpt
 @BINPATH@/components/fuel.xpt
 @BINPATH@/components/gfx.xpt
 @BINPATH@/components/html5.xpt
 @BINPATH@/components/htmlparser.xpt
 @BINPATH@/components/imglib2.xpt
-@BINPATH@/components/imgicon.xpt
 @BINPATH@/components/inspector.xpt
 @BINPATH@/components/intl.xpt
 @BINPATH@/components/jar.xpt
 @BINPATH@/components/jsdebugger.xpt
 @BINPATH@/components/jsdownloads.xpt
 @BINPATH@/components/jsinspector.xpt
 @BINPATH@/components/layout_base.xpt
 #ifdef NS_PRINTING