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

Side by Side Diff: services/icu_data/icu_data_impl.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 "mojo/application/application_runner_chromium.h" 5 #include "mojo/application/application_runner_chromium.h"
6 #include "mojo/common/weak_binding_set.h" 6 #include "mojo/common/weak_binding_set.h"
7 #include "mojo/public/c/system/main.h" 7 #include "mojo/public/c/system/main.h"
8 #include "mojo/public/cpp/application/application_connection.h" 8 #include "mojo/public/cpp/application/application_connection.h"
9 #include "mojo/public/cpp/application/application_delegate.h" 9 #include "mojo/public/cpp/application/application_delegate.h"
10 #include "mojo/public/cpp/application/interface_factory.h" 10 #include "mojo/public/cpp/application/interface_factory.h"
11 #include "mojo/public/cpp/bindings/interface_ptr.h" 11 #include "mojo/public/cpp/bindings/interface_ptr.h"
12 #include "services/icu_data/data.h" 12 #include "services/icu_data/data.h"
13 #include "services/icu_data/icu_data.mojom.h" 13 #include "services/icu_data/icu_data.mojom.h"
14 14
15 namespace icu_data { 15 namespace icu_data {
16 16
17 class ICUDataImpl : public mojo::ApplicationDelegate, 17 class ICUDataImpl : public mojo::ApplicationDelegate,
18 public ICUData, 18 public ICUData,
19 public mojo::InterfaceFactory<ICUData> { 19 public mojo::InterfaceFactory<ICUData> {
20 public: 20 public:
21 ICUDataImpl() {} 21 ICUDataImpl() {}
22 ~ICUDataImpl() override {} 22 ~ICUDataImpl() override {}
23 23
24 // mojo::ApplicationDelegate implementation. 24 // mojo::ApplicationDelegate implementation.
25 bool ConfigureIncomingConnection( 25 bool ConfigureIncomingConnection(
26 mojo::ApplicationConnection* connection) override { 26 mojo::ApplicationConnection* connection,
27 const std::string& url) override {
27 connection->AddService(this); 28 connection->AddService(this);
28 return true; 29 return true;
29 } 30 }
30 31
31 // mojo::InterfaceFactory<mojo::ICUData> implementation. 32 // mojo::InterfaceFactory<mojo::ICUData> implementation.
32 void Create(mojo::ApplicationConnection* connection, 33 void Create(mojo::ApplicationConnection* connection,
33 mojo::InterfaceRequest<ICUData> request) override { 34 mojo::InterfaceRequest<ICUData> request) override {
34 bindings_.AddBinding(this, request.Pass()); 35 bindings_.AddBinding(this, request.Pass());
35 } 36 }
36 37
(...skipping 28 matching lines...) Expand all
65 66
66 scoped_ptr<mojo::SharedBuffer> buffer_; 67 scoped_ptr<mojo::SharedBuffer> buffer_;
67 mojo::WeakBindingSet<ICUData> bindings_; 68 mojo::WeakBindingSet<ICUData> bindings_;
68 }; 69 };
69 } 70 }
70 71
71 MojoResult MojoMain(MojoHandle shell_handle) { 72 MojoResult MojoMain(MojoHandle shell_handle) {
72 mojo::ApplicationRunnerChromium runner(new icu_data::ICUDataImpl); 73 mojo::ApplicationRunnerChromium runner(new icu_data::ICUDataImpl);
73 return runner.Run(shell_handle); 74 return runner.Run(shell_handle);
74 } 75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698