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

Side by Side Diff: chrome/browser/mac/install_from_dmg.mm

Issue 1223983002: Move WriteInto to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/mac/install_from_dmg.h" 5 #include "chrome/browser/mac/install_from_dmg.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 #include <ApplicationServices/ApplicationServices.h> 8 #include <ApplicationServices/ApplicationServices.h>
9 #include <CoreFoundation/CoreFoundation.h> 9 #include <CoreFoundation/CoreFoundation.h>
10 #include <CoreServices/CoreServices.h> 10 #include <CoreServices/CoreServices.h>
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return true; 141 return true;
142 } 142 }
143 143
144 CFDataRef image_path_data = static_cast<CFDataRef>( 144 CFDataRef image_path_data = static_cast<CFDataRef>(
145 image_path_cftyperef.get()); 145 image_path_cftyperef.get());
146 CFIndex length = CFDataGetLength(image_path_data); 146 CFIndex length = CFDataGetLength(image_path_data);
147 if (length <= 0) { 147 if (length <= 0) {
148 LOG(ERROR) << "image_path_data is unexpectedly empty"; 148 LOG(ERROR) << "image_path_data is unexpectedly empty";
149 return true; 149 return true;
150 } 150 }
151 char* image_path_c = WriteInto(image_path, length + 1); 151 char* image_path_c = base::WriteInto(image_path, length + 1);
152 CFDataGetBytes(image_path_data, 152 CFDataGetBytes(image_path_data,
153 CFRangeMake(0, length), 153 CFRangeMake(0, length),
154 reinterpret_cast<UInt8*>(image_path_c)); 154 reinterpret_cast<UInt8*>(image_path_c));
155 } 155 }
156 156
157 return true; 157 return true;
158 } 158 }
159 159
160 // Returns true if |path| is located on a read-only filesystem of a disk 160 // Returns true if |path| is located on a read-only filesystem of a disk
161 // image. Returns false if not, or in the event of an error. If 161 // image. Returns false if not, or in the event of an error. If
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 const UInt8* trash_path_u8 = reinterpret_cast<const UInt8*>( 678 const UInt8* trash_path_u8 = reinterpret_cast<const UInt8*>(
679 trash_path.value().c_str()); 679 trash_path.value().c_str());
680 status = FNNotifyByPath(trash_path_u8, 680 status = FNNotifyByPath(trash_path_u8,
681 kFNDirectoryModifiedMessage, 681 kFNDirectoryModifiedMessage,
682 kNilOptions); 682 kNilOptions);
683 if (status != noErr) { 683 if (status != noErr) {
684 OSSTATUS_LOG(ERROR, status) << "FNNotifyByPath"; 684 OSSTATUS_LOG(ERROR, status) << "FNNotifyByPath";
685 return; 685 return;
686 } 686 }
687 } 687 }
OLDNEW
« no previous file with comments | « chrome/browser/internal_auth.cc ('k') | chrome/browser/media_galleries/win/mtp_device_operations_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698