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

Side by Side Diff: examples/hello_mojo/hello_mojo_server.cc

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 | « examples/echo_terminal/main.cc ('k') | examples/indirect_service/indirect_integer_service.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 #include <utility> 7 #include <utility>
8 8
9 #include "examples/hello_mojo/hello_mojo.mojom.h" 9 #include "examples/hello_mojo/hello_mojo.mojom.h"
10 #include "mojo/public/c/system/main.h" 10 #include "mojo/public/c/system/main.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ~HelloMojoServerApp() override {} 45 ~HelloMojoServerApp() override {}
46 46
47 // |mojo::ApplicationDelegate| implementation: 47 // |mojo::ApplicationDelegate| implementation:
48 bool ConfigureIncomingConnection( 48 bool ConfigureIncomingConnection(
49 mojo::ApplicationConnection* application_connection) override { 49 mojo::ApplicationConnection* application_connection) override {
50 application_connection->AddService<HelloMojo>(this); 50 application_connection->AddService<HelloMojo>(this);
51 return true; 51 return true;
52 } 52 }
53 53
54 // |mojo::InterfaceFactory<HelloMojo>| implementation: 54 // |mojo::InterfaceFactory<HelloMojo>| implementation:
55 void Create(mojo::ApplicationConnection* application_connection, 55 void Create(const mojo::ConnectionContext& connection_context,
56 mojo::InterfaceRequest<HelloMojo> hello_mojo_request) override { 56 mojo::InterfaceRequest<HelloMojo> hello_mojo_request) override {
57 new HelloMojoImpl(std::move(hello_mojo_request)); // Owns itself. 57 new HelloMojoImpl(std::move(hello_mojo_request)); // Owns itself.
58 } 58 }
59 59
60 private: 60 private:
61 MOJO_DISALLOW_COPY_AND_ASSIGN(HelloMojoServerApp); 61 MOJO_DISALLOW_COPY_AND_ASSIGN(HelloMojoServerApp);
62 }; 62 };
63 63
64 } // namespace 64 } // namespace
65 65
66 MojoResult MojoMain(MojoHandle application_request) { 66 MojoResult MojoMain(MojoHandle application_request) {
67 return mojo::ApplicationRunner(std::unique_ptr<mojo::ApplicationDelegate>( 67 return mojo::ApplicationRunner(std::unique_ptr<mojo::ApplicationDelegate>(
68 new HelloMojoServerApp())) 68 new HelloMojoServerApp()))
69 .Run(application_request); 69 .Run(application_request);
70 } 70 }
OLDNEW
« no previous file with comments | « examples/echo_terminal/main.cc ('k') | examples/indirect_service/indirect_integer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698