mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 594261 - IPC part - Factor out geolocation prompt into something that can be reused. r=chris jones, a=stuart
--HG-- rename : dom/src/geolocation/PGeolocationRequest.ipdl => dom/ipc/PContentPermissionRequest.ipdl extra : rebase_source : 73f75b6f4c4deae71337dd2a9925d15aefcaacb8
This commit is contained in:
parent
4511728eeb
commit
4c4c8dfdd9
@ -47,7 +47,7 @@ LIBXUL_LIBRARY = 1
|
|||||||
FORCE_STATIC_LIB = 1
|
FORCE_STATIC_LIB = 1
|
||||||
EXPORT_LIBRARY = 1
|
EXPORT_LIBRARY = 1
|
||||||
|
|
||||||
EXPORTS = TabMessageUtils.h
|
EXPORTS = TabMessageUtils.h PCOMContentPermissionRequestChild.h
|
||||||
|
|
||||||
EXPORTS_NAMESPACES = mozilla mozilla/dom
|
EXPORTS_NAMESPACES = mozilla mozilla/dom
|
||||||
|
|
||||||
@ -80,10 +80,10 @@ LOCAL_INCLUDES += \
|
|||||||
-I$(srcdir)/../../content/base/src \
|
-I$(srcdir)/../../content/base/src \
|
||||||
-I$(srcdir)/../../content/events/src \
|
-I$(srcdir)/../../content/events/src \
|
||||||
-I$(srcdir)/../../toolkit/components/places/src \
|
-I$(srcdir)/../../toolkit/components/places/src \
|
||||||
-I$(srcdir)/../src/geolocation \
|
|
||||||
-I$(topsrcdir)/chrome/src \
|
-I$(topsrcdir)/chrome/src \
|
||||||
-I$(topsrcdir)/uriloader/exthandler \
|
-I$(topsrcdir)/uriloader/exthandler \
|
||||||
-I$(srcdir)/../../netwerk/base/src \
|
-I$(srcdir)/../../netwerk/base/src \
|
||||||
|
-I$(srcdir)/../src/geolocation \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
CXXFLAGS += $(TK_CFLAGS)
|
CXXFLAGS += $(TK_CFLAGS)
|
||||||
|
@ -42,7 +42,7 @@ include protocol PContentDialog;
|
|||||||
include protocol PDocumentRenderer;
|
include protocol PDocumentRenderer;
|
||||||
include protocol PDocumentRendererShmem;
|
include protocol PDocumentRendererShmem;
|
||||||
include protocol PDocumentRendererNativeID;
|
include protocol PDocumentRendererNativeID;
|
||||||
include protocol PGeolocationRequest;
|
include protocol PContentPermissionRequest;
|
||||||
include protocol PExternalHelperApp;
|
include protocol PExternalHelperApp;
|
||||||
|
|
||||||
include "mozilla/TabTypes.h";
|
include "mozilla/TabTypes.h";
|
||||||
@ -71,7 +71,7 @@ rpc protocol PBrowser
|
|||||||
manages PDocumentRenderer;
|
manages PDocumentRenderer;
|
||||||
manages PDocumentRendererShmem;
|
manages PDocumentRendererShmem;
|
||||||
manages PDocumentRendererNativeID;
|
manages PDocumentRendererNativeID;
|
||||||
manages PGeolocationRequest;
|
manages PContentPermissionRequest;
|
||||||
manages PExternalHelperApp;
|
manages PExternalHelperApp;
|
||||||
|
|
||||||
both:
|
both:
|
||||||
@ -114,7 +114,7 @@ parent:
|
|||||||
|
|
||||||
QueryContentResult(nsQueryContentEvent event);
|
QueryContentResult(nsQueryContentEvent event);
|
||||||
|
|
||||||
PGeolocationRequest(URI uri);
|
PContentPermissionRequest(nsCString aType, URI uri);
|
||||||
|
|
||||||
PContentDialog(PRUint32 aType, nsCString aName, nsCString aFeatures,
|
PContentDialog(PRUint32 aType, nsCString aName, nsCString aFeatures,
|
||||||
PRInt32[] aIntParams, nsString[] aStringParams);
|
PRInt32[] aIntParams, nsString[] aStringParams);
|
||||||
|
54
dom/ipc/PCOMContentPermissionRequestChild.h
Normal file
54
dom/ipc/PCOMContentPermissionRequestChild.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* License.
|
||||||
|
*
|
||||||
|
* The Original Code is mozilla.org code.
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is
|
||||||
|
* The Mozilla Foundation
|
||||||
|
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* Doug Turner <dougt@mozilla.com> (Original Author)
|
||||||
|
*
|
||||||
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
|
* the provisions above, a recipient may use your version of this file under
|
||||||
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
#include "mozilla/dom/PContentPermissionRequestChild.h"
|
||||||
|
// Microsoft's API Name hackery sucks
|
||||||
|
#undef CreateEvent
|
||||||
|
|
||||||
|
/*
|
||||||
|
PContentPermissionRequestChild implementations also are
|
||||||
|
XPCOM objects. Addref() is called on their implementation
|
||||||
|
before SendPCOntentPermissionRequestConstructor is called.
|
||||||
|
When Dealloc is called, IPDLRelease() is called.
|
||||||
|
Implementations of this method are expected to call
|
||||||
|
Release() on themselves. See Bug 594261 for more
|
||||||
|
information.
|
||||||
|
*/
|
||||||
|
class PCOMContentPermissionRequestChild : public mozilla::dom::PContentPermissionRequestChild {
|
||||||
|
public:
|
||||||
|
virtual void IPDLRelease() = 0;
|
||||||
|
};
|
@ -43,7 +43,7 @@ using IPC::URI;
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
protocol PGeolocationRequest
|
protocol PContentPermissionRequest
|
||||||
{
|
{
|
||||||
manager PBrowser;
|
manager PBrowser;
|
||||||
|
|
@ -87,7 +87,7 @@
|
|||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "nsIView.h"
|
#include "nsIView.h"
|
||||||
#include "nsIEventListenerManager.h"
|
#include "nsIEventListenerManager.h"
|
||||||
#include "nsGeolocation.h"
|
#include "PCOMContentPermissionRequestChild.h"
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_QT
|
#ifdef MOZ_WIDGET_QT
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
@ -968,21 +968,18 @@ TabChild::DeallocPContentDialog(PContentDialogChild* aDialog)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The PGeolocationRequestChild actor is implemented by a refcounted
|
PContentPermissionRequestChild*
|
||||||
nsGeolocationRequest, and has an identical lifetime. */
|
TabChild::AllocPContentPermissionRequest(const nsCString& aType, const IPC::URI&)
|
||||||
|
|
||||||
PGeolocationRequestChild*
|
|
||||||
TabChild::AllocPGeolocationRequest(const IPC::URI&)
|
|
||||||
{
|
{
|
||||||
NS_RUNTIMEABORT("unused");
|
NS_RUNTIMEABORT("unused");
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TabChild::DeallocPGeolocationRequest(PGeolocationRequestChild* actor)
|
TabChild::DeallocPContentPermissionRequest(PContentPermissionRequestChild* actor)
|
||||||
{
|
{
|
||||||
static_cast<nsGeolocationRequest*>(actor)->Release();
|
static_cast<PCOMContentPermissionRequestChild*>(actor)->IPDLRelease();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -283,8 +283,8 @@ public:
|
|||||||
const gfxMatrix& aMatrix,
|
const gfxMatrix& aMatrix,
|
||||||
const PRUint32& aNativeID);
|
const PRUint32& aNativeID);
|
||||||
|
|
||||||
virtual PGeolocationRequestChild* AllocPGeolocationRequest(const IPC::URI& uri);
|
virtual PContentPermissionRequestChild* AllocPContentPermissionRequest(const nsCString& aType, const IPC::URI& uri);
|
||||||
virtual bool DeallocPGeolocationRequest(PGeolocationRequestChild* actor);
|
virtual bool DeallocPContentPermissionRequest(PContentPermissionRequestChild* actor);
|
||||||
|
|
||||||
nsIWebNavigation* WebNavigation() { return mWebNav; }
|
nsIWebNavigation* WebNavigation() { return mWebNav; }
|
||||||
|
|
||||||
|
@ -524,14 +524,18 @@ TabParent::DeallocPDocumentRendererNativeID(PDocumentRendererNativeIDParent* act
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PGeolocationRequestParent*
|
PContentPermissionRequestParent*
|
||||||
TabParent::AllocPGeolocationRequest(const IPC::URI& uri)
|
TabParent::AllocPContentPermissionRequest(const nsCString& type, const IPC::URI& uri)
|
||||||
{
|
{
|
||||||
return new GeolocationRequestParent(mFrameElement, uri);
|
if (type.Equals(NS_LITERAL_CSTRING("geolocation"))) {
|
||||||
|
return new GeolocationRequestParent(mFrameElement, uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
return nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TabParent::DeallocPGeolocationRequest(PGeolocationRequestParent* actor)
|
TabParent::DeallocPContentPermissionRequest(PContentPermissionRequestParent* actor)
|
||||||
{
|
{
|
||||||
delete actor;
|
delete actor;
|
||||||
return true;
|
return true;
|
||||||
|
@ -199,8 +199,8 @@ public:
|
|||||||
virtual bool DeallocPDocumentRendererNativeID(PDocumentRendererNativeIDParent* actor);
|
virtual bool DeallocPDocumentRendererNativeID(PDocumentRendererNativeIDParent* actor);
|
||||||
|
|
||||||
|
|
||||||
virtual PGeolocationRequestParent* AllocPGeolocationRequest(const IPC::URI& uri);
|
virtual PContentPermissionRequestParent* AllocPContentPermissionRequest(const nsCString& aType, const IPC::URI& uri);
|
||||||
virtual bool DeallocPGeolocationRequest(PGeolocationRequestParent* actor);
|
virtual bool DeallocPContentPermissionRequest(PContentPermissionRequestParent* actor);
|
||||||
|
|
||||||
JSBool GetGlobalJSObject(JSContext* cx, JSObject** globalp);
|
JSBool GetGlobalJSObject(JSContext* cx, JSObject** globalp);
|
||||||
|
|
||||||
|
@ -41,4 +41,5 @@ IPDLSRCS = \
|
|||||||
PDocumentRenderer.ipdl \
|
PDocumentRenderer.ipdl \
|
||||||
PDocumentRendererNativeID.ipdl \
|
PDocumentRendererNativeID.ipdl \
|
||||||
PDocumentRendererShmem.ipdl \
|
PDocumentRendererShmem.ipdl \
|
||||||
|
PContentPermissionRequest.ipdl \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
# ***** BEGIN LICENSE BLOCK *****
|
|
||||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
||||||
#
|
|
||||||
# The contents of this file are subject to the Mozilla Public License Version
|
|
||||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
||||||
# the License. You may obtain a copy of the License at
|
|
||||||
# http://www.mozilla.org/MPL/
|
|
||||||
#
|
|
||||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
||||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
||||||
# for the specific language governing rights and limitations under the
|
|
||||||
# License.
|
|
||||||
#
|
|
||||||
# The Original Code is Geolocation code.
|
|
||||||
#
|
|
||||||
# The Initial Developer of the Original Code is
|
|
||||||
# the Mozilla Foundation.
|
|
||||||
# Portions created by the Initial Developer are Copyright (C) 2010
|
|
||||||
# the Initial Developer. All Rights Reserved.
|
|
||||||
#
|
|
||||||
# Contributor(s):
|
|
||||||
# Josh Matthews <josh@joshmatthews.net> (Initial Developer)
|
|
||||||
#
|
|
||||||
# Alternatively, the contents of this file may be used under the terms of
|
|
||||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
||||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
||||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
||||||
# of those above. If you wish to allow use of your version of this file only
|
|
||||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
|
||||||
# use your version of this file under the terms of the MPL, indicate your
|
|
||||||
# decision by deleting the provisions above and replace them with the notice
|
|
||||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
||||||
# the provisions above, a recipient may use your version of this file under
|
|
||||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
|
||||||
#
|
|
||||||
# ***** END LICENSE BLOCK *****
|
|
||||||
|
|
||||||
IPDLSRCS = \
|
|
||||||
PGeolocationRequest.ipdl \
|
|
||||||
$(NULL)
|
|
@ -1115,13 +1115,14 @@ nsGeolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request)
|
|||||||
// the one and only TabChild.
|
// the one and only TabChild.
|
||||||
TabChild* child = GetTabChildFrom(window->GetDocShell());
|
TabChild* child = GetTabChildFrom(window->GetDocShell());
|
||||||
|
|
||||||
child->SendPGeolocationRequestConstructor(request, IPC::URI(mURI));
|
|
||||||
|
|
||||||
// Retain a reference so the object isn't deleted without IPDL's knowledge.
|
// Retain a reference so the object isn't deleted without IPDL's knowledge.
|
||||||
// Corresponding release occurs in DeallocPGeolocationRequest.
|
// Corresponding release occurs in DeallocPContentPermissionRequest.
|
||||||
request->AddRef();
|
request->AddRef();
|
||||||
|
|
||||||
unused << request->Sendprompt();
|
nsCString type = NS_LITERAL_CSTRING("geolocation");
|
||||||
|
child->SendPContentPermissionRequestConstructor(request, type, IPC::URI(mURI));
|
||||||
|
|
||||||
|
request->Sendprompt();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#define nsGeoLocation_h
|
#define nsGeoLocation_h
|
||||||
|
|
||||||
#ifdef MOZ_IPC
|
#ifdef MOZ_IPC
|
||||||
#include "mozilla/dom/PGeolocationRequestChild.h"
|
#include "mozilla/dom/PContentPermissionRequestChild.h"
|
||||||
// Microsoft's API Name hackery sucks
|
// Microsoft's API Name hackery sucks
|
||||||
#undef CreateEvent
|
#undef CreateEvent
|
||||||
#endif
|
#endif
|
||||||
@ -67,6 +67,10 @@
|
|||||||
#include "nsIGeolocationProvider.h"
|
#include "nsIGeolocationProvider.h"
|
||||||
#include "nsIContentPermissionPrompt.h"
|
#include "nsIContentPermissionPrompt.h"
|
||||||
|
|
||||||
|
#ifdef MOZ_IPC
|
||||||
|
#include "PCOMContentPermissionRequestChild.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class nsGeolocationService;
|
class nsGeolocationService;
|
||||||
class nsGeolocation;
|
class nsGeolocation;
|
||||||
|
|
||||||
@ -74,7 +78,7 @@ class nsGeolocationRequest
|
|||||||
: public nsIContentPermissionRequest
|
: public nsIContentPermissionRequest
|
||||||
, public nsITimerCallback
|
, public nsITimerCallback
|
||||||
#ifdef MOZ_IPC
|
#ifdef MOZ_IPC
|
||||||
, public mozilla::dom::PGeolocationRequestChild
|
, public PCOMContentPermissionRequestChild
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -100,6 +104,7 @@ class nsGeolocationRequest
|
|||||||
|
|
||||||
#ifdef MOZ_IPC
|
#ifdef MOZ_IPC
|
||||||
bool Recv__delete__(const bool& allow);
|
bool Recv__delete__(const bool& allow);
|
||||||
|
void IPDLRelease() { Release(); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -45,14 +45,14 @@
|
|||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsIDOMElement.h"
|
#include "nsIDOMElement.h"
|
||||||
|
|
||||||
#include "mozilla/dom/PGeolocationRequestParent.h"
|
#include "mozilla/dom/PContentPermissionRequestParent.h"
|
||||||
|
|
||||||
class nsGeolocationRequestProxy;
|
class nsGeolocationRequestProxy;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
class GeolocationRequestParent : public PGeolocationRequestParent
|
class GeolocationRequestParent : public PContentPermissionRequestParent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GeolocationRequestParent(nsIDOMElement *element, const IPC::URI& principal);
|
GeolocationRequestParent(nsIDOMElement *element, const IPC::URI& principal);
|
||||||
|
@ -55,7 +55,6 @@ EXPORT_LIBRARY = 1
|
|||||||
##
|
##
|
||||||
IPDLDIRS = \
|
IPDLDIRS = \
|
||||||
uriloader/exthandler \
|
uriloader/exthandler \
|
||||||
dom/src/geolocation \
|
|
||||||
dom/plugins \
|
dom/plugins \
|
||||||
dom/ipc \
|
dom/ipc \
|
||||||
gfx/layers/ipc \
|
gfx/layers/ipc \
|
||||||
|
Loading…
Reference in New Issue
Block a user