| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010, 2011 The Chromium OS 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 <config.h> | 5 #include <config.h> |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 | 11 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 LOG(ERROR) << "couldn't create dbus dispatcher"; | 119 LOG(ERROR) << "couldn't create dbus dispatcher"; |
| 120 cashew::CleanUpForExit(); | 120 cashew::CleanUpForExit(); |
| 121 exit(EXIT_FAILURE); | 121 exit(EXIT_FAILURE); |
| 122 } | 122 } |
| 123 DBus::default_dispatcher = cashew::dispatcher; | 123 DBus::default_dispatcher = cashew::dispatcher; |
| 124 cashew::dispatcher->attach(NULL); | 124 cashew::dispatcher->attach(NULL); |
| 125 | 125 |
| 126 DLOG(INFO) << "creating service manager"; | 126 DLOG(INFO) << "creating service manager"; |
| 127 DBus::Connection client_conn = DBus::Connection::SystemBus(); | 127 DBus::Connection client_conn = DBus::Connection::SystemBus(); |
| 128 client_conn.set_timeout(cashew::kDBusConnectionTimeoutMilliseconds); | 128 client_conn.set_timeout(cashew::kDBusConnectionTimeoutMilliseconds); |
| 129 cashew::service_manager = new(std::nothrow) cashew::ServiceManager( | 129 cashew::service_manager = cashew::ServiceManager::NewServiceManager( |
| 130 client_conn, cashew::main_loop); | 130 client_conn, cashew::main_loop); |
| 131 if (cashew::service_manager == NULL) { | 131 if (cashew::service_manager == NULL) { |
| 132 LOG(ERROR) << "couldn't create service manager"; | 132 LOG(ERROR) << "couldn't create service manager"; |
| 133 cashew::CleanUpForExit(); | 133 cashew::CleanUpForExit(); |
| 134 exit(EXIT_FAILURE); | 134 exit(EXIT_FAILURE); |
| 135 } | 135 } |
| 136 | 136 |
| 137 DLOG(INFO) << "creating cashew server"; | 137 DLOG(INFO) << "creating cashew server"; |
| 138 // TODO(vlaviano): can we share a single conn for client and server roles? | 138 // TODO(vlaviano): can we share a single conn for client and server roles? |
| 139 DBus::Connection server_conn = DBus::Connection::SystemBus(); | 139 DBus::Connection server_conn = DBus::Connection::SystemBus(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 152 cashew::CleanUpForExit(); | 152 cashew::CleanUpForExit(); |
| 153 exit(EXIT_FAILURE); | 153 exit(EXIT_FAILURE); |
| 154 } | 154 } |
| 155 | 155 |
| 156 DLOG(INFO) << "entering event loop"; | 156 DLOG(INFO) << "entering event loop"; |
| 157 g_main_loop_run(cashew::main_loop); | 157 g_main_loop_run(cashew::main_loop); |
| 158 DLOG(INFO) << "exited event loop"; | 158 DLOG(INFO) << "exited event loop"; |
| 159 cashew::CleanUpForExit(); | 159 cashew::CleanUpForExit(); |
| 160 exit(EXIT_SUCCESS); | 160 exit(EXIT_SUCCESS); |
| 161 } | 161 } |
| OLD | NEW |