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

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

Issue 404913002: Break dependency of native_viewport_service on mojo::shell::Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move call to GetApplicationContext() to native_viewport_android Created 6 years, 5 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: 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 203ec104edc99ae969c7585c2e539a7a12339012..bcde3aac7ec43ddda7770d29a372240d155ff921 100644
--- a/mojo/services/native_viewport/native_viewport_service.cc
+++ b/mojo/services/native_viewport/native_viewport_service.cc
@@ -33,10 +33,8 @@ class NativeViewportImpl
: public InterfaceImpl<mojo::NativeViewport>,
public NativeViewportDelegate {
public:
- NativeViewportImpl(ApplicationConnection* connection,
- shell::Context* context)
- : context_(context),
- widget_(gfx::kNullAcceleratedWidget),
+ explicit NativeViewportImpl(ApplicationConnection* connection)
+ : widget_(gfx::kNullAcceleratedWidget),
waiting_for_event_ack_(false),
weak_factory_(this) {}
virtual ~NativeViewportImpl() {
@@ -46,8 +44,7 @@ class NativeViewportImpl
}
virtual void Create(RectPtr bounds) OVERRIDE {
- native_viewport_ =
- services::NativeViewport::Create(context_, this);
+ native_viewport_ = services::NativeViewport::Create(this);
native_viewport_->Init(bounds.To<gfx::Rect>());
client()->OnCreated();
OnBoundsChanged(bounds.To<gfx::Rect>());
@@ -146,7 +143,6 @@ class NativeViewportImpl
command_buffer_.reset();
}
- shell::Context* context_;
gfx::AcceleratedWidget widget_;
scoped_ptr<services::NativeViewport> native_viewport_;
InterfaceRequest<CommandBuffer> command_buffer_request_;
@@ -157,27 +153,24 @@ class NativeViewportImpl
class NVSDelegate : public ApplicationDelegate {
public:
- NVSDelegate(shell::Context* context) : context_(context) {}
+ NVSDelegate() {}
virtual ~NVSDelegate() {}
virtual bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) MOJO_OVERRIDE {
- connection->AddService<NativeViewportImpl>(context_);
+ connection->AddService<NativeViewportImpl>();
return true;
}
-
- private:
- mojo::shell::Context* context_;
};
-} // namespace services
-} // namespace mojo
-
MOJO_NATIVE_VIEWPORT_EXPORT mojo::ApplicationImpl*
CreateNativeViewportService(
- mojo::shell::Context* context,
- mojo::ScopedMessagePipeHandle service_provider_handle) {
- mojo::ApplicationImpl* app = new mojo::ApplicationImpl(
- new mojo::services::NVSDelegate(context), service_provider_handle.Pass());
+ ScopedMessagePipeHandle service_provider_handle) {
+ ApplicationImpl* app = new ApplicationImpl(
+ new NVSDelegate(), service_provider_handle.Pass());
return app;
}
+
+} // namespace services
+} // namespace mojo
+
« no previous file with comments | « mojo/services/native_viewport/native_viewport_service.h ('k') | mojo/services/native_viewport/native_viewport_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698