Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: ppapi/proxy/ppp_instance_private_proxy.cc

Issue 6966043: Proxy PPB_Instance_Private and PPP_Instance_Private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ID mismatch Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppp_instance_private_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppp_instance_private_proxy.cc
diff --git a/ppapi/proxy/ppp_instance_private_proxy.cc b/ppapi/proxy/ppp_instance_private_proxy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..20beb8a0f0b4d4b8ee3e9bd83ff321fb6f601cfc
--- /dev/null
+++ b/ppapi/proxy/ppp_instance_private_proxy.cc
@@ -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/proxy/ppp_instance_private_proxy.h"
+
+#include <algorithm>
+
+#include "ppapi/c/pp_var.h"
+#include "ppapi/c/private/ppp_instance_private.h"
+#include "ppapi/proxy/host_dispatcher.h"
+#include "ppapi/proxy/plugin_dispatcher.h"
+#include "ppapi/proxy/plugin_resource_tracker.h"
+#include "ppapi/proxy/ppapi_messages.h"
+
+namespace pp {
+namespace proxy {
+
+namespace {
+
+PP_Var GetInstanceObject(PP_Instance instance) {
+ Dispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
+ ReceiveSerializedVarReturnValue result;
+ dispatcher->Send(new PpapiMsg_PPPInstancePrivate_GetInstanceObject(
+ INTERFACE_ID_PPP_INSTANCE_PRIVATE, instance, &result));
+ return result.Return(dispatcher);
+}
+
+static const PPP_Instance_Private instance_private_interface = {
+ &GetInstanceObject
+};
+
+InterfaceProxy* CreateInstancePrivateProxy(Dispatcher* dispatcher,
+ const void* target_interface) {
+ return new PPP_Instance_Private_Proxy(dispatcher, target_interface);
+}
+
+} // namespace
+
+PPP_Instance_Private_Proxy::PPP_Instance_Private_Proxy(
+ Dispatcher* dispatcher, const void* target_interface)
+ : InterfaceProxy(dispatcher, target_interface) {
+}
+
+PPP_Instance_Private_Proxy::~PPP_Instance_Private_Proxy() {
+}
+
+// static
+const InterfaceProxy::Info* PPP_Instance_Private_Proxy::GetInfo() {
+ static const Info info = {
+ &instance_private_interface,
+ PPP_INSTANCE_PRIVATE_INTERFACE,
+ INTERFACE_ID_PPP_INSTANCE_PRIVATE,
+ false,
+ &CreateInstancePrivateProxy,
+ };
+ return &info;
+}
+
+bool PPP_Instance_Private_Proxy::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(PPP_Instance_Private_Proxy, msg)
+ IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstancePrivate_GetInstanceObject,
+ OnMsgGetInstanceObject)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
+
+void PPP_Instance_Private_Proxy::OnMsgGetInstanceObject(
+ PP_Instance instance,
+ SerializedVarReturnValue result) {
+ result.Return(dispatcher(),
+ ppp_instance_private_target()->GetInstanceObject(instance));
+}
+
+} // namespace proxy
+} // namespace pp
« no previous file with comments | « ppapi/proxy/ppp_instance_private_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698