| Index: mojo/services/native_viewport/native_viewport_service.cc
|
| diff --git a/mojo/services/native_viewport/native_viewport_service.cc b/mojo/services/native_viewport/native_viewport_service.cc
|
| index b7c80524c78349e953c76582ee914b72f9eea57f..9b57c6b75b7709db870e7c3c63717da4f65aa84c 100644
|
| --- a/mojo/services/native_viewport/native_viewport_service.cc
|
| +++ b/mojo/services/native_viewport/native_viewport_service.cc
|
| @@ -9,6 +9,7 @@
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/time/time.h"
|
| #include "mojo/public/cpp/application/application_delegate.h"
|
| +#include "mojo/public/cpp/application/interface_factory_with_context.h"
|
| #include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
|
| #include "mojo/services/gles2/command_buffer_impl.h"
|
| #include "mojo/services/native_viewport/native_viewport.h"
|
| @@ -29,12 +30,10 @@ bool IsRateLimitedEventType(ui::Event* event) {
|
|
|
| } // namespace
|
|
|
| -class NativeViewportImpl
|
| - : public InterfaceImpl<mojo::NativeViewport>,
|
| - public NativeViewportDelegate {
|
| +class NativeViewportImpl : public InterfaceImpl<mojo::NativeViewport>,
|
| + public NativeViewportDelegate {
|
| public:
|
| - NativeViewportImpl(ApplicationConnection* connection,
|
| - shell::Context* context)
|
| + explicit NativeViewportImpl(shell::Context* context)
|
| : context_(context),
|
| widget_(gfx::kNullAcceleratedWidget),
|
| waiting_for_event_ack_(false),
|
| @@ -96,7 +95,7 @@ class NativeViewportImpl
|
| return;
|
| command_buffer_.reset(
|
| new CommandBufferImpl(widget_, native_viewport_->GetSize()));
|
| - BindToRequest(command_buffer_.get(), &command_buffer_request_);
|
| + WeakBindToRequest(command_buffer_.get(), &command_buffer_request_);
|
| }
|
|
|
| virtual bool OnEvent(ui::Event* ui_event) OVERRIDE {
|
| @@ -155,19 +154,20 @@ class NativeViewportImpl
|
| base::WeakPtrFactory<NativeViewportImpl> weak_factory_;
|
| };
|
|
|
| -class NVSDelegate : public ApplicationDelegate {
|
| +class NVSDelegate
|
| + : public ApplicationDelegate,
|
| + public InterfaceFactoryWithContext<NativeViewportImpl, shell::Context> {
|
| public:
|
| - NVSDelegate(shell::Context* context) : context_(context) {}
|
| + explicit NVSDelegate(shell::Context* context)
|
| + : InterfaceFactoryWithContext(context) {}
|
| virtual ~NVSDelegate() {}
|
|
|
| + // ApplicationDelegate implementation.
|
| virtual bool ConfigureIncomingConnection(
|
| - mojo::ApplicationConnection* connection) MOJO_OVERRIDE {
|
| - connection->AddService<NativeViewportImpl>(context_);
|
| + ApplicationConnection* connection) OVERRIDE {
|
| + connection->AddServiceFactory(this);
|
| return true;
|
| }
|
| -
|
| - private:
|
| - mojo::shell::Context* context_;
|
| };
|
|
|
| } // namespace services
|
|
|