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

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

Issue 1015233002: Fixes a bug where QuotaPolicyChannelIDStore would ignore some deletes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: With fix. Created 5 years, 9 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
« no previous file with comments | « chrome/browser/net/quota_policy_channel_id_store_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 db_.reset(); 560 db_.reset();
561 } 561 }
562 562
563 void SQLiteChannelIDStore::Backend::BackgroundDeleteAllInList( 563 void SQLiteChannelIDStore::Backend::BackgroundDeleteAllInList(
564 const std::list<std::string>& server_identifiers) { 564 const std::list<std::string>& server_identifiers) {
565 DCHECK(background_task_runner_->RunsTasksOnCurrentThread()); 565 DCHECK(background_task_runner_->RunsTasksOnCurrentThread());
566 566
567 if (!db_.get()) 567 if (!db_.get())
568 return; 568 return;
569 569
570 // Force a commit of any pending writes before issuing deletes.
571 Commit();
Ryan Sleevi 2015/03/19 02:45:56 It seems wasteful to Commit-and-Delete. Would you
572
570 sql::Statement del_smt(db_->GetCachedStatement( 573 sql::Statement del_smt(db_->GetCachedStatement(
571 SQL_FROM_HERE, "DELETE FROM origin_bound_certs WHERE origin=?")); 574 SQL_FROM_HERE, "DELETE FROM origin_bound_certs WHERE origin=?"));
572 if (!del_smt.is_valid()) { 575 if (!del_smt.is_valid()) {
573 LOG(WARNING) << "Unable to delete channel ids."; 576 LOG(WARNING) << "Unable to delete channel ids.";
574 return; 577 return;
575 } 578 }
576 579
577 sql::Transaction transaction(db_.get()); 580 sql::Transaction transaction(db_.get());
578 if (!transaction.Begin()) { 581 if (!transaction.Begin()) {
579 LOG(WARNING) << "Unable to delete channel ids."; 582 LOG(WARNING) << "Unable to delete channel ids.";
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 backend_->SetForceKeepSessionState(); 630 backend_->SetForceKeepSessionState();
628 } 631 }
629 632
630 SQLiteChannelIDStore::~SQLiteChannelIDStore() { 633 SQLiteChannelIDStore::~SQLiteChannelIDStore() {
631 backend_->Close(); 634 backend_->Close();
632 // We release our reference to the Backend, though it will probably still have 635 // We release our reference to the Backend, though it will probably still have
633 // a reference if the background task runner has not run Close() yet. 636 // a reference if the background task runner has not run Close() yet.
634 } 637 }
635 638
636 } // namespace net 639 } // namespace net
OLDNEW
« no previous file with comments | « chrome/browser/net/quota_policy_channel_id_store_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698