2009-06-30 11:51:05 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
* vim: sw=4 ts=4 et :
|
2012-05-21 04:12:37 -07:00
|
|
|
* 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/. */
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2009-09-08 23:31:35 -07:00
|
|
|
#ifndef dom_plugins_PluginInstanceParent_h
|
|
|
|
#define dom_plugins_PluginInstanceParent_h 1
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2009-09-09 15:59:06 -07:00
|
|
|
#include "mozilla/plugins/PPluginInstanceParent.h"
|
2009-09-08 23:31:35 -07:00
|
|
|
#include "mozilla/plugins/PluginScriptableObjectParent.h"
|
2009-12-01 13:05:26 -08:00
|
|
|
#if defined(OS_WIN)
|
|
|
|
#include "mozilla/gfx/SharedDIBWin.h"
|
2012-05-29 22:14:30 -07:00
|
|
|
#include <d3d10_1.h>
|
|
|
|
#include "nsRefPtrHashtable.h"
|
2011-06-25 08:25:03 -07:00
|
|
|
#elif defined(MOZ_WIDGET_COCOA)
|
2012-07-31 08:11:57 -07:00
|
|
|
#include "mozilla/gfx/QuartzSupport.h"
|
2009-12-01 13:05:26 -08:00
|
|
|
#endif
|
2009-06-30 11:51:05 -07:00
|
|
|
|
|
|
|
#include "npfunctions.h"
|
2009-09-23 00:12:52 -07:00
|
|
|
#include "nsAutoPtr.h"
|
2010-01-15 12:35:57 -08:00
|
|
|
#include "nsDataHashtable.h"
|
|
|
|
#include "nsHashKeys.h"
|
2009-12-01 13:05:26 -08:00
|
|
|
#include "nsRect.h"
|
2012-08-19 12:33:25 -07:00
|
|
|
|
2010-09-15 09:02:49 -07:00
|
|
|
#ifdef MOZ_X11
|
|
|
|
class gfxXlibSurface;
|
|
|
|
#endif
|
2012-08-06 21:09:23 -07:00
|
|
|
#include "mozilla/unused.h"
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2013-09-24 13:45:14 -07:00
|
|
|
class gfxASurface;
|
2013-10-01 14:01:19 -07:00
|
|
|
class gfxContext;
|
2013-09-24 13:45:14 -07:00
|
|
|
|
2009-06-30 11:51:05 -07:00
|
|
|
namespace mozilla {
|
2012-08-19 12:33:25 -07:00
|
|
|
namespace layers {
|
|
|
|
class ImageContainer;
|
|
|
|
class CompositionNotifySink;
|
|
|
|
}
|
2009-06-30 11:51:05 -07:00
|
|
|
namespace plugins {
|
|
|
|
|
2009-09-09 15:59:06 -07:00
|
|
|
class PBrowserStreamParent;
|
2009-09-23 00:48:28 -07:00
|
|
|
class PluginModuleParent;
|
2009-08-18 13:20:03 -07:00
|
|
|
|
2009-09-09 15:59:06 -07:00
|
|
|
class PluginInstanceParent : public PPluginInstanceParent
|
2009-06-30 11:51:05 -07:00
|
|
|
{
|
2009-09-08 23:31:35 -07:00
|
|
|
friend class PluginModuleParent;
|
2009-09-09 07:04:09 -07:00
|
|
|
friend class BrowserStreamParent;
|
2009-09-21 07:51:35 -07:00
|
|
|
friend class PluginStreamParent;
|
2011-01-05 11:44:21 -08:00
|
|
|
friend class StreamNotifyParent;
|
2009-08-18 13:20:03 -07:00
|
|
|
|
2009-06-30 11:51:05 -07:00
|
|
|
public:
|
2009-09-23 00:12:52 -07:00
|
|
|
PluginInstanceParent(PluginModuleParent* parent,
|
|
|
|
NPP npp,
|
2010-04-20 07:52:19 -07:00
|
|
|
const nsCString& mimeType,
|
2009-09-23 00:12:52 -07:00
|
|
|
const NPNetscapeFuncs* npniface);
|
|
|
|
|
|
|
|
virtual ~PluginInstanceParent();
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2010-01-15 12:35:57 -08:00
|
|
|
bool Init();
|
|
|
|
NPError Destroy();
|
2009-10-07 16:50:48 -07:00
|
|
|
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
2010-01-27 16:01:44 -08:00
|
|
|
|
2009-09-09 15:59:06 -07:00
|
|
|
virtual PPluginScriptableObjectParent*
|
2014-01-19 21:03:45 -08:00
|
|
|
AllocPPluginScriptableObjectParent() MOZ_OVERRIDE;
|
2009-08-10 16:28:22 -07:00
|
|
|
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual bool
|
|
|
|
RecvPPluginScriptableObjectConstructor(PPluginScriptableObjectParent* aActor) MOZ_OVERRIDE;
|
2009-09-08 23:31:35 -07:00
|
|
|
|
2009-09-23 00:12:52 -07:00
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
DeallocPPluginScriptableObjectParent(PPluginScriptableObjectParent* aObject) MOZ_OVERRIDE;
|
2009-09-09 15:59:06 -07:00
|
|
|
virtual PBrowserStreamParent*
|
2013-07-08 08:48:39 -07:00
|
|
|
AllocPBrowserStreamParent(const nsCString& url,
|
|
|
|
const uint32_t& length,
|
|
|
|
const uint32_t& lastmodified,
|
|
|
|
PStreamNotifyParent* notifyData,
|
|
|
|
const nsCString& headers,
|
|
|
|
const nsCString& mimeType,
|
|
|
|
const bool& seekable,
|
|
|
|
NPError* rv,
|
2014-01-19 21:03:45 -08:00
|
|
|
uint16_t *stype) MOZ_OVERRIDE;
|
2013-07-08 08:48:39 -07:00
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
DeallocPBrowserStreamParent(PBrowserStreamParent* stream) MOZ_OVERRIDE;
|
2009-08-18 13:20:03 -07:00
|
|
|
|
2009-09-21 07:51:35 -07:00
|
|
|
virtual PPluginStreamParent*
|
2013-07-08 08:48:39 -07:00
|
|
|
AllocPPluginStreamParent(const nsCString& mimeType,
|
|
|
|
const nsCString& target,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2009-09-21 07:51:35 -07:00
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
DeallocPPluginStreamParent(PPluginStreamParent* stream) MOZ_OVERRIDE;
|
2009-09-21 07:51:35 -07:00
|
|
|
|
2009-09-17 16:09:20 -07:00
|
|
|
virtual bool
|
2010-01-14 07:18:34 -08:00
|
|
|
AnswerNPN_GetValue_NPNVnetscapeWindow(NativeWindowHandle* value,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2010-01-13 17:47:38 -08:00
|
|
|
virtual bool
|
2009-09-15 13:33:24 -07:00
|
|
|
AnswerNPN_GetValue_NPNVWindowNPObject(
|
|
|
|
PPluginScriptableObjectParent** value,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2009-09-17 16:09:20 -07:00
|
|
|
virtual bool
|
2009-09-15 13:33:24 -07:00
|
|
|
AnswerNPN_GetValue_NPNVPluginElementNPObject(
|
|
|
|
PPluginScriptableObjectParent** value,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2009-09-17 16:09:20 -07:00
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
AnswerNPN_GetValue_NPNVprivateModeBool(bool* value, NPError* result) MOZ_OVERRIDE;
|
2012-05-29 22:14:30 -07:00
|
|
|
|
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
AnswerNPN_GetValue_DrawingModelSupport(const NPNVariable& model, bool* value) MOZ_OVERRIDE;
|
2011-09-14 09:22:27 -07:00
|
|
|
|
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
AnswerNPN_GetValue_NPNVdocumentOrigin(nsCString* value, NPError* result) MOZ_OVERRIDE;
|
2009-09-15 13:33:24 -07:00
|
|
|
|
2009-09-24 19:03:59 -07:00
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
AnswerNPN_SetValue_NPPVpluginWindow(const bool& windowed, NPError* result) MOZ_OVERRIDE;
|
2009-09-24 19:03:59 -07:00
|
|
|
virtual bool
|
|
|
|
AnswerNPN_SetValue_NPPVpluginTransparent(const bool& transparent,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2010-03-26 13:07:37 -07:00
|
|
|
virtual bool
|
2011-04-08 12:58:04 -07:00
|
|
|
AnswerNPN_SetValue_NPPVpluginUsesDOMForCursor(const bool& useDOMForCursor,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2011-04-08 12:58:04 -07:00
|
|
|
virtual bool
|
2010-03-26 13:07:37 -07:00
|
|
|
AnswerNPN_SetValue_NPPVpluginDrawingModel(const int& drawingModel,
|
2012-02-15 19:30:22 -08:00
|
|
|
OptionalShmem *remoteImageData,
|
|
|
|
CrossProcessMutexHandle *mutex,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2010-03-26 13:07:37 -07:00
|
|
|
virtual bool
|
|
|
|
AnswerNPN_SetValue_NPPVpluginEventModel(const int& eventModel,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2009-09-24 19:03:59 -07:00
|
|
|
|
2009-09-17 16:09:20 -07:00
|
|
|
virtual bool
|
2009-09-08 14:22:50 -07:00
|
|
|
AnswerNPN_GetURL(const nsCString& url, const nsCString& target,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError *result) MOZ_OVERRIDE;
|
2009-09-08 14:22:50 -07:00
|
|
|
|
2009-09-17 16:09:20 -07:00
|
|
|
virtual bool
|
2009-09-08 14:22:50 -07:00
|
|
|
AnswerNPN_PostURL(const nsCString& url, const nsCString& target,
|
|
|
|
const nsCString& buffer, const bool& file,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2009-09-08 14:22:50 -07:00
|
|
|
|
|
|
|
virtual PStreamNotifyParent*
|
2013-07-08 08:48:39 -07:00
|
|
|
AllocPStreamNotifyParent(const nsCString& url, const nsCString& target,
|
|
|
|
const bool& post, const nsCString& buffer,
|
|
|
|
const bool& file,
|
2014-01-19 21:03:45 -08:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2009-09-08 14:22:50 -07:00
|
|
|
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual bool
|
2009-11-25 06:26:01 -08:00
|
|
|
AnswerPStreamNotifyConstructor(PStreamNotifyParent* actor,
|
|
|
|
const nsCString& url,
|
|
|
|
const nsCString& target,
|
|
|
|
const bool& post, const nsCString& buffer,
|
|
|
|
const bool& file,
|
2012-07-06 11:15:45 -07:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2009-11-25 06:26:01 -08:00
|
|
|
|
2009-09-17 16:09:20 -07:00
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
DeallocPStreamNotifyParent(PStreamNotifyParent* notifyData) MOZ_OVERRIDE;
|
2009-09-08 14:22:50 -07:00
|
|
|
|
2009-09-30 21:09:21 -07:00
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
RecvNPN_InvalidateRect(const NPRect& rect) MOZ_OVERRIDE;
|
2009-09-30 21:09:21 -07:00
|
|
|
|
2010-09-15 09:02:44 -07:00
|
|
|
// Async rendering
|
|
|
|
virtual bool
|
|
|
|
RecvShow(const NPRect& updatedRect,
|
|
|
|
const SurfaceDescriptor& newSurface,
|
2014-01-19 21:03:45 -08:00
|
|
|
SurfaceDescriptor* prevSurface) MOZ_OVERRIDE;
|
2010-09-15 09:02:44 -07:00
|
|
|
|
2011-01-27 14:37:00 -08:00
|
|
|
virtual PPluginSurfaceParent*
|
2013-07-08 08:48:39 -07:00
|
|
|
AllocPPluginSurfaceParent(const WindowsSharedMemoryHandle& handle,
|
|
|
|
const gfxIntSize& size,
|
2014-01-19 21:03:45 -08:00
|
|
|
const bool& transparent) MOZ_OVERRIDE;
|
2011-01-27 14:37:00 -08:00
|
|
|
|
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
DeallocPPluginSurfaceParent(PPluginSurfaceParent* s) MOZ_OVERRIDE;
|
2011-01-27 14:37:00 -08:00
|
|
|
|
2009-10-13 10:54:41 -07:00
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
AnswerNPN_PushPopupsEnabledState(const bool& aState) MOZ_OVERRIDE;
|
2009-10-13 10:54:41 -07:00
|
|
|
|
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
AnswerNPN_PopPopupsEnabledState() MOZ_OVERRIDE;
|
2009-10-13 10:54:41 -07:00
|
|
|
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual bool
|
2010-01-15 08:26:46 -08:00
|
|
|
AnswerNPN_GetValueForURL(const NPNURLVariable& variable,
|
|
|
|
const nsCString& url,
|
2012-07-06 11:15:45 -07:00
|
|
|
nsCString* value, NPError* result) MOZ_OVERRIDE;
|
2010-01-15 08:26:46 -08:00
|
|
|
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual bool
|
2010-01-15 08:26:46 -08:00
|
|
|
AnswerNPN_SetValueForURL(const NPNURLVariable& variable,
|
|
|
|
const nsCString& url,
|
2012-07-06 11:15:45 -07:00
|
|
|
const nsCString& value, NPError* result) MOZ_OVERRIDE;
|
2010-01-15 08:26:46 -08:00
|
|
|
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual bool
|
2010-01-15 08:26:46 -08:00
|
|
|
AnswerNPN_GetAuthenticationInfo(const nsCString& protocol,
|
|
|
|
const nsCString& host,
|
|
|
|
const int32_t& port,
|
|
|
|
const nsCString& scheme,
|
|
|
|
const nsCString& realm,
|
|
|
|
nsCString* username,
|
|
|
|
nsCString* password,
|
2012-07-06 11:15:45 -07:00
|
|
|
NPError* result) MOZ_OVERRIDE;
|
2010-01-15 08:26:46 -08:00
|
|
|
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual bool
|
2010-03-26 13:55:56 -07:00
|
|
|
AnswerNPN_ConvertPoint(const double& sourceX,
|
2010-05-20 12:22:54 -07:00
|
|
|
const bool& ignoreDestX,
|
2010-03-26 13:55:56 -07:00
|
|
|
const double& sourceY,
|
2010-05-20 12:22:54 -07:00
|
|
|
const bool& ignoreDestY,
|
2010-03-26 13:55:56 -07:00
|
|
|
const NPCoordinateSpace& sourceSpace,
|
|
|
|
const NPCoordinateSpace& destSpace,
|
|
|
|
double *destX,
|
|
|
|
double *destY,
|
2012-07-06 11:15:45 -07:00
|
|
|
bool *result) MOZ_OVERRIDE;
|
2010-03-26 13:55:56 -07:00
|
|
|
|
2012-02-15 19:30:22 -08:00
|
|
|
virtual bool
|
|
|
|
AnswerNPN_InitAsyncSurface(const gfxIntSize& size,
|
|
|
|
const NPImageFormat& format,
|
|
|
|
NPRemoteAsyncSurface* surfData,
|
2014-01-19 21:03:45 -08:00
|
|
|
bool* result) MOZ_OVERRIDE;
|
2012-02-15 19:30:22 -08:00
|
|
|
|
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
RecvRedrawPlugin() MOZ_OVERRIDE;
|
2012-02-15 19:30:22 -08:00
|
|
|
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual bool
|
|
|
|
RecvNegotiatedCarbon() MOZ_OVERRIDE;
|
2011-02-03 09:31:01 -08:00
|
|
|
|
2014-01-19 21:03:45 -08:00
|
|
|
virtual bool RecvReleaseDXGISharedSurface(const DXGISharedSurfaceHandle &aHandle) MOZ_OVERRIDE;
|
2012-05-29 22:14:30 -07:00
|
|
|
|
2009-09-30 14:36:14 -07:00
|
|
|
NPError NPP_SetWindow(const NPWindow* aWindow);
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2010-01-19 19:23:35 -08:00
|
|
|
NPError NPP_GetValue(NPPVariable variable, void* retval);
|
|
|
|
NPError NPP_SetValue(NPNVariable variable, void* value);
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2011-01-05 11:44:21 -08:00
|
|
|
void NPP_URLRedirectNotify(const char* url, int32_t status,
|
|
|
|
void* notifyData);
|
|
|
|
|
2009-06-30 11:51:05 -07:00
|
|
|
NPError NPP_NewStream(NPMIMEType type, NPStream* stream,
|
2009-08-18 13:20:03 -07:00
|
|
|
NPBool seekable, uint16_t* stype);
|
|
|
|
NPError NPP_DestroyStream(NPStream* stream, NPReason reason);
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2010-01-19 19:23:35 -08:00
|
|
|
void NPP_Print(NPPrint* platformPrint);
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2009-09-18 18:19:11 -07:00
|
|
|
int16_t NPP_HandleEvent(void* event);
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2009-09-22 14:06:00 -07:00
|
|
|
void NPP_URLNotify(const char* url, NPReason reason, void* notifyData);
|
2009-06-30 11:51:05 -07:00
|
|
|
|
2009-10-27 12:51:12 -07:00
|
|
|
PluginModuleParent* Module()
|
2009-09-23 00:12:52 -07:00
|
|
|
{
|
|
|
|
return mParent;
|
|
|
|
}
|
|
|
|
|
2009-10-07 16:50:48 -07:00
|
|
|
const NPNetscapeFuncs* GetNPNIface()
|
|
|
|
{
|
|
|
|
return mNPNIface;
|
|
|
|
}
|
|
|
|
|
2010-01-15 12:35:57 -08:00
|
|
|
bool
|
|
|
|
RegisterNPObjectForActor(NPObject* aObject,
|
|
|
|
PluginScriptableObjectParent* aActor);
|
|
|
|
|
|
|
|
void
|
|
|
|
UnregisterNPObject(NPObject* aObject);
|
|
|
|
|
2009-10-07 16:50:48 -07:00
|
|
|
PluginScriptableObjectParent*
|
|
|
|
GetActorForNPObject(NPObject* aObject);
|
|
|
|
|
|
|
|
NPP
|
|
|
|
GetNPP()
|
|
|
|
{
|
|
|
|
return mNPP;
|
|
|
|
}
|
|
|
|
|
2010-01-26 13:40:15 -08:00
|
|
|
virtual bool
|
2014-01-19 21:03:45 -08:00
|
|
|
AnswerPluginFocusChange(const bool& gotFocus) MOZ_OVERRIDE;
|
2010-01-26 13:40:15 -08:00
|
|
|
|
2010-09-10 11:28:52 -07:00
|
|
|
nsresult AsyncSetWindow(NPWindow* window);
|
2012-02-08 07:34:27 -08:00
|
|
|
nsresult GetImageContainer(mozilla::layers::ImageContainer** aContainer);
|
2011-02-22 21:38:09 -08:00
|
|
|
nsresult GetImageSize(nsIntSize* aSize);
|
2011-06-30 09:46:26 -07:00
|
|
|
#ifdef XP_MACOSX
|
2011-09-28 23:19:26 -07:00
|
|
|
nsresult IsRemoteDrawingCoreAnimation(bool *aDrawing);
|
2012-10-16 12:41:21 -07:00
|
|
|
nsresult ContentsScaleFactorChanged(double aContentsScaleFactor);
|
2011-06-30 09:46:26 -07:00
|
|
|
#endif
|
2011-02-16 14:43:31 -08:00
|
|
|
nsresult SetBackgroundUnknown();
|
2011-02-16 14:43:31 -08:00
|
|
|
nsresult BeginUpdateBackground(const nsIntRect& aRect,
|
2011-02-16 14:43:31 -08:00
|
|
|
gfxContext** aCtx);
|
2011-02-16 14:43:31 -08:00
|
|
|
nsresult EndUpdateBackground(gfxContext* aCtx,
|
2011-02-16 14:43:31 -08:00
|
|
|
const nsIntRect& aRect);
|
2012-08-07 00:06:29 -07:00
|
|
|
void DidComposite() { unused << SendNPP_DidComposite(); }
|
2012-02-15 19:30:25 -08:00
|
|
|
|
2009-10-07 16:50:48 -07:00
|
|
|
private:
|
2011-02-16 14:43:31 -08:00
|
|
|
// Create an appropriate platform surface for a background of size
|
|
|
|
// |aSize|. Return true if successful.
|
|
|
|
bool CreateBackground(const nsIntSize& aSize);
|
|
|
|
void DestroyBackground();
|
|
|
|
SurfaceDescriptor BackgroundDescriptor() /*const*/;
|
|
|
|
|
2012-02-08 07:34:27 -08:00
|
|
|
typedef mozilla::layers::ImageContainer ImageContainer;
|
|
|
|
ImageContainer *GetImageContainer();
|
|
|
|
|
2011-02-16 14:43:31 -08:00
|
|
|
virtual PPluginBackgroundDestroyerParent*
|
2013-07-08 08:48:39 -07:00
|
|
|
AllocPPluginBackgroundDestroyerParent() MOZ_OVERRIDE;
|
2011-02-16 14:43:31 -08:00
|
|
|
|
|
|
|
virtual bool
|
2013-07-08 08:48:39 -07:00
|
|
|
DeallocPPluginBackgroundDestroyerParent(PPluginBackgroundDestroyerParent* aActor) MOZ_OVERRIDE;
|
2011-02-16 14:43:31 -08:00
|
|
|
|
2009-10-07 16:50:48 -07:00
|
|
|
bool InternalGetValueForNPObject(NPNVariable aVariable,
|
|
|
|
PPluginScriptableObjectParent** aValue,
|
|
|
|
NPError* aResult);
|
|
|
|
|
2012-02-15 19:30:22 -08:00
|
|
|
bool IsAsyncDrawing();
|
|
|
|
|
2009-06-30 11:51:05 -07:00
|
|
|
private:
|
2009-09-23 00:12:52 -07:00
|
|
|
PluginModuleParent* mParent;
|
2009-08-18 13:20:03 -07:00
|
|
|
NPP mNPP;
|
2009-06-30 11:51:05 -07:00
|
|
|
const NPNetscapeFuncs* mNPNIface;
|
2009-12-01 13:05:26 -08:00
|
|
|
NPWindowType mWindowType;
|
2012-02-15 19:30:22 -08:00
|
|
|
Shmem mRemoteImageDataShmem;
|
|
|
|
nsAutoPtr<CrossProcessMutex> mRemoteImageDataMutex;
|
2012-02-15 19:24:38 -08:00
|
|
|
int16_t mDrawingModel;
|
2012-02-15 19:30:25 -08:00
|
|
|
nsAutoPtr<mozilla::layers::CompositionNotifySink> mNotifySink;
|
2009-09-23 00:12:52 -07:00
|
|
|
|
2012-03-21 11:07:31 -07:00
|
|
|
nsDataHashtable<nsPtrHashKey<NPObject>, PluginScriptableObjectParent*> mScriptableObjects;
|
2009-12-01 13:05:26 -08:00
|
|
|
|
|
|
|
#if defined(OS_WIN)
|
|
|
|
private:
|
|
|
|
// Used in rendering windowless plugins in other processes.
|
|
|
|
bool SharedSurfaceSetWindow(const NPWindow* aWindow, NPRemoteWindow& aRemoteWindow);
|
2009-12-14 16:27:25 -08:00
|
|
|
void SharedSurfaceBeforePaint(RECT &rect, NPRemoteEvent& npremoteevent);
|
2009-12-01 13:05:26 -08:00
|
|
|
void SharedSurfaceAfterPaint(NPEvent* npevent);
|
|
|
|
void SharedSurfaceRelease();
|
2010-01-26 13:40:15 -08:00
|
|
|
// Used in handling parent/child forwarding of events.
|
|
|
|
static LRESULT CALLBACK PluginWindowHookProc(HWND hWnd, UINT message,
|
|
|
|
WPARAM wParam, LPARAM lParam);
|
|
|
|
void SubclassPluginWindow(HWND aWnd);
|
|
|
|
void UnsubclassPluginWindow();
|
2009-12-01 13:05:26 -08:00
|
|
|
|
|
|
|
private:
|
|
|
|
gfx::SharedDIBWin mSharedSurfaceDib;
|
|
|
|
nsIntRect mPluginPort;
|
|
|
|
nsIntRect mSharedSize;
|
2010-01-26 13:40:15 -08:00
|
|
|
HWND mPluginHWND;
|
|
|
|
WNDPROC mPluginWndProc;
|
2010-02-09 14:34:38 -08:00
|
|
|
bool mNestedEventState;
|
2012-05-29 22:14:30 -07:00
|
|
|
|
|
|
|
// This will automatically release the textures when this object goes away.
|
|
|
|
nsRefPtrHashtable<nsPtrHashKey<void>, ID3D10Texture2D> mTextureMap;
|
2009-12-01 13:05:26 -08:00
|
|
|
#endif // defined(XP_WIN)
|
2011-06-25 08:25:03 -07:00
|
|
|
#if defined(MOZ_WIDGET_COCOA)
|
2010-03-26 13:07:37 -07:00
|
|
|
private:
|
2011-05-19 14:08:14 -07:00
|
|
|
Shmem mShSurface;
|
2011-08-15 10:07:40 -07:00
|
|
|
uint16_t mShWidth;
|
|
|
|
uint16_t mShHeight;
|
2011-05-19 14:08:14 -07:00
|
|
|
CGColorSpaceRef mShColorSpace;
|
2012-07-31 08:11:57 -07:00
|
|
|
RefPtr<MacIOSurface> mIOSurface;
|
|
|
|
RefPtr<MacIOSurface> mFrontIOSurface;
|
2011-06-25 08:25:03 -07:00
|
|
|
#endif // definied(MOZ_WIDGET_COCOA)
|
2010-09-15 09:02:49 -07:00
|
|
|
|
|
|
|
// ObjectFrame layer wrapper
|
|
|
|
nsRefPtr<gfxASurface> mFrontSurface;
|
2011-02-16 14:43:31 -08:00
|
|
|
// For windowless+transparent instances, this surface contains a
|
|
|
|
// "pretty recent" copy of the pixels under its <object> frame.
|
|
|
|
// On the plugin side, we use this surface to avoid doing alpha
|
|
|
|
// recovery when possible. This surface is created and owned by
|
|
|
|
// the browser, but a "read-only" reference is sent to the plugin.
|
|
|
|
//
|
|
|
|
// We have explicitly chosen not to provide any guarantees about
|
|
|
|
// the consistency of the pixels in |mBackground|. A plugin may
|
|
|
|
// be able to observe partial updates to the background.
|
|
|
|
nsRefPtr<gfxASurface> mBackground;
|
2012-08-20 21:06:46 -07:00
|
|
|
|
2012-02-08 07:34:27 -08:00
|
|
|
nsRefPtr<ImageContainer> mImageContainer;
|
2009-06-30 11:51:05 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace plugins
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2009-09-08 23:31:35 -07:00
|
|
|
#endif // ifndef dom_plugins_PluginInstanceParent_h
|