OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/leveldb_wrapper_impl.h" | 5 #include "content/browser/leveldb_wrapper_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "mojo/common/common_type_converters.h" | 10 #include "mojo/common/common_type_converters.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 bool LevelDBWrapperImpl::s_aggressive_flushing_enabled_ = false; | 14 bool LevelDBWrapperImpl::s_aggressive_flushing_enabled_ = false; |
15 | 15 |
16 LevelDBWrapperImpl::RateLimiter::RateLimiter(size_t desired_rate, | 16 LevelDBWrapperImpl::RateLimiter::RateLimiter(size_t desired_rate, |
17 base::TimeDelta time_quantum) | 17 base::TimeDelta time_quantum) |
18 : rate_(desired_rate), samples_(0), time_quantum_(time_quantum) { | 18 : rate_(desired_rate), samples_(0), time_quantum_(time_quantum) { |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 weak_ptr_factory_.GetWeakPtr())); | 352 weak_ptr_factory_.GetWeakPtr())); |
353 } | 353 } |
354 | 354 |
355 void LevelDBWrapperImpl::OnCommitComplete(leveldb::DatabaseError error) { | 355 void LevelDBWrapperImpl::OnCommitComplete(leveldb::DatabaseError error) { |
356 // TODO(michaeln): What if it fails, uma here or in the DB class? | 356 // TODO(michaeln): What if it fails, uma here or in the DB class? |
357 --commit_batches_in_flight_; | 357 --commit_batches_in_flight_; |
358 StartCommitTimer(); | 358 StartCommitTimer(); |
359 } | 359 } |
360 | 360 |
361 } // namespace content | 361 } // namespace content |
OLD | NEW |