| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_MASTER_H__ | 5 #ifndef CHROME_BROWSER_VISITEDLINK_MASTER_H__ |
| 6 #define CHROME_BROWSER_VISITEDLINK_MASTER_H__ | 6 #define CHROME_BROWSER_VISITEDLINK_MASTER_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 #endif | 11 #endif |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 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/ref_counted.h" | 18 #include "base/ref_counted.h" |
| 19 #include "base/shared_memory.h" | 19 #include "base/shared_memory.h" |
| 20 #include "chrome/browser/history/history.h" | 20 #include "chrome/browser/history/history.h" |
| 21 #include "chrome/common/visitedlink_common.h" | 21 #include "chrome/common/visitedlink_common.h" |
| 22 | 22 |
| 23 class GURL; | 23 class GURL; |
| 24 class MessageLoop; | |
| 25 class Profile; | 24 class Profile; |
| 26 | 25 |
| 27 // Controls the link coloring database. The master controls all writing to the | 26 // Controls the link coloring database. The master controls all writing to the |
| 28 // database as well as disk I/O. There should be only one master. | 27 // database as well as disk I/O. There should be only one master. |
| 29 // | 28 // |
| 30 // This class will defer writing operations to the file thread. This means that | 29 // This class will defer writing operations to the file thread. This means that |
| 31 // class destruction, the file may still be open since operations are pending on | 30 // class destruction, the file may still be open since operations are pending on |
| 32 // another thread. | 31 // another thread. |
| 33 class VisitedLinkMaster : public VisitedLinkCommon { | 32 class VisitedLinkMaster : public VisitedLinkCommon { |
| 34 public: | 33 public: |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 int32 used_count = 0; | 380 int32 used_count = 0; |
| 382 for (int32 i = 0; i < table_length_; i++) { | 381 for (int32 i = 0; i < table_length_; i++) { |
| 383 if (hash_table_[i]) | 382 if (hash_table_[i]) |
| 384 used_count++; | 383 used_count++; |
| 385 } | 384 } |
| 386 DCHECK_EQ(used_count, used_items_); | 385 DCHECK_EQ(used_count, used_items_); |
| 387 } | 386 } |
| 388 #endif | 387 #endif |
| 389 | 388 |
| 390 #endif // CHROME_BROWSER_VISITEDLINK_MASTER_H__ | 389 #endif // CHROME_BROWSER_VISITEDLINK_MASTER_H__ |
| OLD | NEW |