| Index: components/native_viewport/main.cc
|
| diff --git a/components/native_viewport/main.cc b/components/native_viewport/main.cc
|
| index 1ebfb270df26bcdf2c6dabb935e702953c9372db..5326ee14115041a915b285bf603f6f06d6d25a6d 100644
|
| --- a/components/native_viewport/main.cc
|
| +++ b/components/native_viewport/main.cc
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "base/bind.h"
|
| #include "base/command_line.h"
|
| #include "base/macros.h"
|
| #include "base/message_loop/message_loop.h"
|
| @@ -16,6 +17,7 @@
|
| #include "third_party/mojo/src/mojo/public/cpp/application/application_impl.h"
|
| #include "third_party/mojo/src/mojo/public/cpp/application/interface_factory_impl.h"
|
| #include "ui/events/event_switches.h"
|
| +#include "ui/events/platform/platform_event_source.h"
|
| #include "ui/gl/gl_surface.h"
|
|
|
| using mojo::ApplicationConnection;
|
| @@ -34,6 +36,7 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
|
| private:
|
| // mojo::ApplicationDelegate implementation.
|
| void Initialize(mojo::ApplicationImpl* application) override {
|
| + event_source_ = ui::PlatformEventSource::CreateDefault();
|
| tracing_.Initialize(application);
|
|
|
| base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| @@ -57,7 +60,10 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
|
| mojo::InterfaceRequest<NativeViewport> request) override {
|
| if (!gpu_state_.get())
|
| gpu_state_ = new gles2::GpuState;
|
| - new NativeViewportImpl(is_headless_, gpu_state_, request.Pass());
|
| + new NativeViewportImpl(is_headless_,
|
| + gpu_state_,
|
| + request.Pass(),
|
| + app_lifetime_helper_.CreateAppRefCount());
|
| }
|
|
|
| // mojo::InterfaceFactory<Gpu> implementation.
|
| @@ -69,8 +75,10 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
|
| }
|
|
|
| scoped_refptr<gles2::GpuState> gpu_state_;
|
| + scoped_ptr<ui::PlatformEventSource> event_source_;
|
| bool is_headless_;
|
| mojo::TracingImpl tracing_;
|
| + mojo::AppLifetimeHelper app_lifetime_helper_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
|
| };
|
|
|