OLD | NEW |
| (Empty) |
1 // Copyright 2010 The Ginsu Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can | |
3 // be found in the LICENSE file. | |
4 | |
5 // This is the connection to the c_salt Module machinery. The Module singleton | |
6 // calls CreateInstance to make new copies of each in-browser instance of | |
7 // Ginsu. This gets linked with all the tests. | |
8 | |
9 #include "c_salt/instance.h" | |
10 #include "c_salt/module.h" | |
11 | |
12 class MyInstance : public c_salt::Instance { | |
13 public: | |
14 explicit MyInstance(const NPP& instance) : c_salt::Instance(instance) {} | |
15 }; | |
16 | |
17 class TestModule : public c_salt::Module { | |
18 public: | |
19 virtual c_salt::Instance* CreateInstance(const NPP& instance) { | |
20 return new MyInstance(instance); | |
21 } | |
22 }; | |
23 | |
24 namespace c_salt { | |
25 Module* CreateModule() { | |
26 return new TestModule(); | |
27 } | |
28 } // namespace c_salt | |
OLD | NEW |