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

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

Issue 574993002: Revert of Second attempt to land change to remove NativeViewportService and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « mojo/services/native_viewport/DEPS ('k') | mojo/services/public/cpp/view_manager/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/native_viewport/main.cc
diff --git a/mojo/services/native_viewport/main.cc b/mojo/services/native_viewport/main.cc
deleted file mode 100644
index fb150da28daed961b7aa3c6bec9f2196de998703..0000000000000000000000000000000000000000
--- a/mojo/services/native_viewport/main.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/message_loop/message_loop.h"
-#include "gpu/command_buffer/service/mailbox_manager.h"
-#include "mojo/application/application_runner_chromium.h"
-#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_connection.h"
-#include "mojo/public/cpp/application/application_delegate.h"
-#include "mojo/public/cpp/application/interface_factory_impl.h"
-#include "mojo/services/native_viewport/gpu_impl.h"
-#include "mojo/services/native_viewport/native_viewport_impl.h"
-#include "ui/gl/gl_share_group.h"
-#include "ui/gl/gl_surface.h"
-
-namespace mojo {
-
-class NativeViewportAppDelegate
- : public ApplicationDelegate,
- public InterfaceFactory<NativeViewport>,
- public InterfaceFactory<Gpu>,
- public InterfaceFactory<NativeViewportConfig> {
- public:
- NativeViewportAppDelegate()
- : share_group_(new gfx::GLShareGroup),
- mailbox_manager_(new gpu::gles2::MailboxManager),
- is_test_(false),
- is_initialized_(false) {}
- virtual ~NativeViewportAppDelegate() {}
-
- private:
- class NativeViewportConfigImpl : public InterfaceImpl<NativeViewportConfig> {
- public:
- NativeViewportConfigImpl(NativeViewportAppDelegate* app_delegate)
- : app_delegate_(app_delegate) {}
-
- virtual void UseTestConfig(
- const mojo::Callback<void()>& callback) OVERRIDE {
- app_delegate_->is_test_ = true;
- callback.Run();
- }
-
- private:
- NativeViewportAppDelegate* app_delegate_;
- };
-
- // ApplicationDelegate implementation.
- virtual void Initialize(ApplicationImpl* application) OVERRIDE {
- app_ = application;
- }
-
- virtual bool ConfigureIncomingConnection(
- mojo::ApplicationConnection* connection) OVERRIDE {
- connection->AddService<NativeViewport>(this);
- connection->AddService<Gpu>(this);
- connection->AddService<NativeViewportConfig>(this);
- return true;
- }
-
- // InterfaceFactory<NativeViewport> implementation.
- virtual void Create(ApplicationConnection* connection,
- InterfaceRequest<NativeViewport> request) OVERRIDE {
-#if !defined(COMPONENT_BUILD)
- if (!is_initialized_) {
- if (is_test_)
- gfx::GLSurface::InitializeOneOffForTests();
- else
- gfx::GLSurface::InitializeOneOff();
- is_initialized_ = true;
- }
-#endif
- BindToRequest(new NativeViewportImpl(app_), &request);
- }
-
- // InterfaceFactory<Gpu> implementation.
- virtual void Create(ApplicationConnection* connection,
- InterfaceRequest<Gpu> request) OVERRIDE {
- BindToRequest(new GpuImpl(share_group_.get(), mailbox_manager_.get()),
- &request);
- }
-
- // InterfaceFactory<NVTestConfig> implementation.
- virtual void Create(ApplicationConnection* connection,
- InterfaceRequest<NativeViewportConfig> request) OVERRIDE {
- BindToRequest(new NativeViewportConfigImpl(this), &request);
- }
-
- ApplicationImpl* app_;
- scoped_refptr<gfx::GLShareGroup> share_group_;
- scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;
- bool is_test_;
- bool is_initialized_;
- DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
-};
-}
-
-MojoResult MojoMain(MojoHandle shell_handle) {
- mojo::ApplicationRunnerChromium runner(new mojo::NativeViewportAppDelegate);
- runner.set_message_loop_type(base::MessageLoop::TYPE_UI);
- return runner.Run(shell_handle);
-}
« no previous file with comments | « mojo/services/native_viewport/DEPS ('k') | mojo/services/public/cpp/view_manager/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698