Back out 5e4cee2fcbc6 (bug 963294) for build bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 23 Feb 2014 12:59:52 -0800
changeset 170485 3fedf7d4f967f1eafce86903a9a43ab03e7a02aa
parent 170484 5e4cee2fcbc682e19f12cee896243dd7b3bdad7f
child 170486 676016cd743ddc3f976067a4a96b0ef07405621a
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
bugs963294
milestone30.0a1
backs out5e4cee2fcbc682e19f12cee896243dd7b3bdad7f
Back out 5e4cee2fcbc6 (bug 963294) for build bustage CLOSED TREE
dom/ipc/ColorPickerParent.cpp
dom/ipc/ColorPickerParent.h
dom/ipc/PBrowser.ipdl
dom/ipc/PColorPicker.ipdl
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/ipc/moz.build
widget/xpwidgets/moz.build
widget/xpwidgets/nsColorPickerProxy.cpp
widget/xpwidgets/nsColorPickerProxy.h
widget/xpwidgets/nsContentProcessWidgetFactory.cpp
deleted file mode 100644
--- a/dom/ipc/ColorPickerParent.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set sw=4 ts=8 et 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 "ColorPickerParent.h"
-#include "nsComponentManagerUtils.h"
-#include "nsIDocument.h"
-#include "nsIDOMWindow.h"
-#include "mozilla/unused.h"
-#include "mozilla/dom/Element.h"
-#include "mozilla/dom/TabParent.h"
-
-using mozilla::unused;
-using namespace mozilla::dom;
-
-NS_IMPL_ISUPPORTS1(ColorPickerParent::ColorPickerShownCallback,
-                   nsIColorPickerShownCallback);
-
-NS_IMETHODIMP
-ColorPickerParent::ColorPickerShownCallback::Update(const nsAString& aColor)
-{
-  if (mColorPickerParent) {
-    unused << mColorPickerParent->SendUpdate(nsString(aColor));
-  }
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-ColorPickerParent::ColorPickerShownCallback::Done(const nsAString& aColor)
-{
-  if (mColorPickerParent) {
-    unused << mColorPickerParent->Send__delete__(mColorPickerParent,
-                                                 nsString(aColor));
-  }
-  return NS_OK;
-}
-
-void
-ColorPickerParent::ColorPickerShownCallback::Destroy()
-{
-  mColorPickerParent = nullptr;
-}
-
-bool
-ColorPickerParent::CreateColorPicker()
-{
-  mPicker = do_CreateInstance("@mozilla.org/colorpicker;1");
-  if (!mPicker) {
-    return false;
-  }
-
-  Element* ownerElement = static_cast<TabParent*>(Manager())->GetOwnerElement();
-  if (!ownerElement) {
-    return false;
-  }
-
-  nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(ownerElement->OwnerDoc()->GetWindow());
-  if (!window) {
-    return false;
-  }
-
-  return NS_SUCCEEDED(mPicker->Init(window, mTitle, mInitialColor));
-}
-
-bool
-ColorPickerParent::RecvOpen()
-{
-  if (!CreateColorPicker()) {
-    unused << Send__delete__(this, mInitialColor);
-    return true;
-  }
-
-  mCallback = new ColorPickerShownCallback(this);
-
-  mPicker->Open(mCallback);
-  return true;
-};
-
-void
-ColorPickerParent::ActorDestroy(ActorDestroyReason aWhy)
-{
-  if (mCallback) {
-    mCallback->Destroy();
-  }
-}
deleted file mode 100644
--- a/dom/ipc/ColorPickerParent.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim: set sw=4 ts=8 et 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/. */
-
-#ifndef mozilla_dom_ColorPickerParent_h
-#define mozilla_dom_ColorPickerParent_h
-
-#include "mozilla/dom/PColorPickerParent.h"
-#include "nsIColorPicker.h"
-
-namespace mozilla {
-namespace dom {
-
-class ColorPickerParent : public PColorPickerParent
-{
- public:
-  ColorPickerParent(const nsString& aTitle,
-                    const nsString& aInitialColor)
-  : mTitle(aTitle)
-  , mInitialColor(aInitialColor)
-  {}
-
-  virtual ~ColorPickerParent() {}
-
-  virtual bool RecvOpen() MOZ_OVERRIDE;
-  virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
-
-  class ColorPickerShownCallback MOZ_FINAL
-    : public nsIColorPickerShownCallback
-  {
-  public:
-    ColorPickerShownCallback(ColorPickerParent* aColorPickerParnet)
-      : mColorPickerParent(aColorPickerParnet)
-    {}
-
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSICOLORPICKERSHOWNCALLBACK
-
-    void Destroy();
-
-  private:
-    ColorPickerParent* mColorPickerParent;
-  };
-
- private:
-  bool CreateColorPicker();
-
-  nsRefPtr<ColorPickerShownCallback> mCallback;
-  nsCOMPtr<nsIColorPicker> mPicker;
-
-  nsString mTitle;
-  nsString mInitialColor;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_ColorPickerParent_h
\ No newline at end of file
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
 
 /* 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 protocol PBlob;
-include protocol PColorPicker;
 include protocol PContent;
 include protocol PContentDialog;
 include protocol PDocumentRenderer;
 include protocol PContentPermissionRequest;
 include protocol PFilePicker;
 include protocol PRenderFrame;
 include protocol POfflineCacheUpdate;
 include protocol PIndexedDB;
@@ -53,17 +52,16 @@ using mozilla::CSSToScreenScale from "Un
 
 namespace mozilla {
 namespace dom {
 
 intr protocol PBrowser
 {
     manager PContent;
 
-    manages PColorPicker;
     manages PContentDialog;
     manages PDocumentRenderer;
     manages PContentPermissionRequest;
     manages PFilePicker;
     manages PRenderFrame;
     manages POfflineCacheUpdate;
     manages PIndexedDB;
 
@@ -219,22 +217,16 @@ parent:
     /**
      * Show/hide a tooltip when the mouse hovers over an element in the content
      * document.
      */
     ShowTooltip(uint32_t x, uint32_t y, nsString tooltip);
     HideTooltip();
 
     /**
-     * Create an asynchronous color picker on the parent side,
-     * but don't open it yet.
-     */
-    PColorPicker(nsString title, nsString initialColor);
-
-    /**
      * Initiates an asynchronous request for permission for the
      * provided principal.
      *
      * @param aRequests
      *   The array of permissions to request.
      * @param aPrincipal
      *   The principal of the request.
      *
deleted file mode 100644
--- a/dom/ipc/PColorPicker.ipdl
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
-/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
-
-/* 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 protocol PBrowser;
-
-namespace mozilla {
-namespace dom {
-
-protocol PColorPicker
-{
-    manager PBrowser;
-
-parent:
-    Open();
-
-child:
-    Update(nsString color);
-
-    __delete__(nsString color);
-};
-
-} // namespace dom
-} // namespace mozilla
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -70,18 +70,16 @@
 #include "StructuredCloneUtils.h"
 #include "nsViewportInfo.h"
 #include "JavaScriptChild.h"
 #include "APZCCallbackHelper.h"
 #include "nsILoadContext.h"
 #include "ipc/nsGUIEventIPC.h"
 #include "mozilla/gfx/Matrix.h"
 
-#include "nsColorPickerProxy.h"
-
 #ifdef DEBUG
 #include "PCOMContentPermissionRequestChild.h"
 #endif /* DEBUG */
 
 #define BROWSER_ELEMENT_CHILD_SCRIPT \
     NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js")
 
 using namespace mozilla;
@@ -2090,31 +2088,16 @@ TabChild::RecvPDocumentRendererConstruct
                                       renderFlags, flushLayout,
                                       renderSize, data);
     if (!ret)
         return true; // silently ignore
 
     return PDocumentRendererChild::Send__delete__(actor, renderSize, data);
 }
 
-PColorPickerChild*
-TabChild::AllocPColorPickerChild(const nsString&, const nsString&)
-{
-  NS_RUNTIMEABORT("unused");
-  return nullptr;
-}
-
-bool
-TabChild::DeallocPColorPickerChild(PColorPickerChild* aColorPicker)
-{
-  nsColorPickerProxy* picker = static_cast<nsColorPickerProxy*>(aColorPicker);
-  NS_RELEASE(picker);
-  return true;
-}
-
 PContentDialogChild*
 TabChild::AllocPContentDialogChild(const uint32_t&,
                                    const nsCString&,
                                    const nsCString&,
                                    const InfallibleTArray<int>&,
                                    const InfallibleTArray<nsString>&)
 {
   return new ContentDialogChild();
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -273,29 +273,23 @@ public:
     virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
                                                   const nsRect& documentRect,
                                                   const gfx::Matrix& transform,
                                                   const nsString& bgcolor,
                                                   const uint32_t& renderFlags,
                                                   const bool& flushLayout,
                                                   const nsIntSize& renderSize) MOZ_OVERRIDE;
 
-    virtual PColorPickerChild*
-    AllocPColorPickerChild(const nsString& title, const nsString& initialColor) MOZ_OVERRIDE;
-    virtual bool DeallocPColorPickerChild(PColorPickerChild* actor) MOZ_OVERRIDE;
-
-
     virtual PContentDialogChild* AllocPContentDialogChild(const uint32_t&,
                                                           const nsCString&,
                                                           const nsCString&,
                                                           const InfallibleTArray<int>&,
                                                           const InfallibleTArray<nsString>&)
                                                           MOZ_OVERRIDE;
     virtual bool DeallocPContentDialogChild(PContentDialogChild* aDialog) MOZ_OVERRIDE;
-
     static void ParamsToArrays(nsIDialogParamBlock* aParams,
                                InfallibleTArray<int>& aIntParams,
                                InfallibleTArray<nsString>& aStringParams);
     static void ArraysToParams(const InfallibleTArray<int>& aIntParams,
                                const InfallibleTArray<nsString>& aStringParams,
                                nsIDialogParamBlock* aParams);
 
 #ifdef DEBUG
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -9,17 +9,16 @@
 #include "TabParent.h"
 
 #include "AppProcessChecker.h"
 #include "IDBFactory.h"
 #include "IndexedDBParent.h"
 #include "mozIApplication.h"
 #include "mozilla/BrowserElementParent.h"
 #include "mozilla/docshell/OfflineCacheUpdateParent.h"
-#include "mozilla/dom/PColorPickerParent.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/PContentPermissionRequestParent.h"
 #include "mozilla/Hal.h"
 #include "mozilla/ipc/DocumentRendererParent.h"
 #include "mozilla/layers/CompositorParent.h"
 #include "mozilla/layout/RenderFrameParent.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/Preferences.h"
@@ -1621,30 +1620,16 @@ TabParent::GetAuthPrompt(uint32_t aPromp
     window = do_QueryInterface(frame->OwnerDoc()->GetWindow());
 
   // Get an auth prompter for our window so that the parenting
   // of the dialogs works as it should when using tabs.
   return wwatch->GetPrompt(window, iid,
                            reinterpret_cast<void**>(aResult));
 }
 
-PColorPickerParent*
-TabParent::AllocPColorPickerParent(const nsString& aTitle,
-                                   const nsString& aInitialColor)
-{
-  return new ColorPickerParent(aTitle, aInitialColor);
-}
-
-bool
-TabParent::DeallocPColorPickerParent(PColorPickerParent* actor)
-{
-  delete actor;
-  return true;
-}
-
 PContentDialogParent*
 TabParent::AllocPContentDialogParent(const uint32_t& aType,
                                      const nsCString& aName,
                                      const nsCString& aFeatures,
                                      const InfallibleTArray<int>& aIntParams,
                                      const InfallibleTArray<nsString>& aStringParams)
 {
   ContentDialogParent* parent = new ContentDialogParent();
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -182,21 +182,16 @@ public:
                                 const ViewID& aViewId,
                                 const CSSRect& aRect) MOZ_OVERRIDE;
     virtual bool RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
                                            const ViewID& aViewId,
                                            const bool& aIsRoot,
                                            const ZoomConstraints& aConstraints) MOZ_OVERRIDE;
     virtual bool RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid,
                                           const bool& aPreventDefault) MOZ_OVERRIDE;
-
-    virtual PColorPickerParent*
-    AllocPColorPickerParent(const nsString& aTitle, const nsString& aInitialColor) MOZ_OVERRIDE;
-    virtual bool DeallocPColorPickerParent(PColorPickerParent* aColorPicker) MOZ_OVERRIDE;
-
     virtual PContentDialogParent*
     AllocPContentDialogParent(const uint32_t& aType,
                               const nsCString& aName,
                               const nsCString& aFeatures,
                               const InfallibleTArray<int>& aIntParams,
                               const InfallibleTArray<nsString>& aStringParams) MOZ_OVERRIDE;
     virtual bool DeallocPContentDialogParent(PContentDialogParent* aDialog) MOZ_OVERRIDE
     {
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -35,17 +35,16 @@ EXPORTS.mozilla.dom += [
 EXPORTS.mozilla += [
     'AppProcessChecker.h',
     'PreallocatedProcessManager.h',
     'ProcessPriorityManager.h',
 ]
 
 UNIFIED_SOURCES += [
     'AppProcessChecker.cpp',
-    'ColorPickerParent.cpp',
     'ContentChild.cpp',
     'ContentParent.cpp',
     'ContentProcess.cpp',
     'CrashReporterParent.cpp',
     'FilePickerParent.cpp',
     'PermissionMessageUtils.cpp',
     'PreallocatedProcessManager.cpp',
     'ProcessPriorityManager.cpp',
@@ -64,17 +63,16 @@ SOURCES += [
     'CrashReporterChild.cpp',
 ]
 
 IPDL_SOURCES += [
     'DOMTypes.ipdlh',
     'PBlob.ipdl',
     'PBlobStream.ipdl',
     'PBrowser.ipdl',
-    'PColorPicker.ipdl',
     'PContent.ipdl',
     'PContentDialog.ipdl',
     'PContentPermission.ipdlh',
     'PContentPermissionRequest.ipdl',
     'PCrashReporter.ipdl',
     'PDocumentRenderer.ipdl',
     'PFilePicker.ipdl',
     'PMemoryReportRequest.ipdl',
--- a/widget/xpwidgets/moz.build
+++ b/widget/xpwidgets/moz.build
@@ -21,17 +21,16 @@ UNIFIED_SOURCES += [
     'GfxInfoWebGL.cpp',
     'InputData.cpp',
     'nsBaseAppShell.cpp',
     'nsBaseDragService.cpp',
     'nsBaseScreen.cpp',
     'nsClipboardHelper.cpp',
     'nsClipboardPrivacyHandler.cpp',
     'nsClipboardProxy.cpp',
-    'nsColorPickerProxy.cpp',
     'nsContentProcessWidgetFactory.cpp',
     'nsFilePickerProxy.cpp',
     'nsHTMLFormatConverter.cpp',
     'nsIdleService.cpp',
     'nsIWidgetListener.cpp',
     'nsPrimitiveHelpers.cpp',
     'nsPrintOptionsImpl.cpp',
     'nsPrintSession.cpp',
deleted file mode 100644
--- a/widget/xpwidgets/nsColorPickerProxy.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * 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 "nsColorPickerProxy.h"
-
-#include "mozilla/dom/TabChild.h"
-
-using namespace mozilla::dom;
-
-NS_IMPL_ISUPPORTS1(nsColorPickerProxy, nsIColorPicker)
-
-/* void init (in nsIDOMWindow parent, in AString title, in short mode); */
-NS_IMETHODIMP
-nsColorPickerProxy::Init(nsIDOMWindow* aParent, const nsAString& aTitle,
-                         const nsAString& aInitialColor)
-{
-  TabChild* tabChild = TabChild::GetFrom(aParent);
-  if (!tabChild) {
-    return NS_ERROR_FAILURE;
-  }
-
-  tabChild->SendPColorPickerConstructor(this,
-                                        nsString(aTitle),
-                                        nsString(aInitialColor));
-  NS_ADDREF_THIS();
-  return NS_OK;
-}
-
-/* void open (in nsIColorPickerShownCallback aColorPickerShownCallback); */
-NS_IMETHODIMP
-nsColorPickerProxy::Open(nsIColorPickerShownCallback* aColorPickerShownCallback)
-{
-  NS_ENSURE_STATE(!mCallback);
-  mCallback = aColorPickerShownCallback;
-
-  SendOpen();
-  return NS_OK;
-}
-
-bool
-nsColorPickerProxy::RecvUpdate(const nsString& aColor)
-{
-  if (mCallback) {
-    mCallback->Update(aColor);
-  }
-  return true;
-}
-
-bool
-nsColorPickerProxy::Recv__delete__(const nsString& aColor)
-{
-  if (mCallback) {
-    mCallback->Done(aColor);
-    mCallback = nullptr;
-  }
-  return true;
-}
\ No newline at end of file
deleted file mode 100644
--- a/widget/xpwidgets/nsColorPickerProxy.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#ifndef nsColorPickerProxy_h
-#define nsColorPickerProxy_h
-
-#include "nsIColorPicker.h"
-
-#include "mozilla/dom/PColorPickerChild.h"
-
-class nsColorPickerProxy MOZ_FINAL : public nsIColorPicker,
-                                     public mozilla::dom::PColorPickerChild
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSICOLORPICKER
-
-  nsColorPickerProxy() {}
-  ~nsColorPickerProxy() {}
-
-  virtual bool RecvUpdate(const nsString& aColor) MOZ_OVERRIDE;
-  virtual bool Recv__delete__(const nsString& aColor) MOZ_OVERRIDE;
-
-private:
-  nsCOMPtr<nsIColorPickerShownCallback> mCallback;
-  nsString mTitle;
-  nsString mInitialColor;
-};
-
-#endif // nsColorPickerProxy_h
--- a/widget/xpwidgets/nsContentProcessWidgetFactory.cpp
+++ b/widget/xpwidgets/nsContentProcessWidgetFactory.cpp
@@ -3,44 +3,38 @@
  */
 /* 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/ModuleUtils.h"
 #include "nsWidgetsCID.h"
 #include "nsClipboardProxy.h"
-#include "nsColorPickerProxy.h"
 #include "nsFilePickerProxy.h"
 
 using namespace mozilla;
 
 #ifndef MOZ_B2G
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardProxy)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsColorPickerProxy)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePickerProxy)
 
 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
-NS_DEFINE_NAMED_CID(NS_COLORPICKER_CID);
 NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
 
 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
     { &kNS_CLIPBOARD_CID, false, nullptr, nsClipboardProxyConstructor,
       Module::CONTENT_PROCESS_ONLY },
-    { &kNS_COLORPICKER_CID, false, nullptr, nsColorPickerProxyConstructor,
-      Module::CONTENT_PROCESS_ONLY },
     { &kNS_FILEPICKER_CID, false, nullptr, nsFilePickerProxyConstructor,
       Module::CONTENT_PROCESS_ONLY },
     { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
     { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID, Module::CONTENT_PROCESS_ONLY },
-    { "@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID, Module::CONTENT_PROCESS_ONLY },
     { "@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID, Module::CONTENT_PROCESS_ONLY },
     { nullptr }
 };
 
 static const mozilla::Module kWidgetModule = {
     mozilla::Module::kVersion,
     kWidgetCIDs,
     kWidgetContracts