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

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

Issue 943053003: Simple multi-url support for mojo apps (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: hate Created 5 years, 9 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
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 "mojo/application/application_runner_chromium.h" 7 #include "mojo/application/application_runner_chromium.h"
8 #include "mojo/common/tracing_impl.h" 8 #include "mojo/common/tracing_impl.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"
(...skipping 28 matching lines...) Expand all
39 if (app_->HasArg(mojo::kUseTestConfig)) 39 if (app_->HasArg(mojo::kUseTestConfig))
40 gfx::GLSurface::InitializeOneOffForTests(); 40 gfx::GLSurface::InitializeOneOffForTests();
41 else if (app_->HasArg(mojo::kUseOSMesa)) 41 else if (app_->HasArg(mojo::kUseOSMesa))
42 gfx::GLSurface::InitializeOneOff(gfx::kGLImplementationOSMesaGL); 42 gfx::GLSurface::InitializeOneOff(gfx::kGLImplementationOSMesaGL);
43 else 43 else
44 gfx::GLSurface::InitializeOneOff(); 44 gfx::GLSurface::InitializeOneOff();
45 45
46 is_headless_ = app_->HasArg(mojo::kUseHeadlessConfig); 46 is_headless_ = app_->HasArg(mojo::kUseHeadlessConfig);
47 } 47 }
48 48
49 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { 49 bool ConfigureIncomingConnection(ApplicationConnection* connection, const std: :string& url) override {
50 connection->AddService<NativeViewport>(this); 50 connection->AddService<NativeViewport>(this);
51 connection->AddService<Gpu>(this); 51 connection->AddService<Gpu>(this);
52 return true; 52 return true;
53 } 53 }
54 54
55 // mojo::InterfaceFactory<NativeViewport> implementation. 55 // mojo::InterfaceFactory<NativeViewport> implementation.
56 void Create(ApplicationConnection* connection, 56 void Create(ApplicationConnection* connection,
57 mojo::InterfaceRequest<NativeViewport> request) override { 57 mojo::InterfaceRequest<NativeViewport> request) override {
58 new NativeViewportImpl(app_, is_headless_, request.Pass()); 58 new NativeViewportImpl(app_, is_headless_, request.Pass());
59 } 59 }
(...skipping 14 matching lines...) Expand all
74 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate); 74 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
75 }; 75 };
76 } 76 }
77 77
78 MojoResult MojoMain(MojoHandle shell_handle) { 78 MojoResult MojoMain(MojoHandle shell_handle) {
79 mojo::ApplicationRunnerChromium runner( 79 mojo::ApplicationRunnerChromium runner(
80 new native_viewport::NativeViewportAppDelegate); 80 new native_viewport::NativeViewportAppDelegate);
81 runner.set_message_loop_type(base::MessageLoop::TYPE_UI); 81 runner.set_message_loop_type(base::MessageLoop::TYPE_UI);
82 return runner.Run(shell_handle); 82 return runner.Run(shell_handle);
83 } 83 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698