OLD | NEW |
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.h" | 5 #include "content/browser/indexed_db/indexed_db_transaction.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 // never requests further activity. | 321 // never requests further activity. |
322 timeout_timer_.Start( | 322 timeout_timer_.Start( |
323 FROM_HERE, | 323 FROM_HERE, |
324 base::TimeDelta::FromSeconds(kInactivityTimeoutPeriodSeconds), | 324 base::TimeDelta::FromSeconds(kInactivityTimeoutPeriodSeconds), |
325 base::Bind(&IndexedDBTransaction::Timeout, this)); | 325 base::Bind(&IndexedDBTransaction::Timeout, this)); |
326 } | 326 } |
327 | 327 |
328 void IndexedDBTransaction::Timeout() { | 328 void IndexedDBTransaction::Timeout() { |
329 Abort(IndexedDBDatabaseError( | 329 Abort(IndexedDBDatabaseError( |
330 blink::WebIDBDatabaseExceptionTimeoutError, | 330 blink::WebIDBDatabaseExceptionTimeoutError, |
331 ASCIIToUTF16("Transaction timed out due to inactivity."))); | 331 base::ASCIIToUTF16("Transaction timed out due to inactivity."))); |
332 } | 332 } |
333 | 333 |
334 void IndexedDBTransaction::CloseOpenCursors() { | 334 void IndexedDBTransaction::CloseOpenCursors() { |
335 for (std::set<IndexedDBCursor*>::iterator i = open_cursors_.begin(); | 335 for (std::set<IndexedDBCursor*>::iterator i = open_cursors_.begin(); |
336 i != open_cursors_.end(); | 336 i != open_cursors_.end(); |
337 ++i) | 337 ++i) |
338 (*i)->Close(); | 338 (*i)->Close(); |
339 open_cursors_.clear(); | 339 open_cursors_.clear(); |
340 } | 340 } |
341 | 341 |
342 } // namespace content | 342 } // namespace content |
OLD | NEW |