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

Side by Side Diff: content/browser/indexed_db/indexed_db_transaction_coordinator.cc

Issue 2727733004: [IndexedDB] Closing mojo connections when renderer quits (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/browser/indexed_db/indexed_db_transaction_coordinator.h" 5 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/indexed_db/indexed_db_tracing.h" 8 #include "content/browser/indexed_db/indexed_db_tracing.h"
9 #include "content/browser/indexed_db/indexed_db_transaction.h" 9 #include "content/browser/indexed_db/indexed_db_transaction.h"
10 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" 10 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 return result; 94 return result;
95 } 95 }
96 96
97 void IndexedDBTransactionCoordinator::RecordMetrics() const { 97 void IndexedDBTransactionCoordinator::RecordMetrics() const {
98 IDB_TRACE_COUNTER2("IndexedDBTransactionCoordinator", "StartedTransactions", 98 IDB_TRACE_COUNTER2("IndexedDBTransactionCoordinator", "StartedTransactions",
99 started_transactions_.size(), "QueuedTransactions", 99 started_transactions_.size(), "QueuedTransactions",
100 queued_transactions_.size()); 100 queued_transactions_.size());
101 } 101 }
102 102
103 void IndexedDBTransactionCoordinator::ProcessQueuedTransactions() { 103 void IndexedDBTransactionCoordinator::ProcessQueuedTransactions() {
104 if (queued_transactions_.empty()) 104 if (queued_transactions_.empty()) {
105 RecordMetrics();
pwnall 2017/03/03 01:41:12 Is this a leftover from a different CL?
dmurph 2017/03/04 00:39:41 removed - I had the trace url dependency in here.
105 return; 106 return;
107 }
106 108
107 DCHECK(!IsRunningVersionChangeTransaction()); 109 DCHECK(!IsRunningVersionChangeTransaction());
108 110
109 // The locked_scope set accumulates the ids of object stores in the scope of 111 // The locked_scope set accumulates the ids of object stores in the scope of
110 // running read/write transactions. Other read-write transactions with 112 // running read/write transactions. Other read-write transactions with
111 // stores in this set may not be started. Read-only transactions may start, 113 // stores in this set may not be started. Read-only transactions may start,
112 // taking a snapshot of the database, which does not include uncommitted 114 // taking a snapshot of the database, which does not include uncommitted
113 // data. ("Version change" transactions are exclusive, but handled by the 115 // data. ("Version change" transactions are exclusive, but handled by the
114 // connection sequencing in IndexedDBDatabase.) 116 // connection sequencing in IndexedDBDatabase.)
115 std::set<int64_t> locked_scope; 117 std::set<int64_t> locked_scope;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 178
177 case blink::WebIDBTransactionModeReadOnly: 179 case blink::WebIDBTransactionModeReadOnly:
178 case blink::WebIDBTransactionModeReadWrite: 180 case blink::WebIDBTransactionModeReadWrite:
179 return !DoSetsIntersect(transaction->scope(), locked_scope); 181 return !DoSetsIntersect(transaction->scope(), locked_scope);
180 } 182 }
181 NOTREACHED(); 183 NOTREACHED();
182 return false; 184 return false;
183 } 185 }
184 186
185 } // namespace content 187 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698