From b5b6329c9d4d938518af7a6e6b9044f8e4f318a6 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 13 Feb 2016 02:15:33 -0500 Subject: [PATCH] Move MoonlightInstance declaration into a header --- main.cpp | 16 ++-------------- moonlight.hpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 moonlight.hpp diff --git a/main.cpp b/main.cpp index 1ec17e8..b044d15 100644 --- a/main.cpp +++ b/main.cpp @@ -1,17 +1,6 @@ -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/var.h" +#include "moonlight.hpp" -#include "nacl_io/nacl_io.h" - -class MoonlightInstance : public pp::Instance { - public: - explicit MoonlightInstance(PP_Instance instance) : pp::Instance(instance) { - // This function MUST be used otherwise sockets don't work (nacl_io_init() doesn't work!) - nacl_io_init_ppapi(pp_instance(), pp::Module::Get()->get_browser_interface()); - } - virtual ~MoonlightInstance() {} -}; +MoonlightInstance::~MoonlightInstance() {} class MoonlightModule : public pp::Module { public: @@ -25,7 +14,6 @@ class MoonlightModule : public pp::Module { namespace pp { Module* CreateModule() { - return new MoonlightModule(); } } // namespace pp \ No newline at end of file diff --git a/moonlight.hpp b/moonlight.hpp new file mode 100644 index 0000000..5410d1d --- /dev/null +++ b/moonlight.hpp @@ -0,0 +1,15 @@ +#include "ppapi/cpp/instance.h" +#include "ppapi/cpp/module.h" +#include "ppapi/cpp/var.h" + +#include "nacl_io/nacl_io.h" + +class MoonlightInstance : public pp::Instance { + public: + explicit MoonlightInstance(PP_Instance instance) : pp::Instance(instance) { + // This function MUST be used otherwise sockets don't work (nacl_io_init() doesn't work!) + nacl_io_init_ppapi(pp_instance(), pp::Module::Get()->get_browser_interface()); + } + + virtual ~MoonlightInstance(); +}; \ No newline at end of file