1 // Copyright (c) 2010 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.
5 #include "ppapi/cpp/instance.h"
6 #include "ppapi/cpp/module.h"
8 // This is the simplest possible C++ Pepper plugin that does nothing.
10 // This object represents one time the page says <embed>.
11 class MyInstance
: public pp::Instance
{
13 explicit MyInstance(PP_Instance instance
) : pp::Instance(instance
) {}
14 virtual ~MyInstance() {}
16 virtual bool Init(uint32_t argc
, const char* argn
[], const char* argv
[]) {
21 // This object is the global object representing this plugin library as long
23 class MyModule
: public pp::Module
{
25 MyModule() : pp::Module() {}
26 virtual ~MyModule() {}
28 // Override CreateInstance to create your customized Instance object.
29 virtual pp::Instance
* CreateInstance(PP_Instance instance
) {
30 return new MyInstance(instance
);
36 // Factory function for your specialization of the Module object.
37 Module
* CreateModule() {
38 return new MyModule();