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

Side by Side Diff: chrome/tools/profiles/generate_profile.cc

Issue 6019007: Remove win_util::FormatMessage and FormatLastWin32Error. These were only used... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « chrome/default_plugin/plugin_impl_win.h ('k') | chrome_frame/test/chrome_frame_test_utils.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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // This program generates a user profile and history by randomly generating 5 // This program generates a user profile and history by randomly generating
6 // data and feeding it to the history service. 6 // data and feeding it to the history service.
7 7
8 #include "chrome/tools/profiles/thumbnail-inl.h" 8 #include "chrome/tools/profiles/thumbnail-inl.h"
9 9
10 #include "app/app_paths.h" 10 #include "app/app_paths.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 int url_count = 0; 220 int url_count = 0;
221 base::StringToInt(WideToUTF8(cl->args()[0]), &url_count); 221 base::StringToInt(WideToUTF8(cl->args()[0]), &url_count);
222 FilePath dst_dir(cl->args()[1]); 222 FilePath dst_dir(cl->args()[1]);
223 if (!dst_dir.IsAbsolute()) { 223 if (!dst_dir.IsAbsolute()) {
224 FilePath current_dir; 224 FilePath current_dir;
225 file_util::GetCurrentDirectory(&current_dir); 225 file_util::GetCurrentDirectory(&current_dir);
226 dst_dir = current_dir.Append(dst_dir); 226 dst_dir = current_dir.Append(dst_dir);
227 } 227 }
228 if (!file_util::CreateDirectory(dst_dir)) { 228 if (!file_util::CreateDirectory(dst_dir)) {
229 printf("Unable to create directory %ls: %ls\n", 229 printf("Unable to create directory %ls: %d\n",
230 dst_dir.value().c_str(), 230 dst_dir.value().c_str(),
231 win_util::FormatLastWin32Error().c_str()); 231 ::GetLastError());
232 } 232 }
233 233
234 icu_util::Initialize(); 234 icu_util::Initialize();
235 235
236 chrome::RegisterPathProvider(); 236 chrome::RegisterPathProvider();
237 app::RegisterPathProvider(); 237 app::RegisterPathProvider();
238 ResourceBundle::InitSharedInstance("en-US"); 238 ResourceBundle::InitSharedInstance("en-US");
239 NotificationService notification_service; 239 NotificationService notification_service;
240 MessageLoopForUI message_loop; 240 MessageLoopForUI message_loop;
241 BrowserThread ui_thread(BrowserThread::UI, &message_loop); 241 BrowserThread ui_thread(BrowserThread::UI, &message_loop);
(...skipping 29 matching lines...) Expand all
271 profile.GetPath(), false, 271 profile.GetPath(), false,
272 static_cast<file_util::FileEnumerator::FILE_TYPE>( 272 static_cast<file_util::FileEnumerator::FILE_TYPE>(
273 file_util::FileEnumerator::FILES)); 273 file_util::FileEnumerator::FILES));
274 FilePath path = file_iterator.Next(); 274 FilePath path = file_iterator.Next();
275 while (!path.empty()) { 275 while (!path.empty()) {
276 FilePath dst_file = dst_dir.Append(path.BaseName()); 276 FilePath dst_file = dst_dir.Append(path.BaseName());
277 file_util::Delete(dst_file, false); 277 file_util::Delete(dst_file, false);
278 printf("Copying file %ls to %ls\n", path.value().c_str(), 278 printf("Copying file %ls to %ls\n", path.value().c_str(),
279 dst_file.value().c_str()); 279 dst_file.value().c_str());
280 if (!file_util::CopyFile(path, dst_file)) { 280 if (!file_util::CopyFile(path, dst_file)) {
281 printf("Copying file failed: %ls\n", 281 printf("Copying file failed: %d\n", ::GetLastError());
282 win_util::FormatLastWin32Error().c_str());
283 return -1; 282 return -1;
284 } 283 }
285 path = file_iterator.Next(); 284 path = file_iterator.Next();
286 } 285 }
287 286
288 return 0; 287 return 0;
289 } 288 }
OLDNEW
« no previous file with comments | « chrome/default_plugin/plugin_impl_win.h ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698