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

Side by Side Diff: components/webdata/common/web_database_backend.cc

Issue 2591963004: Transform RefCountedDeleteOnMessageLoop to RefCountedDeleteOnSequence. (Closed)
Patch Set: similarity Created 3 years, 12 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
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 #include "components/webdata/common/web_database_backend.h" 5 #include "components/webdata/common/web_database_backend.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "components/webdata/common/web_data_request_manager.h" 12 #include "components/webdata/common/web_data_request_manager.h"
13 #include "components/webdata/common/web_database.h" 13 #include "components/webdata/common/web_database.h"
14 #include "components/webdata/common/web_database_table.h" 14 #include "components/webdata/common/web_database_table.h"
15 #include "sql/error_delegate_util.h" 15 #include "sql/error_delegate_util.h"
16 16
17 using base::Bind; 17 using base::Bind;
18 using base::FilePath; 18 using base::FilePath;
19 19
20 WebDatabaseBackend::WebDatabaseBackend( 20 WebDatabaseBackend::WebDatabaseBackend(
21 const FilePath& path, 21 const FilePath& path,
22 Delegate* delegate, 22 Delegate* delegate,
23 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread) 23 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread)
24 : base::RefCountedDeleteOnMessageLoop<WebDatabaseBackend>(db_thread), 24 : base::RefCountedDeleteOnSequence<WebDatabaseBackend>(db_thread),
25 db_path_(path), 25 db_path_(path),
26 request_manager_(new WebDataRequestManager()), 26 request_manager_(new WebDataRequestManager()),
27 init_status_(sql::INIT_FAILURE), 27 init_status_(sql::INIT_FAILURE),
28 init_complete_(false), 28 init_complete_(false),
29 catastrophic_error_occurred_(false), 29 catastrophic_error_occurred_(false),
30 delegate_(delegate) {} 30 delegate_(delegate) {}
31 31
32 void WebDatabaseBackend::AddTable(std::unique_ptr<WebDatabaseTable> table) { 32 void WebDatabaseBackend::AddTable(std::unique_ptr<WebDatabaseTable> table) {
33 DCHECK(!db_.get()); 33 DCHECK(!db_.get());
34 tables_.push_back(table.release()); 34 tables_.push_back(table.release());
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 db_->GetSQLConnection()->RazeAndClose(); 135 db_->GetSQLConnection()->RazeAndClose();
136 } 136 }
137 } 137 }
138 138
139 void WebDatabaseBackend::Commit() { 139 void WebDatabaseBackend::Commit() {
140 DCHECK(db_); 140 DCHECK(db_);
141 DCHECK_EQ(sql::INIT_OK, init_status_); 141 DCHECK_EQ(sql::INIT_OK, init_status_);
142 db_->CommitTransaction(); 142 db_->CommitTransaction();
143 db_->BeginTransaction(); 143 db_->BeginTransaction();
144 } 144 }
OLDNEW
« no previous file with comments | « components/webdata/common/web_database_backend.h ('k') | components/webdata/common/web_database_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698