Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / nacl / simple.cc
blobbd7c65104c9caddbf678aa5b2ba2910639713dad
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.
5 #include <string>
7 #include "ppapi/cpp/instance.h"
8 #include "ppapi/cpp/module.h"
9 #include "ppapi/cpp/var.h"
11 class SimpleInstance : public pp::Instance {
12 public:
13 explicit SimpleInstance(PP_Instance instance) : pp::Instance(instance) {
16 virtual void HandleMessage(const pp::Var& var_message) {
17 if (var_message.is_string() && var_message.AsString() == "ping") {
18 PostMessage(pp::Var("pong"));
19 return;
21 PostMessage(pp::Var("failed"));
25 class SimpleModule : public pp::Module {
26 public:
27 virtual pp::Instance* CreateInstance(PP_Instance instance) {
28 return new SimpleInstance(instance);
32 namespace pp {
34 Module* CreateModule() {
35 return new SimpleModule();
38 } // namespace pp