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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_indexed_db_helper.cc

Issue 1438073002: Use std::tie for multi-member comparisons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style guide updates Created 5 years, 1 month 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 (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 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" 5 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h"
6 6
7 #include <tuple>
7 #include <vector> 8 #include <vector>
8 9
9 #include "base/bind.h" 10 #include "base/bind.h"
10 #include "base/location.h" 11 #include "base/location.h"
11 #include "base/time/time.h" 12 #include "base/time/time.h"
12 #include "chrome/browser/browsing_data/browsing_data_helper.h" 13 #include "chrome/browser/browsing_data/browsing_data_helper.h"
13 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
14 #include "content/public/browser/indexed_db_context.h" 15 #include "content/public/browser/indexed_db_context.h"
15 16
16 using content::BrowserThread; 17 using content::BrowserThread;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 : origin(origin), 74 : origin(origin),
74 name(name) { 75 name(name) {
75 } 76 }
76 77
77 CannedBrowsingDataIndexedDBHelper:: 78 CannedBrowsingDataIndexedDBHelper::
78 PendingIndexedDBInfo::~PendingIndexedDBInfo() { 79 PendingIndexedDBInfo::~PendingIndexedDBInfo() {
79 } 80 }
80 81
81 bool CannedBrowsingDataIndexedDBHelper::PendingIndexedDBInfo::operator<( 82 bool CannedBrowsingDataIndexedDBHelper::PendingIndexedDBInfo::operator<(
82 const PendingIndexedDBInfo& other) const { 83 const PendingIndexedDBInfo& other) const {
83 if (origin == other.origin) 84 return std::tie(origin, name) < std::tie(other.origin, other.name);
84 return name < other.name;
85 return origin < other.origin;
86 } 85 }
87 86
88 CannedBrowsingDataIndexedDBHelper::CannedBrowsingDataIndexedDBHelper( 87 CannedBrowsingDataIndexedDBHelper::CannedBrowsingDataIndexedDBHelper(
89 content::IndexedDBContext* context) 88 content::IndexedDBContext* context)
90 : BrowsingDataIndexedDBHelper(context) { 89 : BrowsingDataIndexedDBHelper(context) {
91 } 90 }
92 91
93 CannedBrowsingDataIndexedDBHelper::~CannedBrowsingDataIndexedDBHelper() {} 92 CannedBrowsingDataIndexedDBHelper::~CannedBrowsingDataIndexedDBHelper() {}
94 93
95 void CannedBrowsingDataIndexedDBHelper::AddIndexedDB( 94 void CannedBrowsingDataIndexedDBHelper::AddIndexedDB(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 for (std::set<PendingIndexedDBInfo>::iterator it = 136 for (std::set<PendingIndexedDBInfo>::iterator it =
138 pending_indexed_db_info_.begin(); 137 pending_indexed_db_info_.begin();
139 it != pending_indexed_db_info_.end(); ) { 138 it != pending_indexed_db_info_.end(); ) {
140 if (it->origin == origin) 139 if (it->origin == origin)
141 pending_indexed_db_info_.erase(it++); 140 pending_indexed_db_info_.erase(it++);
142 else 141 else
143 ++it; 142 ++it;
144 } 143 }
145 BrowsingDataIndexedDBHelper::DeleteIndexedDB(origin); 144 BrowsingDataIndexedDBHelper::DeleteIndexedDB(origin);
146 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698