| OLD | NEW |
| 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "dbus/bus.h" | 6 #include "dbus/bus.h" |
| 7 #include "dbus/exported_object.h" | 7 #include "dbus/exported_object.h" |
| 8 #include "dbus/message.h" | 8 #include "dbus/message.h" |
| 9 #include "dbus/object_path.h" | 9 #include "dbus/object_path.h" |
| 10 #include "mojo/common/channel_init.h" | 10 #include "mojo/embedder/channel_init.h" |
| 11 #include "mojo/public/cpp/application/application.h" | 11 #include "mojo/public/cpp/application/application.h" |
| 12 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | 12 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" |
| 13 #include "mojo/shell/external_service.mojom.h" | 13 #include "mojo/shell/external_service.mojom.h" |
| 14 | 14 |
| 15 namespace mojo { | 15 namespace mojo { |
| 16 const char kMojoDBusImplPath[] = "/org/chromium/MojoImpl"; | 16 const char kMojoDBusImplPath[] = "/org/chromium/MojoImpl"; |
| 17 const char kMojoDBusInterface[] = "org.chromium.Mojo"; | 17 const char kMojoDBusInterface[] = "org.chromium.Mojo"; |
| 18 const char kMojoDBusConnectMethod[] = "ConnectChannel"; | 18 const char kMojoDBusConnectMethod[] = "ConnectChannel"; |
| 19 | 19 |
| 20 class DBusExternalServiceBase { | 20 class DBusExternalServiceBase { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 36 void ConnectChannel(dbus::MethodCall* method_call, | 36 void ConnectChannel(dbus::MethodCall* method_call, |
| 37 dbus::ExportedObject::ResponseSender sender); | 37 dbus::ExportedObject::ResponseSender sender); |
| 38 | 38 |
| 39 void ExportMethods(); | 39 void ExportMethods(); |
| 40 void InitializeDBus(); | 40 void InitializeDBus(); |
| 41 void TakeDBusServiceOwnership(); | 41 void TakeDBusServiceOwnership(); |
| 42 | 42 |
| 43 const std::string service_name_; | 43 const std::string service_name_; |
| 44 scoped_refptr<dbus::Bus> bus_; | 44 scoped_refptr<dbus::Bus> bus_; |
| 45 dbus::ExportedObject* exported_object_; // Owned by bus_; | 45 dbus::ExportedObject* exported_object_; // Owned by bus_; |
| 46 scoped_ptr<common::ChannelInit> channel_init_; | 46 scoped_ptr<embedder::ChannelInit> channel_init_; |
| 47 DISALLOW_COPY_AND_ASSIGN(DBusExternalServiceBase); | 47 DISALLOW_COPY_AND_ASSIGN(DBusExternalServiceBase); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 template <class ServiceImpl> | 50 template <class ServiceImpl> |
| 51 class DBusExternalService : public DBusExternalServiceBase { | 51 class DBusExternalService : public DBusExternalServiceBase { |
| 52 public: | 52 public: |
| 53 explicit DBusExternalService(const std::string& service_name) | 53 explicit DBusExternalService(const std::string& service_name) |
| 54 : DBusExternalServiceBase(service_name) { | 54 : DBusExternalServiceBase(service_name) { |
| 55 } | 55 } |
| 56 virtual ~DBusExternalService() {} | 56 virtual ~DBusExternalService() {} |
| (...skipping 22 matching lines...) Expand all Loading... |
| 79 } | 79 } |
| 80 private: | 80 private: |
| 81 DBusExternalService* service_; | 81 DBusExternalService* service_; |
| 82 scoped_ptr<Application> app_; | 82 scoped_ptr<Application> app_; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 scoped_ptr<Impl> external_service_; | 85 scoped_ptr<Impl> external_service_; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace mojo | 88 } // namespace mojo |
| OLD | NEW |