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

Unified Diff: ppapi/cpp/module.cc

Issue 6538028: A proposal for an initial postMessage interface. This will allow JavaScript ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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
Index: ppapi/cpp/module.cc
===================================================================
--- ppapi/cpp/module.cc (revision 77426)
+++ ppapi/cpp/module.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -124,6 +124,16 @@
return instance->GetInstanceObject().Detach();
}
+void Instance_HandleMessage(PP_Instance pp_instance, PP_Var var) {
+ Module* module_singleton = Module::Get();
+ if (!module_singleton)
+ return;
+ Instance* instance = module_singleton->InstanceForPPInstance(pp_instance);
+ if (!instance)
+ return;
+ instance->HandleMessage(Var(Var::PassRef(), var));
+}
+
static PPP_Instance instance_interface = {
&Instance_DidCreate,
&Instance_DidDestroy,
@@ -131,7 +141,8 @@
&Instance_DidChangeFocus,
&Instance_HandleInputEvent,
&Instance_HandleDocumentLoad,
- &Instance_GetInstanceObject
+ &Instance_GetInstanceObject,
+ &Instance_HandleMessage
};
// Module ----------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698