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

Side by Side Diff: shell/test/pingable_app.cc

Issue 1074963002: Add some |using mojo::...;|s to //shell .cc files. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « shell/shell_test_base_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mojo/public/c/system/main.h" 5 #include "mojo/public/c/system/main.h"
6 #include "mojo/public/cpp/application/application_delegate.h" 6 #include "mojo/public/cpp/application/application_delegate.h"
7 #include "mojo/public/cpp/application/application_impl.h" 7 #include "mojo/public/cpp/application/application_impl.h"
8 #include "mojo/public/cpp/application/application_runner.h" 8 #include "mojo/public/cpp/application/application_runner.h"
9 #include "mojo/public/cpp/application/interface_factory.h" 9 #include "mojo/public/cpp/application/interface_factory.h"
10 #include "mojo/public/cpp/bindings/callback.h" 10 #include "mojo/public/cpp/bindings/callback.h"
11 #include "mojo/public/cpp/bindings/interface_request.h" 11 #include "mojo/public/cpp/bindings/interface_request.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h" 12 #include "mojo/public/cpp/bindings/strong_binding.h"
13 #include "shell/test/pingable.mojom.h" 13 #include "shell/test/pingable.mojom.h"
14 14
15 using mojo::String;
16
15 class PingableImpl : public Pingable { 17 class PingableImpl : public Pingable {
16 public: 18 public:
17 PingableImpl(mojo::InterfaceRequest<Pingable> request, 19 PingableImpl(mojo::InterfaceRequest<Pingable> request,
18 const std::string& app_url, 20 const std::string& app_url,
19 const std::string& connection_url) 21 const std::string& connection_url)
20 : binding_(this, request.Pass()), 22 : binding_(this, request.Pass()),
21 app_url_(app_url), 23 app_url_(app_url),
22 connection_url_(connection_url) {} 24 connection_url_(connection_url) {}
23 25
24 ~PingableImpl() override {} 26 ~PingableImpl() override {}
25 27
26 private: 28 private:
27 void Ping( 29 void Ping(
28 const mojo::String& message, 30 const String& message,
29 const mojo::Callback<void(mojo::String, mojo::String, mojo::String)>& 31 const mojo::Callback<void(String, String, String)>& callback) override {
30 callback) override {
31 callback.Run(app_url_, connection_url_, message); 32 callback.Run(app_url_, connection_url_, message);
32 } 33 }
33 34
34 mojo::StrongBinding<Pingable> binding_; 35 mojo::StrongBinding<Pingable> binding_;
35 std::string app_url_; 36 std::string app_url_;
36 std::string connection_url_; 37 std::string connection_url_;
37 }; 38 };
38 39
39 class PingableApp : public mojo::ApplicationDelegate, 40 class PingableApp : public mojo::ApplicationDelegate,
40 public mojo::InterfaceFactory<Pingable> { 41 public mojo::InterfaceFactory<Pingable> {
(...skipping 19 matching lines...) Expand all
60 new PingableImpl(request.Pass(), app_url_, connection->GetConnectionURL()); 61 new PingableImpl(request.Pass(), app_url_, connection->GetConnectionURL());
61 } 62 }
62 63
63 std::string app_url_; 64 std::string app_url_;
64 }; 65 };
65 66
66 MojoResult MojoMain(MojoHandle application_request) { 67 MojoResult MojoMain(MojoHandle application_request) {
67 mojo::ApplicationRunner runner(new PingableApp); 68 mojo::ApplicationRunner runner(new PingableApp);
68 return runner.Run(application_request); 69 return runner.Run(application_request);
69 } 70 }
OLDNEW
« no previous file with comments | « shell/shell_test_base_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698