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

Side by Side Diff: chrome/browser/bookmarks/bookmark_storage.cc

Issue 18332014: Move Copy* into the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: windows Created 7 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 | Annotate | Revision Log
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | chrome/browser/chromeos/drive/file_cache.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) 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/bookmarks/bookmark_storage.h" 5 #include "chrome/browser/bookmarks/bookmark_storage.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 15 matching lines...) Expand all
26 namespace { 26 namespace {
27 27
28 // Extension used for backup files (copy of main file created during startup). 28 // Extension used for backup files (copy of main file created during startup).
29 const base::FilePath::CharType kBackupExtension[] = FILE_PATH_LITERAL("bak"); 29 const base::FilePath::CharType kBackupExtension[] = FILE_PATH_LITERAL("bak");
30 30
31 // How often we save. 31 // How often we save.
32 const int kSaveDelayMS = 2500; 32 const int kSaveDelayMS = 2500;
33 33
34 void BackupCallback(const base::FilePath& path) { 34 void BackupCallback(const base::FilePath& path) {
35 base::FilePath backup_path = path.ReplaceExtension(kBackupExtension); 35 base::FilePath backup_path = path.ReplaceExtension(kBackupExtension);
36 file_util::CopyFile(path, backup_path); 36 base::CopyFile(path, backup_path);
37 } 37 }
38 38
39 // Adds node to the model's index, recursing through all children as well. 39 // Adds node to the model's index, recursing through all children as well.
40 void AddBookmarksToIndex(BookmarkLoadDetails* details, 40 void AddBookmarksToIndex(BookmarkLoadDetails* details,
41 BookmarkNode* node) { 41 BookmarkNode* node) {
42 if (node->is_url()) { 42 if (node->is_url()) {
43 if (node->url().is_valid()) 43 if (node->url().is_valid())
44 details->index()->Add(node); 44 details->index()->Add(node);
45 } else { 45 } else {
46 for (int i = 0; i < node->child_count(); ++i) 46 for (int i = 0; i < node->child_count(); ++i)
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 NOTREACHED(); 173 NOTREACHED();
174 return false; 174 return false;
175 } 175 }
176 176
177 std::string data; 177 std::string data;
178 if (!SerializeData(&data)) 178 if (!SerializeData(&data))
179 return false; 179 return false;
180 writer_.WriteNow(data); 180 writer_.WriteNow(data);
181 return true; 181 return true;
182 } 182 }
OLDNEW
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | chrome/browser/chromeos/drive/file_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698