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

Side by Side Diff: webkit/database/database_tracker.cc

Issue 3056029: Move the number conversions from string_util to a new file.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « webkit/appcache/appcache_disk_cache.cc ('k') | webkit/glue/dom_operations.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/database/database_tracker.h" 5 #include "webkit/database/database_tracker.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/sql/connection.h" 9 #include "app/sql/connection.h"
10 #include "app/sql/diagnostic_error_delegate.h" 10 #include "app/sql/diagnostic_error_delegate.h"
11 #include "app/sql/meta_table.h" 11 #include "app/sql/meta_table.h"
12 #include "app/sql/statement.h" 12 #include "app/sql/statement.h"
13 #include "app/sql/transaction.h" 13 #include "app/sql/transaction.h"
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "base/file_util.h" 15 #include "base/file_util.h"
16 #include "base/string_util.h" 16 #include "base/string_number_conversions.h"
17 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
18 #include "net/base/net_errors.h" 18 #include "net/base/net_errors.h"
19 #include "webkit/database/databases_table.h" 19 #include "webkit/database/databases_table.h"
20 #include "webkit/database/quota_table.h" 20 #include "webkit/database/quota_table.h"
21 21
22 namespace { 22 namespace {
23 23
24 class HistogramUniquifier { 24 class HistogramUniquifier {
25 public: 25 public:
26 static const char* name() { return "Sqlite.DatabaseTracker.Error"; } 26 static const char* name() { return "Sqlite.DatabaseTracker.Error"; }
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 const string16& origin_identifier) { 189 const string16& origin_identifier) {
190 if (!is_incognito_) 190 if (!is_incognito_)
191 return origin_identifier; 191 return origin_identifier;
192 192
193 OriginDirectoriesMap::const_iterator it = 193 OriginDirectoriesMap::const_iterator it =
194 incognito_origin_directories_.find(origin_identifier); 194 incognito_origin_directories_.find(origin_identifier);
195 if (it != incognito_origin_directories_.end()) 195 if (it != incognito_origin_directories_.end())
196 return it->second; 196 return it->second;
197 197
198 string16 origin_directory = 198 string16 origin_directory =
199 IntToString16(incognito_origin_directories_generator_++); 199 base::IntToString16(incognito_origin_directories_generator_++);
200 incognito_origin_directories_[origin_identifier] = origin_directory; 200 incognito_origin_directories_[origin_identifier] = origin_directory;
201 return origin_directory; 201 return origin_directory;
202 } 202 }
203 203
204 FilePath DatabaseTracker::GetFullDBFilePath( 204 FilePath DatabaseTracker::GetFullDBFilePath(
205 const string16& origin_identifier, 205 const string16& origin_identifier,
206 const string16& database_name) { 206 const string16& database_name) {
207 DCHECK(!origin_identifier.empty()); 207 DCHECK(!origin_identifier.empty());
208 DCHECK(!database_name.empty()); 208 DCHECK(!database_name.empty());
209 if (!LazyInit()) 209 if (!LazyInit())
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 file_path = file_enumerator.Next()) { 678 file_path = file_enumerator.Next()) {
679 if (file_path.BaseName() != FilePath(kTrackerDatabaseFileName)) { 679 if (file_path.BaseName() != FilePath(kTrackerDatabaseFileName)) {
680 if (!StartsWith(file_path.BaseName().ToWStringHack(), 680 if (!StartsWith(file_path.BaseName().ToWStringHack(),
681 ASCIIToWide(kExtensionOriginIdentifierPrefix), true)) 681 ASCIIToWide(kExtensionOriginIdentifierPrefix), true))
682 file_util::Delete(file_path, true); 682 file_util::Delete(file_path, true);
683 } 683 }
684 } 684 }
685 } 685 }
686 686
687 } // namespace webkit_database 687 } // namespace webkit_database
OLDNEW
« no previous file with comments | « webkit/appcache/appcache_disk_cache.cc ('k') | webkit/glue/dom_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698