1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "ppapi/cpp/instance.h" 6 #include "ppapi/cpp/module.h" 7 #include "ppapi/cpp/var.h" 8 9 class Instance : public pp::Instance { 10 public: 11 explicit Instance(PP_Instance instance) : pp::Instance(instance) {} 12 virtual ~Instance() {} 13 14 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) { 15 PostMessage("Hello, multi-platform!"); 16 return true; 17 } 18 }; 19 20 class Module : public pp::Module { 21 public: 22 Module() : pp::Module() {} 23 virtual ~Module() {} 24 25 virtual pp::Instance* CreateInstance(PP_Instance instance) { 26 return new Instance(instance); 27 } 28 }; 29 30 namespace pp { 31 32 Module* CreateModule() { 33 return new ::Module(); 34 } 35 36 } // namespace pp 37