summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk/interfaces_ppb_public_stable.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 18:09:37 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 18:09:37 +0000
commit5c966027630633c4591f4f7ea2f76fd7c04682d9 (patch)
tree827b42c5cad66fa01fa1d6a3fe67aa598b399537 /ppapi/thunk/interfaces_ppb_public_stable.h
parent35eab12c495bfc7b56b57f0074eb1ed3f1969d09 (diff)
downloadchromium_src-5c966027630633c4591f4f7ea2f76fd7c04682d9.zip
chromium_src-5c966027630633c4591f4f7ea2f76fd7c04682d9.tar.gz
chromium_src-5c966027630633c4591f4f7ea2f76fd7c04682d9.tar.bz2
s patch tries to remove most of the manual registration for Pepper interfaces, and replaces it with a list of macros. When files want to know which Pepper interface names and structs there are, they define what they want to do with the macros, and then include the relevant files for the classes of interfaces they want (stable, private, dev).
This re-lands my previous change. Original Review URL: http://codereview.chromium.org/7874002 This does not convert all the dev interfaces. I just did a few to keep the patch smaller. So there is still a lot of manual registration. This fixes the previous design problem where we assumed one *_Proxy object == one interface. We have been hacking around this lately with duplicate GetInfo calls, but this doesn't work for PPP interfaces. Now, a _Proxy object is just there to help keep things organized. One proxy can handle zero, one, or many interfaces, and this mapping is controlled by just one line in the interfaces file. So for example, to add a new function to a new version of an interface with backward compatibility, you would add that function to the _api.h file, and write a thunk for the new interface. Then you only need to add one line to the interfaces_ppb_public_stable.h file and that will be hooked up with the proxy and the implementation. This removes some _proxy objects/files that were used only to declare that the interfaces existed, since they're no longer necessary. I folded Console into the Instance API which removed a bunch of code. I removed FileChooser 0.4. I think everybody has converted to the new one, and I think parts of it weren't even hooked up properly anymore. Review URL: http://codereview.chromium.org/7887001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100936 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk/interfaces_ppb_public_stable.h')
-rw-r--r--ppapi/thunk/interfaces_ppb_public_stable.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/ppapi/thunk/interfaces_ppb_public_stable.h b/ppapi/thunk/interfaces_ppb_public_stable.h
new file mode 100644
index 0000000..579ce15
--- /dev/null
+++ b/ppapi/thunk/interfaces_ppb_public_stable.h
@@ -0,0 +1,78 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/thunk/interfaces_preamble.h"
+
+// This file contains lists of interfaces. It's intended to be included by
+// another file which defines implementations of the macros. This allows files
+// to do specific registration tasks for each supported interface.
+
+
+// Api categories
+// --------------
+// Enumerates the categories of APIs. These correspnd to the *_api.h files in
+// this directory. One API may implement one or more actual interfaces.
+//
+// For PROXIED_APIs, these also correspond to *_Proxy objects. The proxied ones
+// define factory functions for each of these classes. UNPROXIED_APIs are ones
+// that exist in the webkit/plugins/ppapi/*_impl.h, but not in the proxy.
+PROXIED_API(PPB_Audio)
+// AudioConfig isn't proxied in the normal way, we have only local classes and
+// serialize it to a struct when we need it on the host side.
+UNPROXIED_API(PPB_AudioConfig)
+PROXIED_API(PPB_Core)
+UNPROXIED_API(PPB_FileIO)
+PROXIED_API(PPB_FileRef)
+PROXIED_API(PPB_FileSystem)
+PROXIED_API(PPB_Graphics2D)
+UNPROXIED_API(PPB_ImageData)
+PROXIED_API(PPB_Instance)
+PROXIED_API(PPB_URLLoader)
+PROXIED_API(PPB_URLResponseInfo)
+
+// Interfaces
+// ----------
+// Enumerates interfaces as (api_name, interface_name, interface_struct).
+//
+// The api_name corresponds to the class in the list above for the object
+// that implements the API. Some things may be special and aren't implemented
+// by any specific API object, and we use "NoAPIName" for those. Implementors
+// of these macros should handle this case. There can be more than one line
+// referring to the same api_name (typically different versions of the
+// same interface).
+//
+// The interface_name is the string that corresponds to the interface.
+//
+// The interface_struct is the typename of the struct corresponding to the
+// interface string.
+PROXIED_IFACE(PPB_Audio, PPB_AUDIO_INTERFACE_1_0, PPB_Audio)
+// This has no corresponding _Proxy object since it does no IPC.
+PROXIED_IFACE(NoAPIName, PPB_AUDIO_CONFIG_INTERFACE_1_0, PPB_AudioConfig)
+// Note: Core is special and is registered manually.
+UNPROXIED_IFACE(PPB_FileIO, PPB_FILEIO_INTERFACE_1_0, PPB_FileIO)
+PROXIED_IFACE(PPB_FileRef, PPB_FILEREF_INTERFACE_1_0, PPB_FileRef)
+PROXIED_IFACE(PPB_FileSystem, PPB_FILESYSTEM_INTERFACE_1_0, PPB_FileSystem)
+PROXIED_IFACE(PPB_Graphics2D, PPB_GRAPHICS_2D_INTERFACE_1_0, PPB_Graphics2D)
+PROXIED_IFACE(PPB_Graphics3D, PPB_GRAPHICS_3D_INTERFACE_1_0, PPB_Graphics3D)
+// ImageData doesn't have a normal _Proxy object since it only uses Create
+// to proxy, and that happens in the ResourceCreationAPI.
+PROXIED_IFACE(NoAPIName, PPB_IMAGEDATA_INTERFACE_1_0, PPB_ImageData)
+PROXIED_IFACE(PPB_Instance, PPB_INSTANCE_INTERFACE_1_0, PPB_Instance)
+PROXIED_IFACE(NoAPIName, PPB_INPUT_EVENT_INTERFACE_1_0, PPB_InputEvent)
+PROXIED_IFACE(NoAPIName, PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0,
+ PPB_KeyboardInputEvent)
+PROXIED_IFACE(NoAPIName, PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0,
+ PPB_MouseInputEvent_1_0)
+PROXIED_IFACE(NoAPIName, PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1,
+ PPB_MouseInputEvent)
+PROXIED_IFACE(NoAPIName, PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0,
+ PPB_WheelInputEvent)
+PROXIED_IFACE(PPB_Instance, PPB_MESSAGING_INTERFACE_1_0, PPB_Messaging)
+PROXIED_IFACE(PPB_URLLoader, PPB_URLLOADER_INTERFACE_1_0, PPB_URLLoader)
+PROXIED_IFACE(NoAPIName, PPB_URLREQUESTINFO_INTERFACE_1_0, PPB_URLRequestInfo)
+PROXIED_IFACE(PPB_URLResponseInfo, PPB_URLRESPONSEINFO_INTERFACE_1_0,
+ PPB_URLResponseInfo)
+// Note: PPB_Var is special and registered manually.
+
+#include "ppapi/thunk/interfaces_postamble.h"