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

Side by Side Diff: dbus_service.cc

Issue 4097004: Use g_strdup() instead of strdup(). (Closed) Base URL: http://git.chromium.org/git/update_engine.git
Patch Set: Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 (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 "update_engine/dbus_service.h" 5 #include "update_engine/dbus_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include <base/logging.h> 9 #include <base/logging.h>
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 GError **error) { 83 GError **error) {
84 string current_op; 84 string current_op;
85 string new_version_str; 85 string new_version_str;
86 86
87 CHECK(self->update_attempter_->GetStatus(last_checked_time, 87 CHECK(self->update_attempter_->GetStatus(last_checked_time,
88 progress, 88 progress,
89 &current_op, 89 &current_op,
90 &new_version_str, 90 &new_version_str,
91 new_size)); 91 new_size));
92 92
93 *current_operation = strdup(current_op.c_str()); 93 *current_operation = g_strdup(current_op.c_str());
94 *new_version = strdup(new_version_str.c_str()); 94 *new_version = g_strdup(new_version_str.c_str());
95 if (!(*current_operation && *new_version)) { 95 if (!(*current_operation && *new_version)) {
96 *error = NULL; 96 *error = NULL;
97 return FALSE; 97 return FALSE;
98 } 98 }
99 return TRUE; 99 return TRUE;
100 } 100 }
101 101
102 gboolean update_engine_service_get_track(UpdateEngineService* self, 102 gboolean update_engine_service_get_track(UpdateEngineService* self,
103 gchar** track, 103 gchar** track,
104 GError **error) { 104 GError **error) {
105 string track_str = 105 string track_str =
106 chromeos_update_engine::OmahaRequestDeviceParams::GetDeviceTrack(); 106 chromeos_update_engine::OmahaRequestDeviceParams::GetDeviceTrack();
107 *track = strdup(track_str.c_str()); 107 *track = g_strdup(track_str.c_str());
108 return TRUE; 108 return TRUE;
109 } 109 }
110 110
111 gboolean update_engine_service_reboot_if_needed(UpdateEngineService* self, 111 gboolean update_engine_service_reboot_if_needed(UpdateEngineService* self,
112 GError **error) { 112 GError **error) {
113 if (!self->update_attempter_->RebootIfNeeded()) { 113 if (!self->update_attempter_->RebootIfNeeded()) {
114 *error = NULL; 114 *error = NULL;
115 return FALSE; 115 return FALSE;
116 } 116 }
117 return TRUE; 117 return TRUE;
(...skipping 23 matching lines...) Expand all
141 g_signal_emit(self, 141 g_signal_emit(self,
142 status_update_signal, 142 status_update_signal,
143 0, 143 0,
144 last_checked_time, 144 last_checked_time,
145 progress, 145 progress,
146 current_operation, 146 current_operation,
147 new_version, 147 new_version,
148 new_size); 148 new_size);
149 return TRUE; 149 return TRUE;
150 } 150 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698