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

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

Issue 16154031: Un-refcount AutofillWebData and TokenWebData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on ToT Created 7 years, 6 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 (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 // 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_DATA_SERVICE_H__ 9 #ifndef CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__
10 #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ 10 #define CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__
11 11
12 #include <map> 12 #include <map>
13 #include <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/callback_forward.h" 16 #include "base/callback_forward.h"
17 #include "base/files/file_path.h" 17 #include "base/files/file_path.h"
18 #include "base/location.h" 18 #include "base/location.h"
19 #include "base/memory/ref_counted.h" 19 #include "base/memory/ref_counted.h"
20 #include "base/sequenced_task_runner_helpers.h" 20 #include "base/sequenced_task_runner_helpers.h"
21 #include "chrome/browser/search_engines/template_url.h" 21 #include "chrome/browser/search_engines/template_url.h"
22 #include "chrome/browser/search_engines/template_url_id.h" 22 #include "chrome/browser/search_engines/template_url_id.h"
23 #include "chrome/browser/webdata/keyword_table.h" 23 #include "chrome/browser/webdata/keyword_table.h"
24 #include "components/webdata/common/web_data_results.h" 24 #include "components/webdata/common/web_data_results.h"
25 #include "components/webdata/common/web_data_service_base.h" 25 #include "components/webdata/common/web_data_service_base.h"
26 #include "components/webdata/common/web_data_service_consumer.h" 26 #include "components/webdata/common/web_data_service_consumer.h"
27 #include "components/webdata/common/web_database.h" 27 #include "components/webdata/common/web_database.h"
28 #include "content/public/browser/browser_thread.h"
28 29
29 struct DefaultWebIntentService; 30 struct DefaultWebIntentService;
30 class GURL; 31 class GURL;
31 #if defined(OS_WIN) 32 #if defined(OS_WIN)
32 struct IE7PasswordInfo; 33 struct IE7PasswordInfo;
33 #endif 34 #endif
34 class Profile; 35 class Profile;
35 class SkBitmap; 36 class SkBitmap;
36 class WebDatabaseService; 37 class WebDatabaseService;
37 38
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 KeywordTable::Keywords keywords; 85 KeywordTable::Keywords keywords;
85 // Identifies the ID of the TemplateURL that is the default search. A value of 86 // Identifies the ID of the TemplateURL that is the default search. A value of
86 // 0 indicates there is no default search provider. 87 // 0 indicates there is no default search provider.
87 int64 default_search_provider_id; 88 int64 default_search_provider_id;
88 // Version of the built-in keywords. A value of 0 indicates a first run. 89 // Version of the built-in keywords. A value of 0 indicates a first run.
89 int builtin_keyword_version; 90 int builtin_keyword_version;
90 }; 91 };
91 92
92 class WebDataServiceConsumer; 93 class WebDataServiceConsumer;
93 94
94 class WebDataService : public WebDataServiceBase { 95 class WebDataService : public WebDataServiceBase,
96 public base::RefCountedThreadSafe<WebDataService,
97 content::BrowserThread::DeleteOnUIThread> {
95 public: 98 public:
96 // Retrieve a WebDataService for the given context. 99 // Retrieve a WebDataService for the given context.
97 static scoped_refptr<WebDataService> FromBrowserContext( 100 static scoped_refptr<WebDataService> FromBrowserContext(
98 content::BrowserContext* context); 101 content::BrowserContext* context);
99 102
100 WebDataService(scoped_refptr<WebDatabaseService> wdbs, 103 WebDataService(scoped_refptr<WebDatabaseService> wdbs,
101 const ProfileErrorCallback& callback); 104 const ProfileErrorCallback& callback);
102 105
103 ////////////////////////////////////////////////////////////////////////////// 106 //////////////////////////////////////////////////////////////////////////////
104 // 107 //
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 WebDataServiceConsumer* consumer); 219 WebDataServiceConsumer* consumer);
217 #endif // defined(OS_WIN) 220 #endif // defined(OS_WIN)
218 221
219 protected: 222 protected:
220 // For unit tests, passes a null callback. 223 // For unit tests, passes a null callback.
221 WebDataService(); 224 WebDataService();
222 225
223 virtual ~WebDataService(); 226 virtual ~WebDataService();
224 227
225 private: 228 private:
229 friend struct content::BrowserThread::DeleteOnThread<
230 content::BrowserThread::UI>;
231 friend class base::DeleteHelper<WebDataService>;
232 // We have to friend RCTS<> so WIN shared-lib build is happy (crbug/112250).
233 friend class base::RefCountedThreadSafe<WebDataService,
234 content::BrowserThread::DeleteOnUIThread>;
226 ////////////////////////////////////////////////////////////////////////////// 235 //////////////////////////////////////////////////////////////////////////////
227 // 236 //
228 // The following methods are only invoked on the DB thread. 237 // The following methods are only invoked on the DB thread.
229 // 238 //
230 ////////////////////////////////////////////////////////////////////////////// 239 //////////////////////////////////////////////////////////////////////////////
231 240
232 ////////////////////////////////////////////////////////////////////////////// 241 //////////////////////////////////////////////////////////////////////////////
233 // 242 //
234 // Keywords. 243 // Keywords.
235 // 244 //
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 WebDatabase::State RemoveIE7LoginImpl( 304 WebDatabase::State RemoveIE7LoginImpl(
296 const IE7PasswordInfo& info, WebDatabase* db); 305 const IE7PasswordInfo& info, WebDatabase* db);
297 scoped_ptr<WDTypedResult> GetIE7LoginImpl( 306 scoped_ptr<WDTypedResult> GetIE7LoginImpl(
298 const IE7PasswordInfo& info, WebDatabase* db); 307 const IE7PasswordInfo& info, WebDatabase* db);
299 #endif // defined(OS_WIN) 308 #endif // defined(OS_WIN)
300 309
301 DISALLOW_COPY_AND_ASSIGN(WebDataService); 310 DISALLOW_COPY_AND_ASSIGN(WebDataService);
302 }; 311 };
303 312
304 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ 313 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__
OLDNEW
« no previous file with comments | « chrome/browser/webdata/token_web_data.cc ('k') | chrome/browser/webdata/web_data_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698