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

Side by Side Diff: remoting/host/setup/daemon_controller_delegate_mac.mm

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/json_host_config_unittest.cc ('k') | skia/ext/image_operations_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <CoreFoundation/CoreFoundation.h> 5 #include <CoreFoundation/CoreFoundation.h>
6 6
7 #include "remoting/host/setup/daemon_controller_delegate_mac.h" 7 #include "remoting/host/setup/daemon_controller_delegate_mac.h"
8 8
9 #include <launch.h> 9 #include <launch.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 bool DaemonControllerDelegateMac::DoShowPreferencePane( 223 bool DaemonControllerDelegateMac::DoShowPreferencePane(
224 const std::string& config_data) { 224 const std::string& config_data) {
225 if (!config_data.empty()) { 225 if (!config_data.empty()) {
226 base::FilePath config_path; 226 base::FilePath config_path;
227 if (!base::GetTempDir(&config_path)) { 227 if (!base::GetTempDir(&config_path)) {
228 LOG(ERROR) << "Failed to get filename for saving configuration data."; 228 LOG(ERROR) << "Failed to get filename for saving configuration data.";
229 return false; 229 return false;
230 } 230 }
231 config_path = config_path.Append(kHostConfigFileName); 231 config_path = config_path.Append(kHostConfigFileName);
232 232
233 int written = file_util::WriteFile(config_path, config_data.data(), 233 int written = base::WriteFile(config_path, config_data.data(),
234 config_data.size()); 234 config_data.size());
235 if (written != static_cast<int>(config_data.size())) { 235 if (written != static_cast<int>(config_data.size())) {
236 LOG(ERROR) << "Failed to save configuration data to: " 236 LOG(ERROR) << "Failed to save configuration data to: "
237 << config_path.value(); 237 << config_path.value();
238 return false; 238 return false;
239 } 239 }
240 } 240 }
241 241
242 base::FilePath pane_path; 242 base::FilePath pane_path;
243 // TODO(lambroslambrou): Use NSPreferencePanesDirectory once we start 243 // TODO(lambroslambrou): Use NSPreferencePanesDirectory once we start
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 self->PreferencePaneCallbackDelegate(name); 286 self->PreferencePaneCallbackDelegate(name);
287 } 287 }
288 288
289 scoped_refptr<DaemonController> DaemonController::Create() { 289 scoped_refptr<DaemonController> DaemonController::Create() {
290 scoped_ptr<DaemonController::Delegate> delegate( 290 scoped_ptr<DaemonController::Delegate> delegate(
291 new DaemonControllerDelegateMac()); 291 new DaemonControllerDelegateMac());
292 return new DaemonController(delegate.Pass()); 292 return new DaemonController(delegate.Pass());
293 } 293 }
294 294
295 } // namespace remoting 295 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/json_host_config_unittest.cc ('k') | skia/ext/image_operations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698