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

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

Issue 11862010: Fix WebDataRequest ownership gap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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
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__
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 friend class TemplateURLServiceTest; 320 friend class TemplateURLServiceTest;
321 friend class TemplateURLServiceTestingProfile; 321 friend class TemplateURLServiceTestingProfile;
322 friend class WebDataServiceTest; 322 friend class WebDataServiceTest;
323 friend class WebDataRequest; 323 friend class WebDataRequest;
324 324
325 virtual ~WebDataService(); 325 virtual ~WebDataService();
326 326
327 // This is invoked by the unit test; path is the path of the Web Data file. 327 // This is invoked by the unit test; path is the path of the Web Data file.
328 bool InitWithPath(const FilePath& path); 328 bool InitWithPath(const FilePath& path);
329 329
330 // Invoked by request implementations when a request has been processed.
331 void RequestCompleted(Handle h);
332
333 ////////////////////////////////////////////////////////////////////////////// 330 //////////////////////////////////////////////////////////////////////////////
334 // 331 //
335 // The following methods are only invoked in the web data service thread. 332 // The following methods are only invoked in the web data service thread.
336 // 333 //
337 ////////////////////////////////////////////////////////////////////////////// 334 //////////////////////////////////////////////////////////////////////////////
338 private: 335 private:
339 friend struct content::BrowserThread::DeleteOnThread< 336 friend struct content::BrowserThread::DeleteOnThread<
340 content::BrowserThread::UI>; 337 content::BrowserThread::UI>;
341 friend class base::DeleteHelper<WebDataService>; 338 friend class base::DeleteHelper<WebDataService>;
342 339
(...skipping 24 matching lines...) Expand all
367 364
368 void ScheduleDBTask(const tracked_objects::Location& from_here, 365 void ScheduleDBTask(const tracked_objects::Location& from_here,
369 const base::Closure& task); 366 const base::Closure& task);
370 367
371 WebDataService::Handle ScheduleDBTaskWithResult( 368 WebDataService::Handle ScheduleDBTaskWithResult(
372 const tracked_objects::Location& from_here, 369 const tracked_objects::Location& from_here,
373 const ResultTask& task, 370 const ResultTask& task,
374 WebDataServiceConsumer* consumer); 371 WebDataServiceConsumer* consumer);
375 372
376 void DBTaskWrapper(const base::Closure& task, 373 void DBTaskWrapper(const base::Closure& task,
377 WebDataRequest* request); 374 scoped_ptr<WebDataRequest> request);
378 375
379 void DBResultTaskWrapper(const ResultTask& task, 376 void DBResultTaskWrapper(const ResultTask& task,
380 WebDataRequest* request); 377 scoped_ptr<WebDataRequest> request);
381 378
382 // Schedule a commit if one is not already pending. 379 // Schedule a commit if one is not already pending.
383 void ScheduleCommit(); 380 void ScheduleCommit();
384 381
385 ////////////////////////////////////////////////////////////////////////////// 382 //////////////////////////////////////////////////////////////////////////////
386 // 383 //
387 // Keywords. 384 // Keywords.
388 // 385 //
389 ////////////////////////////////////////////////////////////////////////////// 386 //////////////////////////////////////////////////////////////////////////////
390 void AddKeywordImpl(const TemplateURLData& data); 387 void AddKeywordImpl(const TemplateURLData& data);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 // Whether we should commit the database. 508 // Whether we should commit the database.
512 bool should_commit_; 509 bool should_commit_;
513 510
514 // MessageLoop the WebDataService is created on. 511 // MessageLoop the WebDataService is created on.
515 MessageLoop* main_loop_; 512 MessageLoop* main_loop_;
516 513
517 DISALLOW_COPY_AND_ASSIGN(WebDataService); 514 DISALLOW_COPY_AND_ASSIGN(WebDataService);
518 }; 515 };
519 516
520 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ 517 #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698