summaryrefslogtreecommitdiffstats
path: root/mojo/examples/pepper_container_app
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 16:58:53 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 16:58:53 +0000
commita2a3e7ce17671c6c1ec93474ee9eecd7d63b3cbc (patch)
treed2bc930aa238d76884f56c12ab8e8d12b2126ba4 /mojo/examples/pepper_container_app
parentf88f20bb8ccea880db1700008e8cc15337c84247 (diff)
downloadchromium_src-a2a3e7ce17671c6c1ec93474ee9eecd7d63b3cbc.zip
chromium_src-a2a3e7ce17671c6c1ec93474ee9eecd7d63b3cbc.tar.gz
chromium_src-a2a3e7ce17671c6c1ec93474ee9eecd7d63b3cbc.tar.bz2
Support MojoMain() in an Application context
BUG= R=darin@chromium.org Review URL: https://codereview.chromium.org/302773005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/examples/pepper_container_app')
-rw-r--r--mojo/examples/pepper_container_app/pepper_container_app.cc38
1 files changed, 12 insertions, 26 deletions
diff --git a/mojo/examples/pepper_container_app/pepper_container_app.cc b/mojo/examples/pepper_container_app/pepper_container_app.cc
index e678613..3d5bf31 100644
--- a/mojo/examples/pepper_container_app/pepper_container_app.cc
+++ b/mojo/examples/pepper_container_app/pepper_container_app.cc
@@ -13,7 +13,6 @@
#include "mojo/examples/pepper_container_app/type_converters.h"
#include "mojo/public/cpp/application/application.h"
#include "mojo/public/cpp/bindings/allocation_scope.h"
-#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/cpp/gles2/gles2.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
@@ -21,16 +20,6 @@
#include "ppapi/c/pp_rect.h"
#include "ppapi/shared_impl/proxy_lock.h"
-#if defined(OS_WIN)
-#if !defined(CDECL)
-#define CDECL __cdecl
-#endif
-#define PEPPER_CONTAINER_APP_EXPORT __declspec(dllexport)
-#else
-#define CDECL
-#define PEPPER_CONTAINER_APP_EXPORT __attribute__((visibility("default")))
-#endif
-
namespace mojo {
namespace examples {
@@ -38,10 +27,14 @@ class PepperContainerApp: public Application,
public NativeViewportClient,
public MojoPpapiGlobals::Delegate {
public:
- explicit PepperContainerApp(MojoHandle service_provider_handle)
- : Application(service_provider_handle),
+ explicit PepperContainerApp()
+ : Application(),
ppapi_globals_(this),
- plugin_module_(new PluginModule) {
+ plugin_module_(new PluginModule) {}
+
+ virtual ~PepperContainerApp() {}
+
+ virtual void Initialize() MOJO_OVERRIDE {
mojo::AllocationScope scope;
ConnectTo("mojo:mojo_native_viewport_service", &viewport_);
@@ -60,8 +53,6 @@ class PepperContainerApp: public Application,
viewport_->Show();
}
- virtual ~PepperContainerApp() {}
-
// NativeViewportClient implementation.
virtual void OnCreated() OVERRIDE {
ppapi::ProxyAutoLock lock;
@@ -117,15 +108,10 @@ class PepperContainerApp: public Application,
};
} // namespace examples
-} // namespace mojo
-
-extern "C" PEPPER_CONTAINER_APP_EXPORT MojoResult CDECL MojoMain(
- MojoHandle service_provider_handle) {
- mojo::Environment env;
- mojo::GLES2Initializer gles2;
- base::MessageLoop run_loop;
- mojo::examples::PepperContainerApp app(service_provider_handle);
- run_loop.Run();
- return MOJO_RESULT_OK;
+// static
+Application* Application::Create() {
+ return new examples::PepperContainerApp();
}
+
+} // namespace mojo