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

Side by Side Diff: native_client_sdk/src/examples/api/gamepad/gamepad_module.cc

Issue 14607005: [NaCl SDK] Cleanup examples. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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/module.h>
6
7 #include "gamepad.h"
8
9 namespace gamepad {
10 // The Module class. The browser calls the CreateInstance() method to create
11 // an instance of your NaCl module on the web page. The browser creates a new
12 // instance for each <embed> tag with type="application/x-nacl".
13 class GamepadModule : public pp::Module {
14 public:
15 GamepadModule() : pp::Module() {}
16 virtual ~GamepadModule() {}
17
18 // Create and return a GamepadInstance object.
19 virtual pp::Instance* CreateInstance(PP_Instance instance) {
20 return new Gamepad(instance);
21 }
22 };
23 } // namespace gamepad
24
25 // Factory function called by the browser when the module is first loaded.
26 // The browser keeps a singleton of this module. It calls the
27 // CreateInstance() method on the object you return to make instances. There
28 // is one instance per <embed> tag on the page. This is the main binding
29 // point for your NaCl module with the browser.
30 namespace pp {
31 Module* CreateModule() { return new gamepad::GamepadModule(); }
32 } // namespace pp
OLDNEW
« no previous file with comments | « native_client_sdk/src/examples/api/gamepad/gamepad.cc ('k') | native_client_sdk/src/examples/api/graphics_3d/example.dsc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698