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

Side by Side Diff: net/extras/sqlite/sqlite_channel_id_store.cc

Issue 1076063002: Remove certificates from Channel ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "net/extras/sqlite/sqlite_channel_id_store.h" 5 #include "net/extras/sqlite/sqlite_channel_id_store.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/scoped_vector.h" 16 #include "base/memory/scoped_vector.h"
17 #include "base/metrics/histogram.h" 17 #include "base/metrics/histogram.h"
18 #include "base/sequenced_task_runner.h" 18 #include "base/sequenced_task_runner.h"
19 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
20 #include "crypto/ec_private_key.h"
21 #include "net/cert/asn1_util.h"
20 #include "net/cert/x509_certificate.h" 22 #include "net/cert/x509_certificate.h"
21 #include "net/cookies/cookie_util.h" 23 #include "net/cookies/cookie_util.h"
24 #include "net/ssl/channel_id_service.h"
22 #include "net/ssl/ssl_client_cert_type.h" 25 #include "net/ssl/ssl_client_cert_type.h"
23 #include "sql/error_delegate_util.h" 26 #include "sql/error_delegate_util.h"
24 #include "sql/meta_table.h" 27 #include "sql/meta_table.h"
25 #include "sql/statement.h" 28 #include "sql/statement.h"
26 #include "sql/transaction.h" 29 #include "sql/transaction.h"
27 #include "url/gurl.h" 30 #include "url/gurl.h"
28 31
29 namespace { 32 namespace {
30 33
31 // Version number of the database. 34 // Version number of the database.
32 const int kCurrentVersionNumber = 4; 35 const int kCurrentVersionNumber = 5;
33 const int kCompatibleVersionNumber = 1; 36 const int kCompatibleVersionNumber = 5;
34
35 // Initializes the certs table, returning true on success.
36 bool InitTable(sql::Connection* db) {
37 // The table is named "origin_bound_certs" for backwards compatability before
38 // we renamed this class to SQLiteChannelIDStore. Likewise, the primary
39 // key is "origin", but now can be other things like a plain domain.
40 if (!db->DoesTableExist("origin_bound_certs")) {
41 if (!db->Execute(
42 "CREATE TABLE origin_bound_certs ("
43 "origin TEXT NOT NULL UNIQUE PRIMARY KEY,"
44 "private_key BLOB NOT NULL,"
45 "cert BLOB NOT NULL,"
46 "cert_type INTEGER,"
47 "expiration_time INTEGER,"
48 "creation_time INTEGER)")) {
49 return false;
50 }
51 }
52
53 return true;
54 }
55 37
56 } // namespace 38 } // namespace
57 39
58 namespace net { 40 namespace net {
59 41
60 // This class is designed to be shared between any calling threads and the 42 // This class is designed to be shared between any calling threads and the
61 // background task runner. It batches operations and commits them on a timer. 43 // background task runner. It batches operations and commits them on a timer.
62 class SQLiteChannelIDStore::Backend 44 class SQLiteChannelIDStore::Backend
63 : public base::RefCountedThreadSafe<SQLiteChannelIDStore::Backend> { 45 : public base::RefCountedThreadSafe<SQLiteChannelIDStore::Backend> {
64 public: 46 public:
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 base::Unretained(this))); 187 base::Unretained(this)));
206 188
207 if (!db_->Open(path_)) { 189 if (!db_->Open(path_)) {
208 NOTREACHED() << "Unable to open cert DB."; 190 NOTREACHED() << "Unable to open cert DB.";
209 if (corruption_detected_) 191 if (corruption_detected_)
210 KillDatabase(); 192 KillDatabase();
211 db_.reset(); 193 db_.reset();
212 return; 194 return;
213 } 195 }
214 196
215 if (!EnsureDatabaseVersion() || !InitTable(db_.get())) { 197 if (!EnsureDatabaseVersion()) {
216 NOTREACHED() << "Unable to open cert DB."; 198 NOTREACHED() << "Unable to open cert DB.";
217 if (corruption_detected_) 199 if (corruption_detected_)
218 KillDatabase(); 200 KillDatabase();
219 meta_table_.Reset(); 201 meta_table_.Reset();
220 db_.reset(); 202 db_.reset();
221 return; 203 return;
222 } 204 }
223 205
224 db_->Preload(); 206 db_->Preload();
225 207
226 // Slurp all the certs into the out-vector. 208 // Slurp all the certs into the out-vector.
227 sql::Statement smt(db_->GetUniqueStatement( 209 sql::Statement smt(db_->GetUniqueStatement(
228 "SELECT origin, private_key, cert, cert_type, expiration_time, " 210 "SELECT host, private_key, public_key, creation_time FROM channel_id"));
229 "creation_time FROM origin_bound_certs"));
230 if (!smt.is_valid()) { 211 if (!smt.is_valid()) {
231 if (corruption_detected_) 212 if (corruption_detected_)
232 KillDatabase(); 213 KillDatabase();
233 meta_table_.Reset(); 214 meta_table_.Reset();
234 db_.reset(); 215 db_.reset();
235 return; 216 return;
236 } 217 }
237 218
238 while (smt.Step()) { 219 while (smt.Step()) {
239 SSLClientCertType type = static_cast<SSLClientCertType>(smt.ColumnInt(3)); 220 std::vector<uint8> private_key_from_db, public_key_from_db;
240 if (type != CLIENT_CERT_ECDSA_SIGN) 221 smt.ColumnBlobAsVector(1, &private_key_from_db);
222 smt.ColumnBlobAsVector(2, &public_key_from_db);
223 scoped_ptr<crypto::ECPrivateKey> key(
224 crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
225 ChannelIDService::kEPKIPassword, private_key_from_db,
226 public_key_from_db));
227 if (!key)
241 continue; 228 continue;
242 std::string private_key_from_db, cert_from_db;
243 smt.ColumnBlobAsString(1, &private_key_from_db);
244 smt.ColumnBlobAsString(2, &cert_from_db);
245 scoped_ptr<DefaultChannelIDStore::ChannelID> channel_id( 229 scoped_ptr<DefaultChannelIDStore::ChannelID> channel_id(
246 new DefaultChannelIDStore::ChannelID( 230 new DefaultChannelIDStore::ChannelID(
247 smt.ColumnString(0), // origin 231 smt.ColumnString(0), // host
248 base::Time::FromInternalValue(smt.ColumnInt64(5)), 232 base::Time::FromInternalValue(smt.ColumnInt64(3)), key.release()));
249 base::Time::FromInternalValue(smt.ColumnInt64(4)),
250 private_key_from_db,
251 cert_from_db));
252 channel_ids->push_back(channel_id.release()); 233 channel_ids->push_back(channel_id.release());
253 } 234 }
254 235
255 UMA_HISTOGRAM_COUNTS_10000( 236 UMA_HISTOGRAM_COUNTS_10000(
256 "DomainBoundCerts.DBLoadedCount", 237 "DomainBoundCerts.DBLoadedCount",
257 static_cast<base::HistogramBase::Sample>(channel_ids->size())); 238 static_cast<base::HistogramBase::Sample>(channel_ids->size()));
258 base::TimeDelta load_time = base::TimeTicks::Now() - start; 239 base::TimeDelta load_time = base::TimeTicks::Now() - start;
259 UMA_HISTOGRAM_CUSTOM_TIMES("DomainBoundCerts.DBLoadTime", 240 UMA_HISTOGRAM_CUSTOM_TIMES("DomainBoundCerts.DBLoadTime",
260 load_time, 241 load_time,
261 base::TimeDelta::FromMilliseconds(1), 242 base::TimeDelta::FromMilliseconds(1),
262 base::TimeDelta::FromMinutes(1), 243 base::TimeDelta::FromMinutes(1),
263 50); 244 50);
264 DVLOG(1) << "loaded " << channel_ids->size() << " in " 245 DVLOG(1) << "loaded " << channel_ids->size() << " in "
265 << load_time.InMilliseconds() << " ms"; 246 << load_time.InMilliseconds() << " ms";
266 } 247 }
267 248
268 bool SQLiteChannelIDStore::Backend::EnsureDatabaseVersion() { 249 bool SQLiteChannelIDStore::Backend::EnsureDatabaseVersion() {
269 // Version check. 250 // Version check.
270 if (!meta_table_.Init( 251 if (!meta_table_.Init(
271 db_.get(), kCurrentVersionNumber, kCompatibleVersionNumber)) { 252 db_.get(), kCurrentVersionNumber, kCompatibleVersionNumber)) {
272 return false; 253 return false;
273 } 254 }
274 255
275 if (meta_table_.GetCompatibleVersionNumber() > kCurrentVersionNumber) { 256 if (meta_table_.GetCompatibleVersionNumber() > kCurrentVersionNumber) {
276 LOG(WARNING) << "Server bound cert database is too new."; 257 LOG(WARNING) << "Server bound cert database is too new.";
277 return false; 258 return false;
278 } 259 }
279 260
280 int cur_version = meta_table_.GetVersionNumber(); 261 int cur_version = meta_table_.GetVersionNumber();
281 if (cur_version == 1) { 262
282 sql::Transaction transaction(db_.get()); 263 sql::Transaction transaction(db_.get());
283 if (!transaction.Begin()) 264 if (!transaction.Begin())
284 return false; 265 return false;
266
267 // Create new table if it doesn't already exist
268 if (!db_->DoesTableExist("channel_id")) {
285 if (!db_->Execute( 269 if (!db_->Execute(
286 "ALTER TABLE origin_bound_certs ADD COLUMN cert_type " 270 "CREATE TABLE channel_id ("
287 "INTEGER")) { 271 "host TEXT NOT NULL UNIQUE PRIMARY KEY,"
288 LOG(WARNING) << "Unable to update server bound cert database to " 272 "private_key BLOB NOT NULL,"
289 << "version 2."; 273 "public_key BLOB NOT NULL,"
274 "creation_time INTEGER)")) {
290 return false; 275 return false;
291 } 276 }
292 // All certs in version 1 database are rsa_sign, which are unsupported.
293 // Just discard them all.
294 if (!db_->Execute("DELETE from origin_bound_certs")) {
295 LOG(WARNING) << "Unable to update server bound cert database to "
296 << "version 2.";
297 return false;
298 }
299 ++cur_version;
300 meta_table_.SetVersionNumber(cur_version);
301 meta_table_.SetCompatibleVersionNumber(
302 std::min(cur_version, kCompatibleVersionNumber));
303 transaction.Commit();
304 } 277 }
305 278
306 if (cur_version <= 3) { 279 // Migrate from previous versions to new version if possible
307 sql::Transaction transaction(db_.get()); 280 if (cur_version >= 2 && cur_version <= 4) {
308 if (!transaction.Begin()) 281 sql::Statement statement(db_->GetUniqueStatement(
309 return false; 282 "SELECT origin, cert, private_key, cert_type FROM origin_bound_certs"));
310 283 sql::Statement insert_statement(db_->GetUniqueStatement(
311 if (cur_version == 2) { 284 "INSERT INTO channel_id (host, private_key, public_key, creation_time) "
312 if (!db_->Execute( 285 "VALUES (?, ?, ?, ?)"));
313 "ALTER TABLE origin_bound_certs ADD COLUMN " 286 if (!statement.is_valid() || !insert_statement.is_valid()) {
314 "expiration_time INTEGER")) {
315 LOG(WARNING) << "Unable to update server bound cert database to "
316 << "version 4.";
317 return false;
318 }
319 }
320
321 if (!db_->Execute(
322 "ALTER TABLE origin_bound_certs ADD COLUMN "
323 "creation_time INTEGER")) {
324 LOG(WARNING) << "Unable to update server bound cert database to " 287 LOG(WARNING) << "Unable to update server bound cert database to "
325 << "version 4."; 288 << "version 5.";
326 return false; 289 return false;
327 } 290 }
328 291
329 sql::Statement statement(
330 db_->GetUniqueStatement("SELECT origin, cert FROM origin_bound_certs"));
331 sql::Statement update_expires_statement(db_->GetUniqueStatement(
332 "UPDATE origin_bound_certs SET expiration_time = ? WHERE origin = ?"));
333 sql::Statement update_creation_statement(db_->GetUniqueStatement(
334 "UPDATE origin_bound_certs SET creation_time = ? WHERE origin = ?"));
335 if (!statement.is_valid() || !update_expires_statement.is_valid() ||
336 !update_creation_statement.is_valid()) {
337 LOG(WARNING) << "Unable to update server bound cert database to "
338 << "version 4.";
339 return false;
340 }
341
342 while (statement.Step()) { 292 while (statement.Step()) {
343 std::string origin = statement.ColumnString(0); 293 std::string origin = statement.ColumnString(0);
344 std::string cert_from_db; 294 std::string cert_from_db;
345 statement.ColumnBlobAsString(1, &cert_from_db); 295 statement.ColumnBlobAsString(1, &cert_from_db);
296 std::string private_key;
297 statement.ColumnBlobAsString(2, &private_key);
298 if (statement.ColumnInt64(3) != CLIENT_CERT_ECDSA_SIGN)
299 continue;
Ryan Sleevi 2015/05/08 23:43:13 Should this be on line 293, to avoid the other cop
nharper 2015/05/11 21:26:43 Yes, there's no reason not to do that check first.
346 // Parse the cert and extract the real value and then update the DB. 300 // Parse the cert and extract the real value and then update the DB.
347 scoped_refptr<X509Certificate> cert(X509Certificate::CreateFromBytes( 301 scoped_refptr<X509Certificate> cert(X509Certificate::CreateFromBytes(
348 cert_from_db.data(), static_cast<int>(cert_from_db.size()))); 302 cert_from_db.data(), static_cast<int>(cert_from_db.size())));
349 if (cert.get()) { 303 if (cert.get()) {
350 if (cur_version == 2) { 304 insert_statement.Reset(true);
351 update_expires_statement.Reset(true); 305 insert_statement.BindString(0, origin);
352 update_expires_statement.BindInt64( 306 insert_statement.BindBlob(1, private_key.data(),
353 0, cert->valid_expiry().ToInternalValue()); 307 static_cast<int>(private_key.size()));
354 update_expires_statement.BindString(1, origin); 308 base::StringPiece spki;
355 if (!update_expires_statement.Run()) { 309 if (!asn1::ExtractSPKIFromDERCert(cert_from_db, &spki)) {
356 LOG(WARNING) << "Unable to update server bound cert database to " 310 LOG(WARNING) << "Unable to extract SPKI from cert when migrating "
357 << "version 4."; 311 "channel id database to version 5.";
358 return false; 312 return false;
359 }
360 } 313 }
361 314 insert_statement.BindBlob(2, spki.data(), spki.size());
362 update_creation_statement.Reset(true); 315 insert_statement.BindInt64(3, cert->valid_start().ToInternalValue());
363 update_creation_statement.BindInt64( 316 if (!insert_statement.Run()) {
364 0, cert->valid_start().ToInternalValue()); 317 LOG(WARNING) << "Unable to update channel id database to "
365 update_creation_statement.BindString(1, origin); 318 << "version 5.";
366 if (!update_creation_statement.Run()) {
367 LOG(WARNING) << "Unable to update server bound cert database to "
368 << "version 4.";
369 return false; 319 return false;
370 } 320 }
371 } else { 321 } else {
372 // If there's a cert we can't parse, just leave it. It'll get replaced 322 // If there's a cert we can't parse, just leave it. It'll get replaced
373 // with a new one if we ever try to use it. 323 // with a new one if we ever try to use it.
374 LOG(WARNING) << "Error parsing cert for database upgrade for origin " 324 LOG(WARNING) << "Error parsing cert for database upgrade for origin "
375 << statement.ColumnString(0); 325 << statement.ColumnString(0);
376 } 326 }
377 } 327 }
378
379 cur_version = 4;
380 meta_table_.SetVersionNumber(cur_version);
381 meta_table_.SetCompatibleVersionNumber(
382 std::min(cur_version, kCompatibleVersionNumber));
383 transaction.Commit();
384 } 328 }
385 329
330 if (cur_version < kCurrentVersionNumber) {
331 sql::Statement statement(
332 db_->GetUniqueStatement("DROP TABLE origin_bound_certs"));
333 if (!statement.Run()) {
334 LOG(WARNING) << "Error dropping old origin_bound_certs table";
335 return false;
336 }
337 meta_table_.SetVersionNumber(kCurrentVersionNumber);
338 meta_table_.SetCompatibleVersionNumber(kCompatibleVersionNumber);
339 }
340 transaction.Commit();
341
386 // Put future migration cases here. 342 // Put future migration cases here.
387 343
388 // When the version is too old, we just try to continue anyway, there should
389 // not be a released product that makes a database too old for us to handle.
390 LOG_IF(WARNING, cur_version < kCurrentVersionNumber)
391 << "Server bound cert database version " << cur_version
392 << " is too old to handle.";
393
394 return true; 344 return true;
395 } 345 }
396 346
397 void SQLiteChannelIDStore::Backend::DatabaseErrorCallback( 347 void SQLiteChannelIDStore::Backend::DatabaseErrorCallback(
398 int error, 348 int error,
399 sql::Statement* stmt) { 349 sql::Statement* stmt) {
400 DCHECK(background_task_runner_->RunsTasksOnCurrentThread()); 350 DCHECK(background_task_runner_->RunsTasksOnCurrentThread());
401 351
402 if (!sql::IsErrorCatastrophic(error)) 352 if (!sql::IsErrorCatastrophic(error))
403 return; 353 return;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 pending_.swap(ops); 462 pending_.swap(ops);
513 num_pending_ = 0; 463 num_pending_ = 0;
514 } 464 }
515 465
516 // Maybe an old timer fired or we are already Close()'ed. 466 // Maybe an old timer fired or we are already Close()'ed.
517 if (!db_.get() || ops.empty()) 467 if (!db_.get() || ops.empty())
518 return; 468 return;
519 469
520 sql::Statement add_statement(db_->GetCachedStatement( 470 sql::Statement add_statement(db_->GetCachedStatement(
521 SQL_FROM_HERE, 471 SQL_FROM_HERE,
522 "INSERT INTO origin_bound_certs (origin, private_key, cert, cert_type, " 472 "INSERT INTO channel_id (host, private_key, public_key, "
523 "expiration_time, creation_time) VALUES (?,?,?,?,?,?)")); 473 "creation_time) VALUES (?,?,?,?)"));
524 if (!add_statement.is_valid()) 474 if (!add_statement.is_valid())
525 return; 475 return;
526 476
527 sql::Statement del_statement(db_->GetCachedStatement( 477 sql::Statement del_statement(db_->GetCachedStatement(
528 SQL_FROM_HERE, "DELETE FROM origin_bound_certs WHERE origin=?")); 478 SQL_FROM_HERE, "DELETE FROM channel_id WHERE host=?"));
529 if (!del_statement.is_valid()) 479 if (!del_statement.is_valid())
530 return; 480 return;
531 481
532 sql::Transaction transaction(db_.get()); 482 sql::Transaction transaction(db_.get());
533 if (!transaction.Begin()) 483 if (!transaction.Begin())
534 return; 484 return;
535 485
536 for (PendingOperationsList::iterator it = ops.begin(); it != ops.end(); 486 for (PendingOperationsList::iterator it = ops.begin(); it != ops.end();
537 ++it) { 487 ++it) {
538 // Free the certs as we commit them to the database. 488 // Free the certs as we commit them to the database.
539 scoped_ptr<PendingOperation> po(*it); 489 scoped_ptr<PendingOperation> po(*it);
540 switch (po->op()) { 490 switch (po->op()) {
541 case PendingOperation::CHANNEL_ID_ADD: { 491 case PendingOperation::CHANNEL_ID_ADD: {
542 add_statement.Reset(true); 492 add_statement.Reset(true);
543 add_statement.BindString(0, po->channel_id().server_identifier()); 493 add_statement.BindString(0, po->channel_id().server_identifier());
544 const std::string& private_key = po->channel_id().private_key(); 494 std::vector<uint8> private_key, public_key;
495 if (!po->channel_id().key()->ExportEncryptedPrivateKey(
496 ChannelIDService::kEPKIPassword, 1, &private_key))
497 continue;
498 if (!po->channel_id().key()->ExportPublicKey(&public_key))
499 continue;
545 add_statement.BindBlob( 500 add_statement.BindBlob(
546 1, private_key.data(), static_cast<int>(private_key.size())); 501 1, private_key.data(), static_cast<int>(private_key.size()));
547 const std::string& cert = po->channel_id().cert(); 502 add_statement.BindBlob(2, public_key.data(),
548 add_statement.BindBlob(2, cert.data(), static_cast<int>(cert.size())); 503 static_cast<int>(public_key.size()));
549 add_statement.BindInt(3, CLIENT_CERT_ECDSA_SIGN);
550 add_statement.BindInt64( 504 add_statement.BindInt64(
551 4, po->channel_id().expiration_time().ToInternalValue()); 505 3, po->channel_id().creation_time().ToInternalValue());
552 add_statement.BindInt64(
553 5, po->channel_id().creation_time().ToInternalValue());
554 if (!add_statement.Run()) 506 if (!add_statement.Run())
555 NOTREACHED() << "Could not add a server bound cert to the DB."; 507 NOTREACHED() << "Could not add a server bound cert to the DB.";
556 break; 508 break;
557 } 509 }
558 case PendingOperation::CHANNEL_ID_DELETE: 510 case PendingOperation::CHANNEL_ID_DELETE:
559 del_statement.Reset(true); 511 del_statement.Reset(true);
560 del_statement.BindString(0, po->channel_id().server_identifier()); 512 del_statement.BindString(0, po->channel_id().server_identifier());
561 if (!del_statement.Run()) 513 if (!del_statement.Run())
562 NOTREACHED() << "Could not delete a server bound cert from the DB."; 514 NOTREACHED() << "Could not delete a server bound cert from the DB.";
563 break; 515 break;
(...skipping 25 matching lines...) Expand all
589 void SQLiteChannelIDStore::Backend::BackgroundDeleteAllInList( 541 void SQLiteChannelIDStore::Backend::BackgroundDeleteAllInList(
590 const std::list<std::string>& server_identifiers) { 542 const std::list<std::string>& server_identifiers) {
591 DCHECK(background_task_runner_->RunsTasksOnCurrentThread()); 543 DCHECK(background_task_runner_->RunsTasksOnCurrentThread());
592 544
593 if (!db_.get()) 545 if (!db_.get())
594 return; 546 return;
595 547
596 PrunePendingOperationsForDeletes(server_identifiers); 548 PrunePendingOperationsForDeletes(server_identifiers);
597 549
598 sql::Statement del_smt(db_->GetCachedStatement( 550 sql::Statement del_smt(db_->GetCachedStatement(
599 SQL_FROM_HERE, "DELETE FROM origin_bound_certs WHERE origin=?")); 551 SQL_FROM_HERE, "DELETE FROM channel_id WHERE host=?"));
600 if (!del_smt.is_valid()) { 552 if (!del_smt.is_valid()) {
601 LOG(WARNING) << "Unable to delete channel ids."; 553 LOG(WARNING) << "Unable to delete channel ids.";
602 return; 554 return;
603 } 555 }
604 556
605 sql::Transaction transaction(db_.get()); 557 sql::Transaction transaction(db_.get());
606 if (!transaction.Begin()) { 558 if (!transaction.Begin()) {
607 LOG(WARNING) << "Unable to delete channel ids."; 559 LOG(WARNING) << "Unable to delete channel ids.";
608 return; 560 return;
609 } 561 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 backend_->SetForceKeepSessionState(); 607 backend_->SetForceKeepSessionState();
656 } 608 }
657 609
658 SQLiteChannelIDStore::~SQLiteChannelIDStore() { 610 SQLiteChannelIDStore::~SQLiteChannelIDStore() {
659 backend_->Close(); 611 backend_->Close();
660 // We release our reference to the Backend, though it will probably still have 612 // We release our reference to the Backend, though it will probably still have
661 // a reference if the background task runner has not run Close() yet. 613 // a reference if the background task runner has not run Close() yet.
662 } 614 }
663 615
664 } // namespace net 616 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698