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

Side by Side Diff: services/native_viewport/app_delegate.h

Issue 1975993002: Change InterfaceFactory<I>::Create() to take a ConnectionContext instead of an ApplicationConnectio… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « services/native_support/process_impl.cc ('k') | services/native_viewport/app_delegate.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 #ifndef SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_ 5 #ifndef SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_
6 #define SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_ 6 #define SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "mojo/application/application_runner_chromium.h" 14 #include "mojo/application/application_runner_chromium.h"
15 #include "mojo/common/tracing_impl.h" 15 #include "mojo/common/tracing_impl.h"
16 #include "mojo/public/c/system/main.h" 16 #include "mojo/public/c/system/main.h"
17 #include "mojo/public/cpp/application/application_delegate.h" 17 #include "mojo/public/cpp/application/application_delegate.h"
18 #include "mojo/public/cpp/application/application_impl.h" 18 #include "mojo/public/cpp/application/application_impl.h"
19 #include "mojo/services/native_viewport/cpp/args.h" 19 #include "mojo/services/native_viewport/cpp/args.h"
20 #include "services/gles2/gpu_impl.h" 20 #include "services/gles2/gpu_impl.h"
21 #include "services/native_viewport/native_viewport_impl.h" 21 #include "services/native_viewport/native_viewport_impl.h"
22 #include "ui/events/event_switches.h" 22 #include "ui/events/event_switches.h"
23 #include "ui/gl/gl_surface.h" 23 #include "ui/gl/gl_surface.h"
24 24
25 using mojo::ApplicationConnection;
26 using mojo::Gpu;
27 using mojo::NativeViewport;
28
29 namespace native_viewport { 25 namespace native_viewport {
30 26
31 class NativeViewportAppDelegate : public mojo::ApplicationDelegate, 27 class NativeViewportAppDelegate
32 public mojo::InterfaceFactory<NativeViewport>, 28 : public mojo::ApplicationDelegate,
33 public mojo::InterfaceFactory<Gpu> { 29 public mojo::InterfaceFactory<mojo::NativeViewport>,
30 public mojo::InterfaceFactory<mojo::Gpu> {
34 public: 31 public:
35 NativeViewportAppDelegate(); 32 NativeViewportAppDelegate();
36 ~NativeViewportAppDelegate() override; 33 ~NativeViewportAppDelegate() override;
37 34
38 // mojo::ApplicationDelegate implementation. 35 // mojo::ApplicationDelegate implementation.
39 void Initialize(mojo::ApplicationImpl* application) override; 36 void Initialize(mojo::ApplicationImpl* application) override;
40 37
41 bool ConfigureIncomingConnection(ApplicationConnection* connection) override; 38 bool ConfigureIncomingConnection(
39 mojo::ApplicationConnection* connection) override;
42 40
43 // mojo::InterfaceFactory<NativeViewport> implementation. 41 // mojo::InterfaceFactory<mojo::NativeViewport> implementation.
44 void Create(ApplicationConnection* connection, 42 void Create(const mojo::ConnectionContext& connection_context,
45 mojo::InterfaceRequest<NativeViewport> request) override; 43 mojo::InterfaceRequest<mojo::NativeViewport> request) override;
46 44
47 // mojo::InterfaceFactory<Gpu> implementation. 45 // mojo::InterfaceFactory<mojo::Gpu> implementation.
48 void Create(ApplicationConnection* connection, 46 void Create(const mojo::ConnectionContext& connection_context,
49 mojo::InterfaceRequest<Gpu> request) override; 47 mojo::InterfaceRequest<mojo::Gpu> request) override;
50 48
51 private: 49 private:
52 void InitLogging(mojo::ApplicationImpl* application); 50 void InitLogging(mojo::ApplicationImpl* application);
53 51
54 mojo::ApplicationImpl* application_; 52 mojo::ApplicationImpl* application_;
55 scoped_refptr<gles2::GpuState> gpu_state_; 53 scoped_refptr<gles2::GpuState> gpu_state_;
56 bool is_headless_; 54 bool is_headless_;
57 mojo::TracingImpl tracing_; 55 mojo::TracingImpl tracing_;
58 56
59 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate); 57 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
60 }; 58 };
61 59
62 } // namespace native_viewport 60 } // namespace native_viewport
63 61
64 #endif 62 #endif
OLDNEW
« no previous file with comments | « services/native_support/process_impl.cc ('k') | services/native_viewport/app_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698