15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2010 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This is the simplest possible C Pepper plugin that does nothing. If you're
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// using C++, you will want to look at stub.cc which uses the more convenient
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// C++ wrappers.
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <stddef.h>
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ppapi/c/pp_errors.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ppapi/c/pp_module.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ppapi/c/ppb.h"
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ppapi/c/ppp.h"
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)PP_Module g_module_id;
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)PPB_GetInterface g_get_browser_interface = NULL;
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)PP_EXPORT int32_t PPP_InitializeModule(PP_Module module_id,
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                                       PPB_GetInterface get_browser_interface) {
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Save the global module information for later.
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  g_module_id = module_id;
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  g_get_browser_interface = get_browser_interface;
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  return PP_OK;
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)PP_EXPORT void PPP_ShutdownModule() {
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)PP_EXPORT const void* PPP_GetInterface(const char* interface_name) {
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // You will normally implement a getter for at least PPP_INSTANCE_INTERFACE
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // here.
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  return NULL;
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
36