Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: trunk/src/mojo/services/native_viewport/native_viewport_service.cc

Issue 287003004: Revert 270867 "Mojo: Internalize ServiceConnector<>" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/mojo/services/native_viewport/native_viewport_service.cc
===================================================================
--- trunk/src/mojo/services/native_viewport/native_viewport_service.cc (revision 270872)
+++ trunk/src/mojo/services/native_viewport/native_viewport_service.cc (working copy)
@@ -28,12 +28,13 @@
}
class NativeViewportImpl
- : public InterfaceImpl<mojo::NativeViewport>,
+ : public ServiceConnection<mojo::NativeViewport,
+ NativeViewportImpl,
+ shell::Context>,
public NativeViewportDelegate {
public:
- NativeViewportImpl(shell::Context* context)
- : context_(context),
- widget_(gfx::kNullAcceleratedWidget),
+ NativeViewportImpl()
+ : widget_(gfx::kNullAcceleratedWidget),
waiting_for_event_ack_(false) {}
virtual ~NativeViewportImpl() {
// Destroy the NativeViewport early on as it may call us back during
@@ -41,11 +42,9 @@
native_viewport_.reset();
}
- virtual void OnConnectionError() OVERRIDE {}
-
virtual void Create(const Rect& bounds) OVERRIDE {
native_viewport_ =
- services::NativeViewport::Create(context_, this);
+ services::NativeViewport::Create(context(), this);
native_viewport_->Init(bounds);
client()->OnCreated();
OnBoundsChanged(bounds);
@@ -175,7 +174,6 @@
}
private:
- shell::Context* context_;
gfx::AcceleratedWidget widget_;
scoped_ptr<services::NativeViewport> native_viewport_;
ScopedMessagePipeHandle command_buffer_handle_;
@@ -191,7 +189,9 @@
CreateNativeViewportService(mojo::shell::Context* context,
mojo::ScopedMessagePipeHandle shell_handle) {
mojo::Application* app = new mojo::Application(shell_handle.Pass());
- app->AddService<mojo::services::NativeViewportImpl>(context);
+ app->AddServiceConnector(
+ new mojo::ServiceConnector<mojo::services::NativeViewportImpl,
+ mojo::shell::Context>(context));
return app;
}

Powered by Google App Engine
This is Rietveld 408576698