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

Side by Side Diff: mojo/services/native_viewport/main.cc

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « mojo/services/native_viewport/DEPS ('k') | mojo/shell/context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/macros.h" 5 #include "base/macros.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "gpu/command_buffer/service/mailbox_manager.h" 7 #include "gpu/command_buffer/service/mailbox_manager_impl.h"
8 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
11 #include "mojo/public/cpp/application/application_delegate.h" 11 #include "mojo/public/cpp/application/application_delegate.h"
12 #include "mojo/public/cpp/application/application_impl.h" 12 #include "mojo/public/cpp/application/application_impl.h"
13 #include "mojo/public/cpp/application/interface_factory_impl.h" 13 #include "mojo/public/cpp/application/interface_factory_impl.h"
14 #include "mojo/services/native_viewport/gpu_impl.h" 14 #include "mojo/services/native_viewport/gpu_impl.h"
15 #include "mojo/services/native_viewport/native_viewport_impl.h" 15 #include "mojo/services/native_viewport/native_viewport_impl.h"
16 #include "mojo/services/public/cpp/native_viewport/args.h" 16 #include "mojo/services/public/cpp/native_viewport/args.h"
17 #include "ui/gl/gl_share_group.h" 17 #include "ui/gl/gl_share_group.h"
18 #include "ui/gl/gl_surface.h" 18 #include "ui/gl/gl_surface.h"
19 19
20 namespace mojo { 20 namespace mojo {
21 21
22 class NativeViewportAppDelegate 22 class NativeViewportAppDelegate
23 : public ApplicationDelegate, 23 : public ApplicationDelegate,
24 public InterfaceFactory<NativeViewport>, 24 public InterfaceFactory<NativeViewport>,
25 public InterfaceFactory<Gpu> { 25 public InterfaceFactory<Gpu> {
26 public: 26 public:
27 NativeViewportAppDelegate() 27 NativeViewportAppDelegate()
28 : share_group_(new gfx::GLShareGroup), 28 : share_group_(new gfx::GLShareGroup),
29 mailbox_manager_(new gpu::gles2::MailboxManager), 29 mailbox_manager_(new gpu::gles2::MailboxManagerImpl),
30 is_headless_(false) {} 30 is_headless_(false) {}
31 ~NativeViewportAppDelegate() override {} 31 ~NativeViewportAppDelegate() override {}
32 32
33 private: 33 private:
34 bool HasArg(const std::string& arg) { 34 bool HasArg(const std::string& arg) {
35 const auto& args = app_->args(); 35 const auto& args = app_->args();
36 return std::find(args.begin(), args.end(), arg) != args.end(); 36 return std::find(args.begin(), args.end(), arg) != args.end();
37 } 37 }
38 38
39 // ApplicationDelegate implementation. 39 // ApplicationDelegate implementation.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 bool is_headless_; 75 bool is_headless_;
76 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate); 76 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
77 }; 77 };
78 } 78 }
79 79
80 MojoResult MojoMain(MojoHandle shell_handle) { 80 MojoResult MojoMain(MojoHandle shell_handle) {
81 mojo::ApplicationRunnerChromium runner(new mojo::NativeViewportAppDelegate); 81 mojo::ApplicationRunnerChromium runner(new mojo::NativeViewportAppDelegate);
82 runner.set_message_loop_type(base::MessageLoop::TYPE_UI); 82 runner.set_message_loop_type(base::MessageLoop::TYPE_UI);
83 return runner.Run(shell_handle); 83 return runner.Run(shell_handle);
84 } 84 }
OLDNEW
« no previous file with comments | « mojo/services/native_viewport/DEPS ('k') | mojo/shell/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698