#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "jni/MojoMain_jni.h"
+#include "mojo/public/shell/application.h"
#include "mojo/services/native_viewport/native_viewport_service.h"
#include "mojo/shell/context.h"
#include "mojo/shell/init.h"
namespace {
-base::AtExitManager* g_at_exit = 0;
-
LazyInstance<scoped_ptr<base::MessageLoop> > g_java_message_loop =
LAZY_INSTANCE_INITIALIZER;
private:
virtual void Load(const GURL& url,
- ScopedMessagePipeHandle service_handle)
+ ScopedShellHandle service_handle)
MOJO_OVERRIDE {
- service_.reset(CreateNativeViewportService(service_handle.Pass()));
- service_->set_context(g_context.Get().get());
+ app_.reset(CreateNativeViewportService(g_context.Get().get(),
+ service_handle.Pass()));
}
- scoped_ptr<services::NativeViewportService> service_;
+ scoped_ptr<Application> app_;
};
LazyInstance<scoped_ptr<NativeViewportServiceLoader> >
base::android::InitApplicationContext(env, scoped_context);
- if (g_at_exit)
- return;
- g_at_exit = new base::AtExitManager();
- // TODO(abarth): Currently we leak g_at_exit.
-
CommandLine::Init(0, 0);
mojo::shell::InitializeLogging();