OLD | NEW |
---|---|
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 #ifndef CHROME_BROWSER_VISITEDLINK_VISITEDLINK_MASTER_H_ | 5 #ifndef COMPONENTS_VISITEDLINK_BROWSER_VISITEDLINK_MASTER_H_ |
6 #define CHROME_BROWSER_VISITEDLINK_VISITEDLINK_MASTER_H_ | 6 #define COMPONENTS_VISITEDLINK_BROWSER_VISITEDLINK_MASTER_H_ |
7 | 7 |
8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
11 #include <set> | 11 #include <set> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
16 #include "base/file_path.h" | 16 #include "base/file_path.h" |
17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
18 #include "base/shared_memory.h" | 18 #include "base/shared_memory.h" |
19 #include "base/threading/sequenced_worker_pool.h" | 19 #include "base/threading/sequenced_worker_pool.h" |
20 #include "chrome/common/visitedlink_common.h" | 20 #include "components/visitedlink/common/visitedlink_common.h" |
21 | 21 |
22 #if defined(UNIT_TEST) || defined(PERF_TEST) || !defined(NDEBUG) | 22 #if defined(UNIT_TEST) || defined(PERF_TEST) || !defined(NDEBUG) |
23 #include "base/logging.h" | 23 #include "base/logging.h" |
24 #endif | 24 #endif |
25 | 25 |
26 class GURL; | 26 class GURL; |
27 | |
28 namespace components { | |
27 class VisitedLinkDelegate; | 29 class VisitedLinkDelegate; |
brettw
2013/01/18 21:58:47
Ditto
| |
30 } | |
28 | 31 |
29 namespace content { | 32 namespace content { |
30 class BrowserContext; | 33 class BrowserContext; |
31 } // namespace content | 34 } // namespace content |
32 | 35 |
36 namespace components { | |
33 | 37 |
34 // Controls the link coloring database. The master controls all writing to the | 38 // Controls the link coloring database. The master controls all writing to the |
35 // database as well as disk I/O. There should be only one master. | 39 // database as well as disk I/O. There should be only one master. |
36 // | 40 // |
37 // This class will defer writing operations to the file thread. This means that | 41 // This class will defer writing operations to the file thread. This means that |
38 // class destruction, the file may still be open since operations are pending on | 42 // class destruction, the file may still be open since operations are pending on |
39 // another thread. | 43 // another thread. |
40 class VisitedLinkMaster : public VisitedLinkCommon { | 44 class VisitedLinkMaster : public VisitedLinkCommon { |
41 public: | 45 public: |
42 // Listens to the link coloring database events. The master is given this | 46 // Listens to the link coloring database events. The master is given this |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
424 inline void VisitedLinkMaster::DebugValidate() { | 428 inline void VisitedLinkMaster::DebugValidate() { |
425 int32 used_count = 0; | 429 int32 used_count = 0; |
426 for (int32 i = 0; i < table_length_; i++) { | 430 for (int32 i = 0; i < table_length_; i++) { |
427 if (hash_table_[i]) | 431 if (hash_table_[i]) |
428 used_count++; | 432 used_count++; |
429 } | 433 } |
430 DCHECK_EQ(used_count, used_items_); | 434 DCHECK_EQ(used_count, used_items_); |
431 } | 435 } |
432 #endif | 436 #endif |
433 | 437 |
434 #endif // CHROME_BROWSER_VISITEDLINK_VISITEDLINK_MASTER_H_ | 438 } // namespace components |
439 | |
440 #endif // COMPONENTS_VISITEDLINK_BROWSER_VISITEDLINK_MASTER_H_ | |
OLD | NEW |