Index: chrome/browser/visitedlink_master.h |
diff --git a/chrome/browser/visitedlink_master.h b/chrome/browser/visitedlink_master.h |
index ac996345b9ea7af2ac446b0068ef76873c5158d5..c68e4c72679d9199ef12e8f29b7ebf0ed1840ea4 100644 |
--- a/chrome/browser/visitedlink_master.h |
+++ b/chrome/browser/visitedlink_master.h |
@@ -5,13 +5,22 @@ |
#ifndef CHROME_BROWSER_VISITEDLINK_MASTER_H__ |
#define CHROME_BROWSER_VISITEDLINK_MASTER_H__ |
+#if defined(OS_WIN) |
+#include <windows.h> |
+#endif |
#include <set> |
#include <string> |
#include <vector> |
+#include "base/file_path.h" |
#include "base/ref_counted.h" |
#include "base/shared_memory.h" |
+#if defined(OS_WIN) |
#include "chrome/browser/history/history.h" |
+#else |
+// TODO(port): remove scaffolding, use history.h for both POSIX and WIN. |
+#include "chrome/common/temp_scaffolding_stubs.h" |
+#endif // !defined(OS_WIN) |
#include "chrome/common/visitedlink_common.h" |
#include "testing/gtest/include/gtest/gtest_prod.h" |
@@ -53,7 +62,7 @@ class VisitedLinkMaster : public VisitedLinkCommon { |
PostNewTableEvent* poster, |
HistoryService* history_service, |
bool suppress_rebuild, |
- const std::wstring& filename, |
+ const FilePath& filename, |
int32 default_table_size); |
virtual ~VisitedLinkMaster(); |
@@ -141,7 +150,7 @@ class VisitedLinkMaster : public VisitedLinkCommon { |
// When the user is deleting a boatload of URLs, we don't really want to do |
// individual writes for each of them. When the count exceeds this threshold, |
// we will write the whole table to disk at once instead of individual items. |
- static const int32 kBigDeleteThreshold; |
+ static const size_t kBigDeleteThreshold; |
// Backend for the constructors initializing the members. |
void InitMembers(base::Thread* file_thread, |
@@ -171,15 +180,15 @@ class VisitedLinkMaster : public VisitedLinkCommon { |
// Returns true on success and places the size of the table in num_entries |
// and the number of nonzero fingerprints in used_count. This will fail if |
// the version of the file is not the current version of the database. |
- bool ReadFileHeader(HANDLE hfile, int32* num_entries, int32* used_count, |
+ bool ReadFileHeader(FILE* hfile, int32* num_entries, int32* used_count, |
uint8 salt[LINK_SALT_LENGTH]); |
// Fills *filename with the name of the link database filename |
- bool GetDatabaseFileName(std::wstring* filename); |
+ bool GetDatabaseFileName(FilePath* filename); |
// Wrapper around Window's WriteFile using asynchronous I/O. This will proxy |
// the write to a background thread. |
- void WriteToFile(HANDLE hfile, int32 offset, void* data, int32 data_size); |
+ void WriteToFile(FILE* hfile, off_t offset, void* data, int32 data_size); |
// Helper function to schedule and asynchronous write of the used count to |
// disk (this is a common operation). |
@@ -192,7 +201,7 @@ class VisitedLinkMaster : public VisitedLinkCommon { |
// Synchronous read from the file. Assumes there are no pending asynchronous |
// I/O functions. Returns true if the entire buffer was successfully filled. |
- bool ReadFromFile(HANDLE hfile, int32 offset, void* data, int32 data_size); |
+ bool ReadFromFile(FILE* hfile, off_t offset, void* data, size_t data_size); |
// General table handling |
// ---------------------- |
@@ -326,7 +335,7 @@ class VisitedLinkMaster : public VisitedLinkCommon { |
// The currently open file with the table in it. This may be NULL if we're |
// rebuilding and haven't written a new version yet. Writing to the file may |
// be safely ignored in this case. |
- HANDLE file_; |
+ FILE* file_; |
// Shared memory consists of a SharedHeader followed by the table. |
base::SharedMemory *shared_memory_; |
@@ -347,7 +356,7 @@ class VisitedLinkMaster : public VisitedLinkCommon { |
// in release builds that give "regular" behavior. |
// Overridden database file name for testing |
- std::wstring database_name_override_; |
+ FilePath database_name_override_; |
// When nonzero, overrides the table size for new databases for testing |
int32 table_size_override_; |