This CL replaces all uses of base::SharedMemory and base::SharedMemoryRegion
with the new shared memory classes. New classes can be used both in the
renderer and the ppapi plugin processes.
Bug: 865102
Change-Id: I4ccc52990a0aa8a65ac701b92c45b792188506f8
Reviewed-on: https://chromium-review.googlesource.com/1142161
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576622}
Before gamepad was partially servicified, gamepad struct definitions
resided in WebKit. These definitions must be identical for all readers
and writers to the shared memory buffer for consistency. Since pepper
may not depend on WebKit, the structs were duplicated in the pepper
gamepad client.
Now these structs have been moved out of WebKit and can be shared with
other components by depending on the target
//device/gamepad/public/cpp:shared_with_blink. This CL removes the
duplicate pepper definitions and switches all usages to the //device
definitions.
BUG=694998
Change-Id: I4cf596f5cff18f6dc8945a422a3cc9f70711c10c
Reviewed-on: https://chromium-review.googlesource.com/1062600
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560914}
This CL is a refactor and has no intended behavior change.
NullHandle() has two use cases:
* Create an invalid handle.
* Return an object that can be compared against a handle to check validity.
The former is also the behavior of the default constructor of
base::SharedMemoryHandle, and the latter should be done with the member
IsValid().
Fixing the latter also allows the removal of operator== and operator!=.
BUG=713763
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Review-Url: https://codereview.chromium.org/2849633002
Cr-Commit-Position: refs/heads/master@{#468231}
In the "old proxy model", using EnterInstance<>, code always passed the
instance as the first argument. In the "new proxy model", using
EnterInstanceAPI<>, code is inconsistent, making it hard to automatically
generate thunk files from IDL.
This change updates the gamepad API to be consistent with many other interfaces
and the old proxy model.
BUG=
Review URL: https://chromiumcodereview.appspot.com/12568010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189169 0039d316-1c4b-4281-b951-d872f2087c98
Currently a lot of boilerplate needs to be added everytime we add a new singleton style resource and as we add more of them this will accumulate. This patch reduces the amount of code needed by exposing a GetSingletonResource function in PPB_Instance_API which takes an ID specifying what type of resource is needed. A new Enter type, EnterInstanceAPI, is provided which is templated on the singleton API you want access to.
BUG=
Review URL: https://codereview.chromium.org/11359063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170221 0039d316-1c4b-4281-b951-d872f2087c98
This CL automatically closes SerializedHandles at the receiving side of ResourceMessageParams (the host side for ResourceMessageCallParams; the plugin side for ResourceMessageReplyParams), if they are not taken by message handlers.
BUG=None
TEST=None
Review URL: https://chromiumcodereview.appspot.com/11312017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165799 0039d316-1c4b-4281-b951-d872f2087c98
Previously each PluginResource had to write a reply handler (|OnReplyReceived|) for any replies to resource messages. This approach had several problems including the fact that the PluginResource had to track the state of any outstanding calls.
This change allows you to register a base::Callback when calling CallToBrowser/CallToRenderer. The callback will be run when a reply message is received with a sequence number matching the call. The parameters of the reply will be passed to the callback. An example of usage:
CallBrowser<PpapiPluginMsg_MyResourceType_MyReplyMessage>(
PpapiHostMsg_MyResourceType_MyRequestMessage(),
base::Bind(&MyPluginResource::ReplyHandler, this));
If a reply message to this call is received whose type does not match the expected reply message (for example, in the case of an error), the callback will still be invoked but with the default values of the message parameters.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11022005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160015 0039d316-1c4b-4281-b951-d872f2087c98
This does some reworking of the gamepad system to make it possible to hook in (previously it assumed that it was only talking to renderers) and I did some cleanup. Gamepad files were renamed to match the classes, and I did a bunch of test infrastructure work.
IMPORTANT BEHAVIOR CHANGE: This changes the Web gamepad API to report all gamepad data as soon as any of them are interacted with. This is what we need to do for Pepper anyway (since it gets all or none of the share memory) and I think makes more sense for most consumers anyway.
I separated out the user gesture detection code into a place where it can be used in the browser process as well, and exposed functionality in the gamepad provider to be notified when a user gesture happens.
The existing gamepad test was disabled and had bitrotted. This fixes it.
Review URL: https://chromiumcodereview.appspot.com/10912062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155676 0039d316-1c4b-4281-b951-d872f2087c98
This implements the skeleton of the gamepad resource for the IPC proxy. It is not actually hooked up. Hooking it up will require moving some gamepad lock code to a shared location.
This also hooks up the browser message routing for implementing resource hosts in the browser process.
BUG=
Review URL: https://chromiumcodereview.appspot.com/10824272
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153265 0039d316-1c4b-4281-b951-d872f2087c98