OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/precache/core/precache_database.h" | 5 #include "components/precache/core/precache_database.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram_macros.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "sql/connection.h" | 14 #include "sql/connection.h" |
15 #include "sql/transaction.h" | 15 #include "sql/transaction.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // The number of days old that an entry in the precache URL table can be before | 20 // The number of days old that an entry in the precache URL table can be before |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // database writes can be buffered up and flushed together in the same | 223 // database writes can be buffered up and flushed together in the same |
224 // transaction. | 224 // transaction. |
225 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 225 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
226 FROM_HERE, base::Bind(&PrecacheDatabase::PostedFlush, | 226 FROM_HERE, base::Bind(&PrecacheDatabase::PostedFlush, |
227 scoped_refptr<PrecacheDatabase>(this)), | 227 scoped_refptr<PrecacheDatabase>(this)), |
228 base::TimeDelta::FromSeconds(1)); | 228 base::TimeDelta::FromSeconds(1)); |
229 is_flush_posted_ = true; | 229 is_flush_posted_ = true; |
230 } | 230 } |
231 | 231 |
232 } // namespace precache | 232 } // namespace precache |
OLD | NEW |