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

Side by Side Diff: chrome/browser/webdata/web_database_service.h

Issue 13191007: Pass app_locale directly to AutofillTable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Chrome frame tests fix Created 7 years, 8 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
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 // Chromium settings and storage represent user-selected preferences and 5 // Chromium settings and storage represent user-selected preferences and
6 // information and MUST not be extracted, overwritten or modified except 6 // information and MUST not be extracted, overwritten or modified except
7 // through Chromium defined APIs. 7 // through Chromium defined APIs.
8 8
9 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATABASE_SERVICE_H_ 9 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATABASE_SERVICE_H_
10 #define CHROME_BROWSER_WEBDATA_WEB_DATABASE_SERVICE_H_ 10 #define CHROME_BROWSER_WEBDATA_WEB_DATABASE_SERVICE_H_
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 class WebDatabaseService 44 class WebDatabaseService
45 : public base::RefCountedThreadSafe< 45 : public base::RefCountedThreadSafe<
46 WebDatabaseService, 46 WebDatabaseService,
47 content::BrowserThread::DeleteOnUIThread> { 47 content::BrowserThread::DeleteOnUIThread> {
48 public: 48 public:
49 typedef base::Callback<scoped_ptr<WDTypedResult>(WebDatabase*)> ReadTask; 49 typedef base::Callback<scoped_ptr<WDTypedResult>(WebDatabase*)> ReadTask;
50 typedef base::Callback<WebDatabase::State(WebDatabase*)> WriteTask; 50 typedef base::Callback<WebDatabase::State(WebDatabase*)> WriteTask;
51 typedef base::Callback<void(sql::InitStatus)> InitCallback; 51 typedef base::Callback<void(sql::InitStatus)> InitCallback;
52 52
53 // Takes the path to the WebDatabase file, and the locale (for migration 53 // Takes the path to the WebDatabase file.
54 // purposes). 54 explicit WebDatabaseService(const base::FilePath& path);
55 explicit WebDatabaseService(
56 const base::FilePath& path, const std::string app_locale);
57 55
58 // Adds |table| as a WebDatabaseTable that will participate in 56 // Adds |table| as a WebDatabaseTable that will participate in
59 // managing the database, transferring ownership. All calls to this 57 // managing the database, transferring ownership. All calls to this
60 // method must be made before |LoadDatabase| is called. 58 // method must be made before |LoadDatabase| is called.
61 virtual void AddTable(scoped_ptr<WebDatabaseTable> table); 59 virtual void AddTable(scoped_ptr<WebDatabaseTable> table);
62 60
63 // Initializes the web database service. Takes a callback which will return 61 // Initializes the web database service. Takes a callback which will return
64 // the status of the DB after the init. 62 // the status of the DB after the init.
65 virtual void LoadDatabase(const InitCallback& callback); 63 virtual void LoadDatabase(const InitCallback& callback);
66 64
(...skipping 26 matching lines...) Expand all
93 91
94 private: 92 private:
95 friend struct content::BrowserThread::DeleteOnThread< 93 friend struct content::BrowserThread::DeleteOnThread<
96 content::BrowserThread::UI>; 94 content::BrowserThread::UI>;
97 friend class base::DeleteHelper<WebDatabaseService>; 95 friend class base::DeleteHelper<WebDatabaseService>;
98 96
99 virtual ~WebDatabaseService(); 97 virtual ~WebDatabaseService();
100 98
101 base::FilePath path_; 99 base::FilePath path_;
102 100
103 // The application locale. The locale is needed for some database migrations,
104 // and must be read on the UI thread. It's cached here so that we can pass it
105 // to the migration code on the DB thread.
106 std::string app_locale_;
107
108 // The primary owner is |WebDatabaseService| but is refcounted because 101 // The primary owner is |WebDatabaseService| but is refcounted because
109 // PostTask on DB thread may outlive us. 102 // PostTask on DB thread may outlive us.
110 scoped_refptr<WebDataServiceBackend> wds_backend_; 103 scoped_refptr<WebDataServiceBackend> wds_backend_;
111 }; 104 };
112 105
113 #endif // CHROME_BROWSER_WEBDATA_WEB_DATABASE_SERVICE_H_ 106 #endif // CHROME_BROWSER_WEBDATA_WEB_DATABASE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/webdata/web_database_migration_unittest.cc ('k') | chrome/browser/webdata/web_database_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698