OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
6 #include <tr1/memory> | 6 #include <tr1/memory> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include <gflags/gflags.h> | 9 #include <gflags/gflags.h> |
10 #include <glib.h> | 10 #include <glib.h> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return; | 53 return; |
54 } | 54 } |
55 | 55 |
56 if (utils::IsRemovableDevice(utils::RootDevice(utils::BootDevice()))) { | 56 if (utils::IsRemovableDevice(utils::RootDevice(utils::BootDevice()))) { |
57 LOG(WARNING) << "Removable device boot: periodic update checks disabled."; | 57 LOG(WARNING) << "Removable device boot: periodic update checks disabled."; |
58 return; | 58 return; |
59 } | 59 } |
60 | 60 |
61 // Kick off periodic updating. First, update after 2 minutes. Also, update | 61 // Kick off periodic updating. First, update after 2 minutes. Also, update |
62 // every 30 minutes. | 62 // every 30 minutes. |
63 g_timeout_add(2 * 60 * 1000, &UpdateOnce, update_attempter); | 63 g_timeout_add_seconds(2 * 60, &UpdateOnce, update_attempter); |
64 g_timeout_add(30 * 60 * 1000, &UpdatePeriodically, update_attempter); | 64 g_timeout_add_seconds(30 * 60, &UpdatePeriodically, update_attempter); |
65 } | 65 } |
66 | 66 |
67 void SetupDbusService(UpdateEngineService* service) { | 67 void SetupDbusService(UpdateEngineService* service) { |
68 DBusGConnection *bus; | 68 DBusGConnection *bus; |
69 DBusGProxy *proxy; | 69 DBusGProxy *proxy; |
70 GError *error = NULL; | 70 GError *error = NULL; |
71 | 71 |
72 bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error); | 72 bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error); |
73 if (!bus) { | 73 if (!bus) { |
74 LOG(FATAL) << "Failed to get bus"; | 74 LOG(FATAL) << "Failed to get bus"; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 g_main_loop_run(loop); | 151 g_main_loop_run(loop); |
152 | 152 |
153 // Cleanup: | 153 // Cleanup: |
154 g_main_loop_unref(loop); | 154 g_main_loop_unref(loop); |
155 update_attempter.set_dbus_service(NULL); | 155 update_attempter.set_dbus_service(NULL); |
156 g_object_unref(G_OBJECT(service)); | 156 g_object_unref(G_OBJECT(service)); |
157 | 157 |
158 LOG(INFO) << "Chrome OS Update Engine terminating"; | 158 LOG(INFO) << "Chrome OS Update Engine terminating"; |
159 return 0; | 159 return 0; |
160 } | 160 } |
OLD | NEW |