2009-09-09 10:31:35 +04:00
|
|
|
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
|
2012-05-21 15:12:37 +04: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-09-09 10:31:35 +04:00
|
|
|
|
2011-02-17 01:43:31 +03:00
|
|
|
include protocol PPluginBackgroundDestroyer;
|
2010-04-27 05:11:46 +04:00
|
|
|
include protocol PPluginModule;
|
|
|
|
include protocol PPluginScriptableObject;
|
|
|
|
include protocol PBrowserStream;
|
|
|
|
include protocol PPluginStream;
|
|
|
|
include protocol PStreamNotify;
|
2011-01-28 01:37:00 +03:00
|
|
|
include protocol PPluginSurface;
|
2009-09-09 10:31:35 +04:00
|
|
|
|
2013-10-18 22:47:04 +04:00
|
|
|
include "mozilla/GfxMessageUtils.h";
|
2009-09-09 10:31:35 +04:00
|
|
|
|
2013-10-01 23:25:07 +04:00
|
|
|
using NPError from "npapi.h";
|
|
|
|
using struct mozilla::plugins::NPRemoteWindow from "mozilla/plugins/PluginMessageUtils.h";
|
|
|
|
using struct mozilla::plugins::NPRemoteEvent from "mozilla/plugins/PluginMessageUtils.h";
|
|
|
|
using NPRect from "npapi.h";
|
|
|
|
using NPNURLVariable from "npapi.h";
|
|
|
|
using NPCoordinateSpace from "npapi.h";
|
|
|
|
using NPNVariable from "npapi.h";
|
|
|
|
using mozilla::plugins::NativeWindowHandle from "mozilla/plugins/PluginMessageUtils.h";
|
|
|
|
using gfxSurfaceType from "gfxTypes.h";
|
2015-09-23 21:49:05 +03:00
|
|
|
using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
|
2015-12-02 22:31:17 +03:00
|
|
|
using mozilla::gfx::IntRect from "mozilla/gfx/2D.h";
|
2013-10-01 23:25:07 +04:00
|
|
|
using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
|
2015-12-02 22:31:17 +03:00
|
|
|
using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h";
|
2013-10-01 23:25:07 +04:00
|
|
|
using mozilla::plugins::WindowsSharedMemoryHandle from "mozilla/plugins/PluginMessageUtils.h";
|
2014-09-25 00:35:00 +04:00
|
|
|
using mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h";
|
2015-04-21 18:04:57 +03:00
|
|
|
using nsIntRect from "nsRect.h";
|
2015-12-02 22:31:17 +03:00
|
|
|
using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
|
2015-12-02 22:31:17 +03:00
|
|
|
using struct DxgiAdapterDesc from "mozilla/D3DMessageUtils.h";
|
2016-02-02 11:05:56 +03:00
|
|
|
using struct mozilla::widget::CandidateWindowPosition from "ipc/nsGUIEventIPC.h";
|
Bug 1257759 part.5 PluginInstanceChild should post received native key event to chrome process if the key combination may be a shortcut key r=jimm
When PluginInstanceChild receives native key events, it should post the events to the chrome process first for checking if the key combination is reserved. However, posting all key events to the chrome process may make damage to the performance of text input. Therefore, this patch starts to post a key event whose key combination may be a shortcut key. However, for avoiding to shuffle the event order, it posts following key events until all posted key events are handled by the chrome process.
For receiving response from widget, this patch defines nsIKeyEventInPluginCallback. It's specified by nsIWidget::OnWindowedPluginKeyEvent() for ensuring the caller will receive the reply. Basically, the caller of nsIWidget::OnWindowedPluginKeyEvent() should reply to the child process. However, if the widget is a PuppetWidget, it cannot return the result synchronously. Therefore, PuppetWidget::OnWindowedPluginKeyEvent() returns NS_SUCCESS_EVENT_HANDLED_ASYNCHRONOUSLY and stores the callback to mKeyEventInPluginCallbacks. Then, TabParent::HandledWindowedPluginKeyEvent() will call PuppetWidget::HandledWindowedPluginKeyEvent().
MozReview-Commit-ID: G6brOU26NwQ
--HG--
extra : rebase_source : 8140456de278956d2d594e85c7b397ae366b4962
2016-04-19 14:09:37 +03:00
|
|
|
using class mozilla::NativeEventData from "ipc/nsGUIEventIPC.h";
|
2009-06-30 22:51:05 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace plugins {
|
|
|
|
|
2011-05-20 01:08:14 +04:00
|
|
|
struct IOSurfaceDescriptor {
|
|
|
|
uint32_t surfaceId;
|
2012-10-02 23:48:05 +04:00
|
|
|
double contentsScaleFactor;
|
2011-05-20 01:08:14 +04:00
|
|
|
};
|
|
|
|
|
2010-09-15 20:02:44 +04:00
|
|
|
union SurfaceDescriptor {
|
|
|
|
Shmem;
|
|
|
|
SurfaceDescriptorX11;
|
2011-01-28 01:37:00 +03:00
|
|
|
PPluginSurface; // used on Windows
|
2011-05-20 01:08:14 +04:00
|
|
|
IOSurfaceDescriptor; // used on OSX 10.5+
|
2010-09-15 20:02:44 +04:00
|
|
|
// Descriptor can be null here in case
|
|
|
|
// 1) of first Show call (prevSurface is null)
|
|
|
|
// 2) when child is going to destroy
|
|
|
|
// and it just want to grab prevSurface
|
|
|
|
// back without giving new surface
|
|
|
|
null_t;
|
|
|
|
};
|
|
|
|
|
2012-02-16 07:30:22 +04:00
|
|
|
union OptionalShmem {
|
|
|
|
Shmem;
|
|
|
|
null_t;
|
|
|
|
};
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr protocol PPluginInstance
|
2009-06-30 22:51:05 +04:00
|
|
|
{
|
2009-09-09 10:31:35 +04:00
|
|
|
manager PPluginModule;
|
|
|
|
|
2011-02-17 01:43:31 +03:00
|
|
|
manages PPluginBackgroundDestroyer;
|
2009-09-09 10:31:35 +04:00
|
|
|
manages PPluginScriptableObject;
|
2009-09-09 18:04:09 +04:00
|
|
|
manages PBrowserStream;
|
2009-09-21 18:51:35 +04:00
|
|
|
manages PPluginStream;
|
2009-09-09 01:22:50 +04:00
|
|
|
manages PStreamNotify;
|
2011-01-28 01:37:00 +03:00
|
|
|
manages PPluginSurface;
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2009-09-09 10:31:35 +04:00
|
|
|
child:
|
2013-10-01 04:27:45 +04:00
|
|
|
intr __delete__();
|
2009-12-03 11:16:14 +03:00
|
|
|
|
2015-08-07 10:48:16 +03:00
|
|
|
// This is only used on Windows and, for windowed plugins, must be called
|
|
|
|
// before the first call to NPP_SetWindow.
|
2015-08-12 18:00:26 +03:00
|
|
|
intr CreateChildPluginWindow()
|
|
|
|
returns (NativeWindowHandle childPluginWindow);
|
|
|
|
|
|
|
|
// This is only used on Windows and, for windowless plugins.
|
|
|
|
async CreateChildPopupSurrogate(NativeWindowHandle netscapeWindow);
|
2015-08-07 10:48:16 +03:00
|
|
|
|
|
|
|
intr NPP_SetWindow(NPRemoteWindow window);
|
2009-09-18 02:15:12 +04:00
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPP_GetValue_NPPVpluginWantsAllNetworkStreams()
|
2011-06-09 00:20:53 +04:00
|
|
|
returns (bool value, NPError result);
|
|
|
|
|
2009-09-25 06:03:59 +04:00
|
|
|
// this message is not used on non-X platforms
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPP_GetValue_NPPVpluginNeedsXEmbed()
|
2009-09-25 06:03:59 +04:00
|
|
|
returns (bool value, NPError result);
|
2011-06-09 00:20:53 +04:00
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPP_GetValue_NPPVpluginScriptableNPObject()
|
2009-12-03 09:35:22 +03:00
|
|
|
returns (nullable PPluginScriptableObject value, NPError result);
|
2009-09-09 10:31:35 +04:00
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPP_SetValue_NPNVprivateModeBool(bool value) returns (NPError result);
|
|
|
|
intr NPP_GetValue_NPPVpluginNativeAccessibleAtkPlugId()
|
2011-04-27 17:42:18 +04:00
|
|
|
returns (nsCString plug_id, NPError result);
|
2016-03-17 22:00:59 +03:00
|
|
|
|
|
|
|
intr NPP_SetValue_NPNVCSSZoomFactor(double value) returns (NPError result);
|
2010-01-20 06:23:35 +03:00
|
|
|
|
2015-07-27 07:05:10 +03:00
|
|
|
intr NPP_SetValue_NPNVmuteAudioBool(bool muted) returns (NPError result);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPP_HandleEvent(NPRemoteEvent event)
|
2009-09-19 05:19:11 +04:00
|
|
|
returns (int16_t handled);
|
2010-03-26 23:07:37 +03:00
|
|
|
// special cases where we need to a shared memory buffer
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPP_HandleEvent_Shmem(NPRemoteEvent event, Shmem buffer)
|
2010-03-26 23:07:37 +03:00
|
|
|
returns (int16_t handled, Shmem rtnbuffer);
|
2010-04-20 18:52:19 +04:00
|
|
|
// special cases where we need an iosurface
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPP_HandleEvent_IOSurface(NPRemoteEvent event, uint32_t surfaceid)
|
2010-04-20 18:52:19 +04:00
|
|
|
returns (int16_t handled);
|
2010-03-23 01:35:15 +03:00
|
|
|
// special cases of HandleEvent to make mediating races simpler
|
2013-10-01 04:27:45 +04:00
|
|
|
intr Paint(NPRemoteEvent event)
|
2010-03-11 10:35:31 +03:00
|
|
|
returns (int16_t handled);
|
2010-03-23 01:35:15 +03:00
|
|
|
// this is only used on windows to forward WM_WINDOWPOSCHANGE
|
|
|
|
async WindowPosChanged(NPRemoteEvent event);
|
2012-10-16 23:41:21 +04:00
|
|
|
// used on OS X to tell the child the contents scale factor
|
|
|
|
// of its parent has changed
|
|
|
|
async ContentsScaleFactorChanged(double aContentsScaleFactor);
|
2009-09-19 05:19:11 +04:00
|
|
|
|
2010-09-15 20:02:44 +04:00
|
|
|
// ********************** Async plugins rendering
|
|
|
|
// see https://wiki.mozilla.org/Gecko:AsyncPluginPainting
|
|
|
|
// **********************
|
|
|
|
|
|
|
|
// Async version of SetWindow call
|
|
|
|
// @param surfaceType - gfxASurface::gfxSurfaceType
|
|
|
|
// plugin child must create offscreen buffer
|
|
|
|
// with type equals to surfaceType
|
|
|
|
async AsyncSetWindow(gfxSurfaceType surfaceType, NPRemoteWindow window);
|
|
|
|
|
2011-02-17 01:43:31 +03:00
|
|
|
// There is now an opaque background behind this instance (or the
|
|
|
|
// background was updated). The changed area is |rect|. The
|
|
|
|
// browser owns the background surface, and it's read-only from
|
|
|
|
// within the plugin process. |background| is either null_t to
|
|
|
|
// refer to the existing background or a fresh descriptor.
|
|
|
|
async UpdateBackground(SurfaceDescriptor background, nsIntRect rect);
|
|
|
|
|
2012-02-16 07:30:25 +04:00
|
|
|
async NPP_DidComposite();
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPP_Destroy()
|
2010-01-15 23:35:57 +03:00
|
|
|
returns (NPError rv);
|
|
|
|
|
Bug 1257759 part.5 PluginInstanceChild should post received native key event to chrome process if the key combination may be a shortcut key r=jimm
When PluginInstanceChild receives native key events, it should post the events to the chrome process first for checking if the key combination is reserved. However, posting all key events to the chrome process may make damage to the performance of text input. Therefore, this patch starts to post a key event whose key combination may be a shortcut key. However, for avoiding to shuffle the event order, it posts following key events until all posted key events are handled by the chrome process.
For receiving response from widget, this patch defines nsIKeyEventInPluginCallback. It's specified by nsIWidget::OnWindowedPluginKeyEvent() for ensuring the caller will receive the reply. Basically, the caller of nsIWidget::OnWindowedPluginKeyEvent() should reply to the child process. However, if the widget is a PuppetWidget, it cannot return the result synchronously. Therefore, PuppetWidget::OnWindowedPluginKeyEvent() returns NS_SUCCESS_EVENT_HANDLED_ASYNCHRONOUSLY and stores the callback to mKeyEventInPluginCallbacks. Then, TabParent::HandledWindowedPluginKeyEvent() will call PuppetWidget::HandledWindowedPluginKeyEvent().
MozReview-Commit-ID: G6brOU26NwQ
--HG--
extra : rebase_source : 8140456de278956d2d594e85c7b397ae366b4962
2016-04-19 14:09:37 +03:00
|
|
|
// HandledWindowedPluginKeyEvent() is always called after posting a native
|
|
|
|
// key event with OnWindowedPluginKeyEvent().
|
|
|
|
//
|
|
|
|
// @param aKeyEventData The key event which was posted to the parent
|
|
|
|
// process.
|
|
|
|
// @param aIsConsumed true if aKeyEventData is consumed in the
|
|
|
|
// parent process. Otherwise, false.
|
|
|
|
async HandledWindowedPluginKeyEvent(NativeEventData aKeyEventData,
|
|
|
|
bool aIsConsumed);
|
|
|
|
|
2009-09-09 01:22:50 +04:00
|
|
|
parent:
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_GetValue_NPNVWindowNPObject()
|
2009-12-03 09:35:22 +03:00
|
|
|
returns (nullable PPluginScriptableObject value, NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_GetValue_NPNVPluginElementNPObject()
|
2009-12-03 09:35:22 +03:00
|
|
|
returns (nullable PPluginScriptableObject value, NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_GetValue_NPNVprivateModeBool()
|
2009-09-16 00:33:24 +04:00
|
|
|
returns (bool value, NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_GetValue_NPNVnetscapeWindow()
|
2010-01-14 18:18:34 +03:00
|
|
|
returns (NativeWindowHandle value, NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_GetValue_NPNVdocumentOrigin()
|
2011-09-14 20:22:27 +04:00
|
|
|
returns (nsCString value, NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_GetValue_DrawingModelSupport(NPNVariable model)
|
2012-05-30 09:14:30 +04:00
|
|
|
returns (bool value);
|
2015-12-02 22:31:16 +03:00
|
|
|
intr NPN_GetValue_SupportsAsyncBitmapSurface()
|
|
|
|
returns (bool value);
|
|
|
|
intr NPN_GetValue_SupportsAsyncDXGISurface()
|
|
|
|
returns (bool value);
|
2015-12-02 22:31:17 +03:00
|
|
|
intr NPN_GetValue_PreferredDXGIAdapter()
|
|
|
|
returns (DxgiAdapterDesc desc);
|
2009-09-16 00:33:24 +04:00
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_SetValue_NPPVpluginWindow(bool windowed)
|
2009-09-25 06:03:59 +04:00
|
|
|
returns (NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_SetValue_NPPVpluginTransparent(bool transparent)
|
2009-09-25 06:03:59 +04:00
|
|
|
returns (NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_SetValue_NPPVpluginUsesDOMForCursor(bool useDOMForCursor)
|
2011-04-08 23:58:04 +04:00
|
|
|
returns (NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_SetValue_NPPVpluginDrawingModel(int drawingModel)
|
2014-09-25 00:35:00 +04:00
|
|
|
returns (NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_SetValue_NPPVpluginEventModel(int eventModel)
|
2010-03-26 23:07:37 +03:00
|
|
|
returns (NPError result);
|
2015-07-28 23:59:26 +03:00
|
|
|
intr NPN_SetValue_NPPVpluginIsPlayingAudio(bool isAudioPlaying)
|
|
|
|
returns (NPError result);
|
2009-09-25 06:03:59 +04:00
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_GetURL(nsCString url, nsCString target)
|
2009-09-09 01:22:50 +04:00
|
|
|
returns (NPError result);
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_PostURL(nsCString url, nsCString target, nsCString buffer, bool file)
|
2009-09-09 01:22:50 +04:00
|
|
|
returns (NPError result);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Covers both NPN_GetURLNotify and NPN_PostURLNotify.
|
|
|
|
* @TODO This would be more readable as an overloaded method,
|
2010-03-07 00:03:05 +03:00
|
|
|
* but IPDL doesn't allow that for constructors.
|
2009-09-09 01:22:50 +04:00
|
|
|
*/
|
2013-10-01 04:27:45 +04:00
|
|
|
intr PStreamNotify(nsCString url, nsCString target, bool post,
|
2009-09-09 01:22:50 +04:00
|
|
|
nsCString buffer, bool file)
|
|
|
|
returns (NPError result);
|
|
|
|
|
2009-10-01 08:09:21 +04:00
|
|
|
async NPN_InvalidateRect(NPRect rect);
|
|
|
|
|
2015-12-02 22:31:17 +03:00
|
|
|
// Clear the current plugin image.
|
|
|
|
sync RevokeCurrentDirectSurface();
|
|
|
|
|
2015-12-02 22:31:17 +03:00
|
|
|
// Create a new DXGI shared surface with the given format and size. The
|
|
|
|
// returned handle, on success, can be opened as an ID3D10Texture2D or
|
|
|
|
// ID3D11Texture2D on a corresponding device.
|
|
|
|
sync InitDXGISurface(SurfaceFormat format, IntSize size)
|
|
|
|
returns (WindowsHandle handle, NPError result);
|
|
|
|
|
|
|
|
// Destroy a surface previously allocated with InitDXGISurface().
|
|
|
|
sync FinalizeDXGISurface(WindowsHandle handle);
|
|
|
|
|
2015-12-02 22:31:17 +03:00
|
|
|
// Set the current plugin image to the bitmap in the given shmem buffer. The
|
|
|
|
// format must be B8G8R8A8 or B8G8R8X8.
|
|
|
|
sync ShowDirectBitmap(Shmem buffer,
|
|
|
|
SurfaceFormat format,
|
|
|
|
uint32_t stride,
|
|
|
|
IntSize size,
|
|
|
|
IntRect dirty);
|
|
|
|
|
2015-12-02 22:31:17 +03:00
|
|
|
// Set the current plugin image to the DXGI surface in |handle|.
|
|
|
|
sync ShowDirectDXGISurface(WindowsHandle handle,
|
|
|
|
IntRect dirty);
|
|
|
|
|
2010-09-15 20:02:44 +04:00
|
|
|
// Give |newSurface|, containing this instance's updated pixels, to
|
2015-12-02 22:31:17 +03:00
|
|
|
// the browser for compositing. When this method returns, any surface
|
2010-10-14 22:14:23 +04:00
|
|
|
// previously passed to Show may be destroyed.
|
|
|
|
//
|
2010-09-15 20:02:44 +04:00
|
|
|
// @param rect - actually updated rectangle, comparing to prevSurface content
|
|
|
|
// could be used for partial render of layer to topLevel context
|
|
|
|
// @param newSurface - remotable surface
|
2010-10-14 22:14:23 +04:00
|
|
|
// @param prevSurface - if the previous surface was shared-memory, returns
|
|
|
|
// the shmem for reuse
|
2010-09-15 20:02:44 +04:00
|
|
|
sync Show(NPRect updatedRect, SurfaceDescriptor newSurface)
|
|
|
|
returns (SurfaceDescriptor prevSurface);
|
|
|
|
|
2011-01-28 01:37:00 +03:00
|
|
|
async PPluginSurface(WindowsSharedMemoryHandle handle,
|
2015-09-23 21:49:05 +03:00
|
|
|
IntSize size,
|
2011-01-28 01:37:00 +03:00
|
|
|
bool transparent);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_PushPopupsEnabledState(bool aState);
|
2009-10-13 21:54:41 +04:00
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_PopPopupsEnabledState();
|
2009-10-13 21:54:41 +04:00
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_GetValueForURL(NPNURLVariable variable, nsCString url)
|
2010-01-15 19:26:46 +03:00
|
|
|
returns (nsCString value, NPError result);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_SetValueForURL(NPNURLVariable variable, nsCString url,
|
2010-01-15 19:26:46 +03:00
|
|
|
nsCString value)
|
|
|
|
returns (NPError result);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_GetAuthenticationInfo(nsCString protocol_, nsCString host,
|
2010-01-15 19:26:46 +03:00
|
|
|
int32_t port, nsCString scheme,
|
|
|
|
nsCString realm)
|
|
|
|
returns (nsCString username, nsCString password, NPError result);
|
|
|
|
|
2013-10-01 04:27:45 +04:00
|
|
|
intr NPN_ConvertPoint(double sourceX, bool ignoreDestX, double sourceY, bool ignoreDestY, NPCoordinateSpace sourceSpace,
|
2010-03-26 23:55:56 +03:00
|
|
|
NPCoordinateSpace destSpace)
|
2010-05-20 23:22:54 +04:00
|
|
|
returns (double destX, double destY, bool result);
|
2010-03-26 23:55:56 +03:00
|
|
|
|
2012-02-16 07:30:22 +04:00
|
|
|
async RedrawPlugin();
|
|
|
|
|
2011-02-03 20:31:01 +03:00
|
|
|
// Send notification that a plugin tried to negotiate Carbon NPAPI so that
|
|
|
|
// users can be notified that restarting the browser in i386 mode may allow
|
|
|
|
// them to use the plugin.
|
|
|
|
sync NegotiatedCarbon();
|
|
|
|
|
2014-12-30 02:12:54 +03:00
|
|
|
// Notifies the parent of its NPP_New result code.
|
|
|
|
async AsyncNPP_NewResult(NPError aResult);
|
|
|
|
|
2015-08-12 18:00:26 +03:00
|
|
|
// Sends a native window to be adopted by the native window that would be
|
|
|
|
// returned by NPN_GetValue_NPNVnetscapeWindow. Only used on Windows.
|
|
|
|
async SetNetscapeWindowAsParent(NativeWindowHandle childWindow);
|
|
|
|
|
2015-12-29 16:57:38 +03:00
|
|
|
sync GetCompositionString(uint32_t aType)
|
|
|
|
returns (uint8_t[] aDist, int32_t aLength);
|
|
|
|
// Set candidate window position.
|
|
|
|
//
|
2016-02-02 11:05:56 +03:00
|
|
|
// @param aPosition position information of candidate window
|
|
|
|
async SetCandidateWindow(CandidateWindowPosition aPosition);
|
2016-02-01 04:26:52 +03:00
|
|
|
async RequestCommitOrCancel(bool aCommitted);
|
2015-12-29 16:57:38 +03:00
|
|
|
|
Bug 1257759 part.5 PluginInstanceChild should post received native key event to chrome process if the key combination may be a shortcut key r=jimm
When PluginInstanceChild receives native key events, it should post the events to the chrome process first for checking if the key combination is reserved. However, posting all key events to the chrome process may make damage to the performance of text input. Therefore, this patch starts to post a key event whose key combination may be a shortcut key. However, for avoiding to shuffle the event order, it posts following key events until all posted key events are handled by the chrome process.
For receiving response from widget, this patch defines nsIKeyEventInPluginCallback. It's specified by nsIWidget::OnWindowedPluginKeyEvent() for ensuring the caller will receive the reply. Basically, the caller of nsIWidget::OnWindowedPluginKeyEvent() should reply to the child process. However, if the widget is a PuppetWidget, it cannot return the result synchronously. Therefore, PuppetWidget::OnWindowedPluginKeyEvent() returns NS_SUCCESS_EVENT_HANDLED_ASYNCHRONOUSLY and stores the callback to mKeyEventInPluginCallbacks. Then, TabParent::HandledWindowedPluginKeyEvent() will call PuppetWidget::HandledWindowedPluginKeyEvent().
MozReview-Commit-ID: G6brOU26NwQ
--HG--
extra : rebase_source : 8140456de278956d2d594e85c7b397ae366b4962
2016-04-19 14:09:37 +03:00
|
|
|
// Notifies the parent process of a plugin instance receiving key event
|
|
|
|
// directly.
|
|
|
|
//
|
|
|
|
// @param aKeyEventData The native key event which will be sent to
|
|
|
|
// plugin from native event handler.
|
|
|
|
async OnWindowedPluginKeyEvent(NativeEventData aKeyEventData);
|
|
|
|
|
2009-09-18 02:15:12 +04:00
|
|
|
both:
|
2010-03-05 00:20:14 +03:00
|
|
|
async PPluginScriptableObject();
|
2009-09-09 10:31:35 +04:00
|
|
|
|
2009-09-21 18:51:35 +04:00
|
|
|
child:
|
|
|
|
/* NPP_NewStream */
|
2014-12-30 02:12:54 +03:00
|
|
|
async PBrowserStream(nsCString url,
|
|
|
|
uint32_t length,
|
|
|
|
uint32_t lastmodified,
|
|
|
|
nullable PStreamNotify notifyData,
|
|
|
|
nsCString headers);
|
|
|
|
|
|
|
|
// Implements the legacy (synchronous) version of NPP_NewStream for when
|
|
|
|
// async plugin init is preffed off.
|
|
|
|
intr NPP_NewStream(PBrowserStream actor, nsCString mimeType, bool seekable)
|
2009-09-21 18:51:35 +04:00
|
|
|
returns (NPError rv,
|
|
|
|
uint16_t stype);
|
|
|
|
|
2014-12-30 02:12:54 +03:00
|
|
|
// Implements the async plugin init version of NPP_NewStream.
|
|
|
|
async AsyncNPP_NewStream(PBrowserStream actor, nsCString mimeType, bool seekable);
|
|
|
|
|
2009-09-21 18:51:35 +04:00
|
|
|
parent:
|
|
|
|
/* NPN_NewStream */
|
2013-10-01 04:27:45 +04:00
|
|
|
intr PPluginStream(nsCString mimeType,
|
2009-09-21 18:51:35 +04:00
|
|
|
nsCString target)
|
|
|
|
returns (NPError result);
|
2010-01-27 00:40:15 +03:00
|
|
|
|
|
|
|
parent:
|
2013-10-01 04:27:45 +04:00
|
|
|
intr PluginFocusChange(bool gotFocus);
|
2010-04-28 19:01:09 +04:00
|
|
|
|
2010-01-27 00:40:15 +03:00
|
|
|
child:
|
2013-10-01 04:27:45 +04:00
|
|
|
intr SetPluginFocus();
|
|
|
|
intr UpdateWindow();
|
2011-02-17 01:43:31 +03:00
|
|
|
|
|
|
|
async PPluginBackgroundDestroyer();
|
2009-09-09 10:31:35 +04:00
|
|
|
};
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2009-09-09 10:31:35 +04:00
|
|
|
} // namespace plugins
|
|
|
|
} // namespace mozilla
|