summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 23:18:42 +0000
committernick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 23:18:42 +0000
commit1cf6e88214a5b8b7c565f4885276e896d9743ee6 (patch)
tree55910d2d341d62b1a3da7dc016ec0b10b631261c
parentb01e756f392e1c7f284280b6b5ba73a71cc69fa7 (diff)
downloadchromium_src-1cf6e88214a5b8b7c565f4885276e896d9743ee6.zip
chromium_src-1cf6e88214a5b8b7c565f4885276e896d9743ee6.tar.gz
chromium_src-1cf6e88214a5b8b7c565f4885276e896d9743ee6.tar.bz2
Build sync engine as part of the browser build.
As before, syncapi is built as a dynamic library, and only on windows. The difference is that it's built from source, rather than being pulled in as a binary. Changes to sync engine code: * Use OS_WIN instead of OS_WINDOWS (requires build_config.h). * Rename platform-specific files to match the chrome convention. This allows them to be excluded by rules that already exist in chrome.gyp. The convention is either a /win/ directory, or an _win.cc at the end of the file. Other valid platforms are _mac, _linux, and _posix Changes to DEPS: * On Windows, pull in pthreads-win32. Changes to chrome.gyp: * Add new library targets for sync, notifier, sync_proto, and syncapi. Review URL: http://codereview.chromium.org/193103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26295 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS3
-rw-r--r--chrome/browser/sync/engine/net/server_connection_manager.cc3
-rw-r--r--chrome/browser/sync/engine/syncapi.cc17
-rw-r--r--chrome/browser/sync/engine/syncapi.h7
-rw-r--r--chrome/browser/sync/engine/syncer_thread.cc4
-rw-r--r--chrome/browser/sync/engine/syncer_unittest.cc5
-rw-r--r--chrome/browser/sync/engine/syncer_util.h3
-rw-r--r--chrome/browser/sync/glue/http_bridge.h4
-rw-r--r--chrome/browser/sync/glue/http_bridge_unittest.cc5
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.cc1
-rw-r--r--chrome/browser/sync/notifier/base/win/async_network_alive_win32.cc (renamed from chrome/browser/sync/notifier/base/win32/async_network_alive_win32.cc)0
-rw-r--r--chrome/browser/sync/notifier/base/win/time_win32.cc (renamed from chrome/browser/sync/notifier/base/win32/time_win32.cc)0
-rw-r--r--chrome/browser/sync/notifier/gaia_auth/win/win32window.cc (renamed from chrome/browser/sync/notifier/gaia_auth/win32window.cc)0
-rw-r--r--chrome/browser/sync/syncable/directory_backing_store.cc8
-rw-r--r--chrome/browser/sync/syncable/syncable.cc14
-rw-r--r--chrome/browser/sync/syncable/syncable.h4
-rw-r--r--chrome/browser/sync/syncable/syncable_unittest.cc24
-rw-r--r--chrome/browser/sync/util/character_set_converters_linux.cc (renamed from chrome/browser/sync/util/character_set_converters-linux.cc)0
-rw-r--r--chrome/browser/sync/util/character_set_converters_unittest.cc7
-rw-r--r--chrome/browser/sync/util/character_set_converters_win.cc (renamed from chrome/browser/sync/util/character_set_converters-win32.cc)0
-rw-r--r--chrome/browser/sync/util/compat_file.h (renamed from chrome/browser/sync/util/compat-file.h)6
-rw-r--r--chrome/browser/sync/util/compat_file_posix.cc (renamed from chrome/browser/sync/util/compat-file-posix.cc)2
-rw-r--r--chrome/browser/sync/util/compat_file_win.cc (renamed from chrome/browser/sync/util/compat-file-win.cc)10
-rw-r--r--chrome/browser/sync/util/compat_pthread.h (renamed from chrome/browser/sync/util/compat-pthread.h)11
-rw-r--r--chrome/browser/sync/util/event_sys-inl.h2
-rw-r--r--chrome/browser/sync/util/event_sys_unittest.cc3
-rw-r--r--chrome/browser/sync/util/highres_timer.h8
-rw-r--r--chrome/browser/sync/util/highres_timer_linux.cc (renamed from chrome/browser/sync/util/highres_timer-linux.cc)0
-rw-r--r--chrome/browser/sync/util/highres_timer_linux.h (renamed from chrome/browser/sync/util/highres_timer-linux.h)0
-rw-r--r--chrome/browser/sync/util/highres_timer_unittest.cc5
-rw-r--r--chrome/browser/sync/util/highres_timer_win.cc (renamed from chrome/browser/sync/util/highres_timer-win32.cc)0
-rw-r--r--chrome/browser/sync/util/highres_timer_win.h (renamed from chrome/browser/sync/util/highres_timer-win32.h)6
-rw-r--r--chrome/browser/sync/util/path_helpers.cc7
-rw-r--r--chrome/browser/sync/util/path_helpers.h2
-rw-r--r--chrome/browser/sync/util/path_helpers_linux.cc (renamed from chrome/browser/sync/util/path_helpers-linux.cc)0
-rw-r--r--chrome/browser/sync/util/path_helpers_posix.cc (renamed from chrome/browser/sync/util/path_helpers-posix.cc)0
-rw-r--r--chrome/browser/sync/util/path_helpers_unittest.cc7
-rw-r--r--chrome/browser/sync/util/pthread_helpers.cc16
-rw-r--r--chrome/browser/sync/util/pthread_helpers.h3
-rw-r--r--chrome/browser/sync/util/query_helpers.cc6
-rw-r--r--chrome/browser/sync/util/query_helpers.h1
-rw-r--r--chrome/browser/sync/util/query_helpers_unittest.cc2
-rw-r--r--chrome/browser/sync/util/sync_types.h3
-rw-r--r--chrome/browser/sync/util/user_settings.cc6
-rw-r--r--chrome/browser/sync/util/user_settings.h5
-rw-r--r--chrome/browser/sync/util/user_settings_posix.cc (renamed from chrome/browser/sync/util/user_settings-posix.cc)0
-rw-r--r--chrome/browser/sync/util/user_settings_win.cc (renamed from chrome/browser/sync/util/user_settings-win32.cc)0
-rw-r--r--chrome/chrome.gyp384
48 files changed, 472 insertions, 132 deletions
diff --git a/DEPS b/DEPS
index 7dd1d23..e022bf4 100644
--- a/DEPS
+++ b/DEPS
@@ -96,6 +96,9 @@ deps_os = {
"src/third_party/ffmpeg/binaries/chromium":
"/trunk/deps/third_party/ffmpeg/binaries/win@25436",
+
+ "src/third_party/pthreads-win32":
+ "/trunk/deps/third_party/pthreads-win32@26080",
},
"mac": {
"src/third_party/GTM":
diff --git a/chrome/browser/sync/engine/net/server_connection_manager.cc b/chrome/browser/sync/engine/net/server_connection_manager.cc
index 34cb3f2..3e60d2d 100644
--- a/chrome/browser/sync/engine/net/server_connection_manager.cc
+++ b/chrome/browser/sync/engine/net/server_connection_manager.cc
@@ -10,6 +10,7 @@
#include <string>
#include <vector>
+#include "build/build_config.h"
#include "chrome/browser/sync/engine/net/http_return.h"
#include "chrome/browser/sync/engine/net/url_translator.h"
#include "chrome/browser/sync/engine/syncapi.h"
@@ -301,7 +302,7 @@ void ServerConnectionManager::ResetConnection() {
}
bool ServerConnectionManager::IncrementErrorCount() {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
error_count_mutex_.Lock();
error_count_++;
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index db78281..5711429 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -4,7 +4,9 @@
#include "chrome/browser/sync/engine/syncapi.h"
-#if defined(OS_WINDOWS)
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
#include <windows.h>
#include <iphlpapi.h>
#endif
@@ -77,7 +79,7 @@ static base::AtExitManager g_at_exit_manager; // Necessary for NewCallback.
struct ThreadParams {
browser_sync::ServerConnectionManager* conn_mgr;
-#if defined(OS_WINDOWS)
+#if defined(OS_WIN)
HANDLE exit_flag;
#endif
};
@@ -89,7 +91,7 @@ void* AddressWatchThread(void* arg) {
NameCurrentThreadForDebugging("SyncEngine_AddressWatcher");
LOG(INFO) << "starting the address watch thread";
const ThreadParams* const params = reinterpret_cast<const ThreadParams*>(arg);
-#if defined(OS_WINDOWS)
+#if defined(OS_WIN)
OVERLAPPED overlapped = {0};
overlapped.hEvent = CreateEvent(NULL, FALSE, TRUE, NULL);
HANDLE file;
@@ -168,7 +170,7 @@ static bool EndsWithSpace(const string16& string) {
static inline void String16ToPathString(const sync_char16 *in,
PathString *out) {
string16 in_str(in);
-#if defined(OS_WINDOWS)
+#if defined(OS_WIN)
out->assign(in_str);
#else
UTF16ToUTF8(in_str.c_str(), in_str.length(), out);
@@ -176,7 +178,7 @@ static inline void String16ToPathString(const sync_char16 *in,
}
static inline void PathStringToString16(const PathString& in, string16* out) {
-#if defined(OS_WINDOWS)
+#if defined(OS_WIN)
out->assign(in);
#else
UTF8ToUTF16(in.c_str(), in.length(), out);
@@ -1013,7 +1015,7 @@ bool SyncManager::SyncInternal::Init(
// platform independent in here.
// TODO(ncarter): When this gets cleaned up, the implementation of
// CreatePThread can also be removed.
-#if defined(OS_WINDOWS)
+#if defined(OS_WIN)
HANDLE exit_flag = CreateEvent(NULL, TRUE /*manual reset*/, FALSE, NULL);
address_watch_params_.exit_flag = exit_flag;
#endif
@@ -1207,7 +1209,7 @@ void SyncManager::SyncInternal::Shutdown() {
syncer_event_.reset();
authwatcher_hookup_.reset();
-#if defined(OS_WINDOWS)
+#if defined(OS_WIN)
// Stop the address watch thread by signaling the exit flag.
// TODO(timsteele): Same as todo in Init().
SetEvent(address_watch_params_.exit_flag);
@@ -1356,6 +1358,7 @@ SyncManager::Status SyncManager::SyncInternal::ComputeAggregatedStatus() {
allstatus()->status().unsynced_count,
allstatus()->status().conflicting_count,
allstatus()->status().syncing,
+ false, // TODO(ncarter): remove syncer_paused
allstatus()->status().initial_sync_ended,
allstatus()->status().syncer_stuck,
allstatus()->status().updates_available,
diff --git a/chrome/browser/sync/engine/syncapi.h b/chrome/browser/sync/engine/syncapi.h
index b922318..a216465 100644
--- a/chrome/browser/sync/engine/syncapi.h
+++ b/chrome/browser/sync/engine/syncapi.h
@@ -39,8 +39,9 @@
#define CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_
#include "base/basictypes.h"
+#include "build/build_config.h"
-#if (defined(OS_WIN) || defined(OS_WINDOWS))
+#if defined(OS_WIN)
typedef wchar_t sync_char16;
#else
typedef uint16 sync_char16;
@@ -48,7 +49,7 @@ typedef uint16 sync_char16;
// The MSVC compiler for Windows requires that any classes exported by, or
// imported from, a dynamic library be decorated with the following fanciness.
-#if (defined(OS_WIN) || defined(OS_WINDOWS))
+#if defined(OS_WIN)
#if COMPILING_SYNCAPI_LIBRARY
#define SYNC_EXPORT __declspec(dllexport)
#elif COMPILING_SYNCAPI_STUB
@@ -58,7 +59,7 @@ typedef uint16 sync_char16;
#endif
#else
#define SYNC_EXPORT
-#endif // OS_WIN || OS_WINDOWS
+#endif // OS_WIN
// Forward declarations of internal class types so that sync API objects
// may have opaque pointers to these types.
diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc
index c96e587..e27437b 100644
--- a/chrome/browser/sync/engine/syncer_thread.cc
+++ b/chrome/browser/sync/engine/syncer_thread.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/sync/engine/syncer_thread.h"
+#include "build/build_config.h"
+
#ifdef OS_MACOSX
#include <CoreFoundation/CFNumber.h>
#include <IOKit/IOTypes.h>
@@ -34,7 +36,7 @@ namespace {
// Returns the amount of time since the user last interacted with the computer,
// in milliseconds
int UserIdleTime() {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
LASTINPUTINFO last_input_info;
last_input_info.cbSize = sizeof(LASTINPUTINFO);
diff --git a/chrome/browser/sync/engine/syncer_unittest.cc b/chrome/browser/sync/engine/syncer_unittest.cc
index 1c5f6a8..d9d520c 100644
--- a/chrome/browser/sync/engine/syncer_unittest.cc
+++ b/chrome/browser/sync/engine/syncer_unittest.cc
@@ -13,6 +13,7 @@
#include "base/at_exit.h"
#include "base/scoped_ptr.h"
+#include "build/build_config.h"
#include "chrome/browser/sync/engine/client_command_channel.h"
#include "chrome/browser/sync/engine/conflict_resolution_view.h"
#include "chrome/browser/sync/engine/conflict_resolver.h"
@@ -28,7 +29,7 @@
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/syncable/syncable.h"
#include "chrome/browser/sync/util/character_set_converters.h"
-#include "chrome/browser/sync/util/compat-file.h"
+#include "chrome/browser/sync/util/compat_file.h"
#include "chrome/browser/sync/util/event_sys-inl.h"
#include "chrome/test/sync/engine/mock_server_connection.h"
#include "chrome/test/sync/engine/test_directory_setter_upper.h"
@@ -934,7 +935,7 @@ TEST_F(SyncerTest, UpdateWithZeroLengthName) {
syncer_->SyncShare();
}
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
TEST_F(SyncerTest, NameSanitizationWithClientRename) {
ScopedDirLookup dir(syncdb_.manager(), syncdb_.name());
ASSERT_TRUE(dir.good());
diff --git a/chrome/browser/sync/engine/syncer_util.h b/chrome/browser/sync/engine/syncer_util.h
index a6e2f08..2a8fdb3 100644
--- a/chrome/browser/sync/engine/syncer_util.h
+++ b/chrome/browser/sync/engine/syncer_util.h
@@ -12,6 +12,7 @@
#include <string>
#include <vector>
+#include "build/build_config.h"
#include "chrome/browser/sync/engine/syncer.h"
#include "chrome/browser/sync/engine/syncer_types.h"
#include "chrome/browser/sync/syncable/syncable.h"
@@ -164,7 +165,7 @@ class SyncerUtil {
DISALLOW_COPY_AND_ASSIGN(SyncerUtil);
};
-#ifndef OS_WINDOWS
+#ifndef OS_WIN
// time.h on Linux and Mac both return seconds since the epoch, this should
// be converted to milliseconds.
diff --git a/chrome/browser/sync/glue/http_bridge.h b/chrome/browser/sync/glue/http_bridge.h
index b2f4cbf..90ffff6 100644
--- a/chrome/browser/sync/glue/http_bridge.h
+++ b/chrome/browser/sync/glue/http_bridge.h
@@ -63,9 +63,7 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>,
}
virtual bool AllowSendingCookies(const URLRequest* request) const {
- // TODO(chron): http://crbug.com/20182. Change this to return false once
- // all clients use Authenticate: header auth mode.
- return true;
+ return false;
}
private:
diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc
index b817a49..a61cba0 100644
--- a/chrome/browser/sync/glue/http_bridge_unittest.cc
+++ b/chrome/browser/sync/glue/http_bridge_unittest.cc
@@ -158,12 +158,7 @@ TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveComprehensive) {
EXPECT_EQ(0, http_bridge->GetResponseCookieCount());
std::string response(http_bridge->GetResponseContent(),
http_bridge->GetResponseContentLength());
-#if BUG_20182_FIXED
- // TODO(chron): Re-enable this expectation.
EXPECT_EQ(std::string::npos, response.find("Cookie:"));
-#else
- EXPECT_NE(std::string::npos, response.find("Cookie:"));
-#endif
EXPECT_NE(std::string::npos, response.find("User-Agent: bob"));
EXPECT_NE(std::string::npos, response.find(test_payload.c_str()));
}
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 14c8588..562d280 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -4,6 +4,7 @@
#ifdef CHROME_PERSONALIZATION
+#include "build/build_config.h"
#include "base/file_version_info.h"
#include "base/file_util.h"
#include "base/string_util.h"
diff --git a/chrome/browser/sync/notifier/base/win32/async_network_alive_win32.cc b/chrome/browser/sync/notifier/base/win/async_network_alive_win32.cc
index 9497b66..9497b66 100644
--- a/chrome/browser/sync/notifier/base/win32/async_network_alive_win32.cc
+++ b/chrome/browser/sync/notifier/base/win/async_network_alive_win32.cc
diff --git a/chrome/browser/sync/notifier/base/win32/time_win32.cc b/chrome/browser/sync/notifier/base/win/time_win32.cc
index e5c5713..e5c5713 100644
--- a/chrome/browser/sync/notifier/base/win32/time_win32.cc
+++ b/chrome/browser/sync/notifier/base/win/time_win32.cc
diff --git a/chrome/browser/sync/notifier/gaia_auth/win32window.cc b/chrome/browser/sync/notifier/gaia_auth/win/win32window.cc
index 25ea0a3..25ea0a3 100644
--- a/chrome/browser/sync/notifier/gaia_auth/win32window.cc
+++ b/chrome/browser/sync/notifier/gaia_auth/win/win32window.cc
diff --git a/chrome/browser/sync/syncable/directory_backing_store.cc b/chrome/browser/sync/syncable/directory_backing_store.cc
index 3735fff..68cc56b 100644
--- a/chrome/browser/sync/syncable/directory_backing_store.cc
+++ b/chrome/browser/sync/syncable/directory_backing_store.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/sync/syncable/directory_backing_store.h"
+#include "build/build_config.h"
+
#ifdef OS_MACOSX
#include <CoreFoundation/CoreFoundation.h>
#elif defined(OS_LINUX)
@@ -67,7 +69,7 @@ static void PathNameMatch16WithEscape(sqlite3_context* context,
}
static void RegisterPathNameCollate(sqlite3* dbhandle) {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
const int collate = SQLITE_UTF16;
#else
const int collate = SQLITE_UTF8;
@@ -85,12 +87,12 @@ static void RegisterPathNameMatch(sqlite3* dbhandle) {
// comparison on mac, so that would have to be fixed if
// we really wanted to use PathNameMatch on mac/linux w/ the
// same pattern strings as we do on windows.
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
CHECK(SQLITE_OK == sqlite3_create_function(dbhandle, "like",
2, SQLITE_ANY, NULL, &PathNameMatch16, NULL, NULL));
CHECK(SQLITE_OK == sqlite3_create_function(dbhandle, "like",
3, SQLITE_ANY, NULL, &PathNameMatch16WithEscape, NULL, NULL));
-#endif // OS_WINDOWS
+#endif // OS_WIN
}
static inline bool IsSqliteErrorOurFault(int result) {
diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc
index 23a7a2f..ef63f13 100644
--- a/chrome/browser/sync/syncable/syncable.cc
+++ b/chrome/browser/sync/syncable/syncable.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/sync/syncable/syncable.h"
+#include "build/build_config.h"
+
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
@@ -11,7 +13,7 @@
#include <CoreFoundation/CoreFoundation.h>
#elif defined(OS_LINUX)
#include <glib.h>
-#elif defined(OS_WINDOWS)
+#elif defined(OS_WIN)
#include <shlwapi.h> // for PathMatchSpec
#endif
@@ -36,7 +38,7 @@
#include "chrome/browser/sync/syncable/syncable_changes_version.h"
#include "chrome/browser/sync/syncable/syncable_columns.h"
#include "chrome/browser/sync/util/character_set_converters.h"
-#include "chrome/browser/sync/util/compat-file.h"
+#include "chrome/browser/sync/util/compat_file.h"
#include "chrome/browser/sync/util/crypto_helpers.h"
#include "chrome/browser/sync/util/event_sys-inl.h"
#include "chrome/browser/sync/util/fast_dump.h"
@@ -67,7 +69,7 @@ using std::string;
namespace syncable {
int64 Now() {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
FILETIME filetime;
SYSTEMTIME systime;
GetSystemTime(&systime);
@@ -91,7 +93,7 @@ int64 Now() {
// Callback for sqlite3
int ComparePathNames16(void*, int a_bytes, const void* a, int b_bytes,
const void* b) {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
DCHECK_EQ(0, a_bytes % 2);
DCHECK_EQ(0, b_bytes % 2);
int result = CompareString(LOCALE_INVARIANT, NORM_IGNORECASE,
@@ -252,7 +254,7 @@ Directory::~Directory() {
}
BOOL PathNameMatch(const PathString& pathname, const PathString& pathspec) {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
// Note that if we go Vista only this is easier:
// http://msdn2.microsoft.com/en-us/library/ms628611.aspx
@@ -1866,7 +1868,7 @@ void DBName::MakeNoncollidingForEntry(BaseTransaction* trans,
PathString GetFullPath(BaseTransaction* trans, const Entry& e) {
PathString result;
-#ifdef STL_MSVC
+#ifdef COMPILER_MSVC
result.reserve(MAX_PATH);
#endif
ReverseAppend(e.Get(NAME), &result);
diff --git a/chrome/browser/sync/syncable/syncable.h b/chrome/browser/sync/syncable/syncable.h
index 8a7a123..1d343f9 100644
--- a/chrome/browser/sync/syncable/syncable.h
+++ b/chrome/browser/sync/syncable/syncable.h
@@ -21,8 +21,8 @@
#include "chrome/browser/sync/syncable/directory_event.h"
#include "chrome/browser/sync/syncable/path_name_cmp.h"
#include "chrome/browser/sync/syncable/syncable_id.h"
-#include "chrome/browser/sync/util/compat-file.h"
-#include "chrome/browser/sync/util/compat-pthread.h"
+#include "chrome/browser/sync/util/compat_file.h"
+#include "chrome/browser/sync/util/compat_pthread.h"
#include "chrome/browser/sync/util/dbgq.h"
#include "chrome/browser/sync/util/event_sys.h"
#include "chrome/browser/sync/util/path_helpers.h"
diff --git a/chrome/browser/sync/syncable/syncable_unittest.cc b/chrome/browser/sync/syncable/syncable_unittest.cc
index 592c103..49424f9 100644
--- a/chrome/browser/sync/syncable/syncable_unittest.cc
+++ b/chrome/browser/sync/syncable/syncable_unittest.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/sync/syncable/syncable.h"
+#include "build/build_config.h"
+
#include <sys/types.h>
#include <iostream>
@@ -12,13 +14,13 @@
// TODO(ncarter): Winnow down the OS-specific includes from the test
// file.
-#if defined(OS_WINDOWS)
+#if defined(OS_WIN)
#include <tchar.h>
#include <atlbase.h>
#include <process.h>
-#endif // defined(OS_WINDOWS)
+#endif // defined(OS_WIN)
-#if !defined(OS_WINDOWS)
+#if !defined(OS_WIN)
#define MAX_PATH PATH_MAX
#include <strstream>
#include <ostream>
@@ -26,7 +28,7 @@
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/times.h>
-#endif // !defined(OS_WINDOWS)
+#endif // !defined(OS_WIN)
#include "base/at_exit.h"
#include "base/logging.h"
@@ -35,7 +37,7 @@
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/util/character_set_converters.h"
#include "chrome/browser/sync/util/closure.h"
-#include "chrome/browser/sync/util/compat-file.h"
+#include "chrome/browser/sync/util/compat_file.h"
#include "chrome/browser/sync/util/event_sys-inl.h"
#include "chrome/browser/sync/util/path_helpers.h"
#include "chrome/browser/sync/util/pthread_helpers.h"
@@ -981,7 +983,7 @@ timespec operator + (const timespec& a, const timespec& b) {
}
void SleepMs(int milliseconds) {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
Sleep(milliseconds);
#else
usleep(milliseconds * 1000);
@@ -1134,7 +1136,7 @@ TEST(Syncable, ComparePathNames) {
}
}
-#ifndef OS_WINDOWS
+#ifndef OS_WIN
// This table lists (to the best of my knowledge) every pair of characters
// in unicode such that:
// for all i: tolower(kUpperToLowerMap[i].upper) = kUpperToLowerMap[i].lower
@@ -1474,10 +1476,10 @@ TEST(Syncable, ComparePathNames) {
ADD_FAILURE() << msg.str();
}
}
-#endif // not defined OS_WINDOWS
+#endif // not defined OS_WIN
}
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
TEST(Syncable, PathNameMatch) {
// basic stuff, not too many otherwise we're testing the os.
EXPECT_TRUE(PathNameMatch(PSTR("bob"), PSTR("bob")));
@@ -1500,7 +1502,7 @@ TEST(Syncable, PathNameMatch) {
// other whitespace should give no matches.
EXPECT_FALSE(PathNameMatch(PSTR("bob"), PSTR("\tbob")));
}
-#endif // OS_WINDOWS
+#endif // OS_WIN
} // namespace
@@ -1532,7 +1534,7 @@ TEST_F(SyncableDirectoryTest, Bug1509232) {
} // namespace syncable
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
class LocalModule : public CAtlExeModuleT<LocalModule> { };
LocalModule module_;
diff --git a/chrome/browser/sync/util/character_set_converters-linux.cc b/chrome/browser/sync/util/character_set_converters_linux.cc
index 96ad1b6..96ad1b6 100644
--- a/chrome/browser/sync/util/character_set_converters-linux.cc
+++ b/chrome/browser/sync/util/character_set_converters_linux.cc
diff --git a/chrome/browser/sync/util/character_set_converters_unittest.cc b/chrome/browser/sync/util/character_set_converters_unittest.cc
index 838bbd1..b1aa604 100644
--- a/chrome/browser/sync/util/character_set_converters_unittest.cc
+++ b/chrome/browser/sync/util/character_set_converters_unittest.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/basictypes.h"
+#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
using browser_sync::ToPathString;
@@ -34,7 +35,7 @@ TEST_F(CharacterSetConverterTest, ASCIIConversionTest) {
ToPathString to_16(ascii);
ASSERT_TRUE(to_16.good());
ASSERT_TRUE(PathString(wide) == to_16.get_string16());
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
// On Linux, PathString is already UTF8
ASSERT_EQ(string(ascii), static_cast<string>(ToUTF8(wide)));
#endif
@@ -43,7 +44,7 @@ TEST_F(CharacterSetConverterTest, ASCIIConversionTest) {
// ASSERT_TRUE(wide == ToPathString(utf8).get_string16());
}
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
// On Linux, PathString is already UTF8
TEST_F(CharacterSetConverterTest, UnicodeConversionText) {
// Source data obtained by running od -b on files saved in utf-8 and unicode
@@ -107,7 +108,7 @@ TEST_F(CharacterSetConverterTest, AppendPathStringTests) {
ASSERT_TRUE(out == PathString(PSTR("onetwothree")));
}
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
namespace {
// See http://en.wikipedia.org/wiki/UTF-16 for an explanation of UTF16.
// For a test case we use the UTF-8 and UTF-16 encoding of char 119070
diff --git a/chrome/browser/sync/util/character_set_converters-win32.cc b/chrome/browser/sync/util/character_set_converters_win.cc
index ce1b882..ce1b882 100644
--- a/chrome/browser/sync/util/character_set_converters-win32.cc
+++ b/chrome/browser/sync/util/character_set_converters_win.cc
diff --git a/chrome/browser/sync/util/compat-file.h b/chrome/browser/sync/util/compat_file.h
index 5b9adf0..a2bbf78 100644
--- a/chrome/browser/sync/util/compat-file.h
+++ b/chrome/browser/sync/util/compat_file.h
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// File compatability routines. Useful to delete database files with.
+// File compatibility routines. Useful to delete database files with.
#ifndef CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_
#define CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_
@@ -10,6 +10,8 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
+
+#include "build/build_config.h"
#include "chrome/browser/sync/util/sync_types.h"
extern const PathChar* const kPathSeparator;
@@ -18,7 +20,7 @@ extern const PathChar* const kPathSeparator;
// Returns 0 on success, non-zero on failure.
int PathRemove(const PathString& path);
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
inline int PathRemove(const PathString& path) {
return _wremove(path.c_str());
}
diff --git a/chrome/browser/sync/util/compat-file-posix.cc b/chrome/browser/sync/util/compat_file_posix.cc
index 66582fa..aecc2bb 100644
--- a/chrome/browser/sync/util/compat-file-posix.cc
+++ b/chrome/browser/sync/util/compat_file_posix.cc
@@ -6,7 +6,7 @@
#error Compile this file on Mac OS X or Linux only.
#endif
-#include "chrome/browser/sync/util/compat-file.h"
+#include "chrome/browser/sync/util/compat_file.h"
const char* const kPathSeparator = "/";
diff --git a/chrome/browser/sync/util/compat-file-win.cc b/chrome/browser/sync/util/compat_file_win.cc
index d812d68..0c34cd8 100644
--- a/chrome/browser/sync/util/compat-file-win.cc
+++ b/chrome/browser/sync/util/compat_file_win.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef OS_WINDOWS
-#error Compile this file on Windows only.
-#endif
+#include "chrome/browser/sync/util/compat_file.h"
-#include "chrome/browser/sync/util/compat-file.h"
+#include "build/build_config.h"
-#include <windows.h>
+#ifndef OS_WIN
+#error Compile this file on Windows only.
+#endif
const wchar_t* const kPathSeparator = L"\\";
diff --git a/chrome/browser/sync/util/compat-pthread.h b/chrome/browser/sync/util/compat_pthread.h
index ee08691..3ea6a83 100644
--- a/chrome/browser/sync/util/compat-pthread.h
+++ b/chrome/browser/sync/util/compat_pthread.h
@@ -3,22 +3,23 @@
// found in the LICENSE file.
//
// Pthread compatability routines.
+// TODO(timsteele): This file is deprecated. Use PlatformThread.
#ifndef CHROME_BROWSER_SYNC_UTIL_COMPAT_PTHREAD_H_
#define CHROME_BROWSER_SYNC_UTIL_COMPAT_PTHREAD_H_
-// TODO(timsteele): This file is deprecated. Use PlatformThread.
#include "base/platform_thread.h"
+#include "build/build_config.h"
#define ThreadId PlatformThreadId
-#ifndef OS_WINDOWS
+#ifndef OS_WIN
inline ThreadId GetCurrentThreadId() {
return PlatformThread::CurrentId();
}
-#endif // OS_WINDOWS
+#endif // OS_WIN
-#if (!defined(OS_WINDOWS) && !defined(OS_MACOSX))
+#if (!defined(OS_WIN) && !defined(OS_MACOSX))
// TODO(timsteele): What the heck is this?
inline int sem_post_multiple(sem_t* sem, int number) {
int i;
@@ -33,6 +34,6 @@ inline int sem_post_multiple(sem_t* sem, int number) {
}
return 0;
}
-#endif // (!defined(OS_WINDOWS) && !defined(OS_MACOSX))
+#endif // (!defined(OS_WIN) && !defined(OS_MACOSX))
#endif // CHROME_BROWSER_SYNC_UTIL_COMPAT_PTHREAD_H_
diff --git a/chrome/browser/sync/util/event_sys-inl.h b/chrome/browser/sync/util/event_sys-inl.h
index 062357d..3b5c944 100644
--- a/chrome/browser/sync/util/event_sys-inl.h
+++ b/chrome/browser/sync/util/event_sys-inl.h
@@ -11,7 +11,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/port.h"
-#include "chrome/browser/sync/util/compat-pthread.h"
+#include "chrome/browser/sync/util/compat_pthread.h"
#include "chrome/browser/sync/util/event_sys.h"
#include "chrome/browser/sync/util/pthread_helpers.h"
#include "chrome/browser/sync/util/sync_types.h"
diff --git a/chrome/browser/sync/util/event_sys_unittest.cc b/chrome/browser/sync/util/event_sys_unittest.cc
index fa8d2ae..0e1b112 100644
--- a/chrome/browser/sync/util/event_sys_unittest.cc
+++ b/chrome/browser/sync/util/event_sys_unittest.cc
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/port.h"
+#include "build/build_config.h"
#include "chrome/browser/sync/util/event_sys-inl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -222,7 +223,7 @@ class ThreadTester : public EventListener<TestEvent> {
remove_event_mutex_.Unlock();
// Windows and posix use different functions to sleep.
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
Sleep(1);
#else
sleep(1);
diff --git a/chrome/browser/sync/util/highres_timer.h b/chrome/browser/sync/util/highres_timer.h
index e2bde4e..138da04 100644
--- a/chrome/browser/sync/util/highres_timer.h
+++ b/chrome/browser/sync/util/highres_timer.h
@@ -4,10 +4,12 @@
//
// High resolution timer functions defined for each OS.
-#if defined(OS_WINDOWS)
-#include "chrome/browser/sync/util/highres_timer-win32.h"
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
+#include "chrome/browser/sync/util/highres_timer_win.h"
#elif defined(OS_MACOSX)
#error "Mac timer functions are missing."
#else
-#include "chrome/browser/sync/util/highres_timer-linux.h"
+#include "chrome/browser/sync/util/highres_timer_linux.h"
#endif
diff --git a/chrome/browser/sync/util/highres_timer-linux.cc b/chrome/browser/sync/util/highres_timer_linux.cc
index 77350f9..77350f9 100644
--- a/chrome/browser/sync/util/highres_timer-linux.cc
+++ b/chrome/browser/sync/util/highres_timer_linux.cc
diff --git a/chrome/browser/sync/util/highres_timer-linux.h b/chrome/browser/sync/util/highres_timer_linux.h
index 01a022d..01a022d 100644
--- a/chrome/browser/sync/util/highres_timer-linux.h
+++ b/chrome/browser/sync/util/highres_timer_linux.h
diff --git a/chrome/browser/sync/util/highres_timer_unittest.cc b/chrome/browser/sync/util/highres_timer_unittest.cc
index 838f56e..6e9c360 100644
--- a/chrome/browser/sync/util/highres_timer_unittest.cc
+++ b/chrome/browser/sync/util/highres_timer_unittest.cc
@@ -5,6 +5,7 @@
// High resolution timer unit tests.
#include "base/basictypes.h"
+#include "build/build_config.h"
#include "chrome/browser/sync/util/highres_timer.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -30,7 +31,7 @@ TEST(HighresTimer, DISABLED_SecondClock) {
HighresTimer timer;
EXPECT_EQ(0, timer.GetElapsedSec());
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
::Sleep(250);
#else
struct timespec ts1 = {0, 250000000};
@@ -39,7 +40,7 @@ TEST(HighresTimer, DISABLED_SecondClock) {
EXPECT_EQ(0, timer.GetElapsedSec());
EXPECT_LE(230, timer.GetElapsedMs());
EXPECT_GE(270, timer.GetElapsedMs());
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
::Sleep(251);
#else
struct timespec ts2 = {0, 251000000};
diff --git a/chrome/browser/sync/util/highres_timer-win32.cc b/chrome/browser/sync/util/highres_timer_win.cc
index 0d7323a..0d7323a 100644
--- a/chrome/browser/sync/util/highres_timer-win32.cc
+++ b/chrome/browser/sync/util/highres_timer_win.cc
diff --git a/chrome/browser/sync/util/highres_timer-win32.h b/chrome/browser/sync/util/highres_timer_win.h
index 6e87ce9..d03a872 100644
--- a/chrome/browser/sync/util/highres_timer-win32.h
+++ b/chrome/browser/sync/util/highres_timer_win.h
@@ -4,8 +4,8 @@
//
// High resolution timer functions for use in Windows.
-#ifndef CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN32_H_
-#define CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN32_H_
+#ifndef CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN_H_
+#define CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN_H_
#include <windows.h>
@@ -75,4 +75,4 @@ inline ULONGLONG HighresTimer::GetElapsedTicks() const {
return start_ticks_ - GetCurrentTicks();
}
-#endif // CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN32_H_
+#endif // CHROME_BROWSER_SYNC_UTIL_HIGHRES_TIMER_WIN_H_
diff --git a/chrome/browser/sync/util/path_helpers.cc b/chrome/browser/sync/util/path_helpers.cc
index e0a20ef..a132086 100644
--- a/chrome/browser/sync/util/path_helpers.cc
+++ b/chrome/browser/sync/util/path_helpers.cc
@@ -9,19 +9,20 @@
#include "base/logging.h"
#include "base/port.h"
+#include "build/build_config.h"
#include "chrome/browser/sync/syncable/syncable.h"
-#ifndef OS_WINDOWS
+#ifndef OS_WIN
#error Compile this file on Windows only.
#endif
using std::string;
-#if OS_WINDOWS
+#if OS_WIN
const char PATH_SEPARATOR = '\\';
#else
const char PATH_SEPARATOR = '/';
-#endif // OS_WINDOWS
+#endif // OS_WIN
static PathString RemoveTrailingSlashes16(PathString str) {
diff --git a/chrome/browser/sync/util/path_helpers.h b/chrome/browser/sync/util/path_helpers.h
index c6f55b7..e6976a8 100644
--- a/chrome/browser/sync/util/path_helpers.h
+++ b/chrome/browser/sync/util/path_helpers.h
@@ -9,7 +9,7 @@
#include <iterator>
#include <string>
-#include "chrome/browser/sync/util/compat-file.h"
+#include "chrome/browser/sync/util/compat_file.h"
#include "chrome/browser/sync/util/sync_types.h"
template <typename StringType>
diff --git a/chrome/browser/sync/util/path_helpers-linux.cc b/chrome/browser/sync/util/path_helpers_linux.cc
index 2448f09..2448f09 100644
--- a/chrome/browser/sync/util/path_helpers-linux.cc
+++ b/chrome/browser/sync/util/path_helpers_linux.cc
diff --git a/chrome/browser/sync/util/path_helpers-posix.cc b/chrome/browser/sync/util/path_helpers_posix.cc
index e8f7fd3..e8f7fd3 100644
--- a/chrome/browser/sync/util/path_helpers-posix.cc
+++ b/chrome/browser/sync/util/path_helpers_posix.cc
diff --git a/chrome/browser/sync/util/path_helpers_unittest.cc b/chrome/browser/sync/util/path_helpers_unittest.cc
index 75a81a2..827e2c3 100644
--- a/chrome/browser/sync/util/path_helpers_unittest.cc
+++ b/chrome/browser/sync/util/path_helpers_unittest.cc
@@ -4,6 +4,7 @@
#include "base/logging.h"
#include "base/port.h"
+#include "build/build_config.h"
#include "chrome/browser/sync/syncable/path_name_cmp.h"
#include "chrome/browser/sync/util/path_helpers.h"
#include "chrome/browser/sync/util/sync_types.h"
@@ -64,7 +65,7 @@ TEST(PathHelpersTest, PathStrutil) {
}
TEST(PathHelpersTest, SanitizePathComponent) {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
EXPECT_EQ(MakePathComponentOSLegal(L"bar"), L"");
EXPECT_EQ(MakePathComponentOSLegal(L"bar <"), L"bar");
EXPECT_EQ(MakePathComponentOSLegal(L"bar.<"), L"bar");
@@ -116,7 +117,7 @@ TEST(PathHelpersTest, SanitizePathComponent) {
EXPECT_EQ(MakePathComponentOSLegal(L"<.<"), L"~1");
EXPECT_EQ(MakePathComponentOSLegal(L"<.<txt"), L".txt");
EXPECT_EQ(MakePathComponentOSLegal(L"txt<.<"), L"txt");
-#else // OS_WINDOWS
+#else // OS_WIN
EXPECT_EQ(MakePathComponentOSLegal("bar"), "");
EXPECT_EQ(MakePathComponentOSLegal("b"), "");
@@ -125,7 +126,7 @@ TEST(PathHelpersTest, SanitizePathComponent) {
EXPECT_EQ(MakePathComponentOSLegal("/"), ":");
EXPECT_EQ(MakePathComponentOSLegal(":"), "");
-#endif // OS_WINDOWS
+#endif // OS_WIN
}
} // namespace syncable
diff --git a/chrome/browser/sync/util/pthread_helpers.cc b/chrome/browser/sync/util/pthread_helpers.cc
index e0acd3e..809f5f6 100644
--- a/chrome/browser/sync/util/pthread_helpers.cc
+++ b/chrome/browser/sync/util/pthread_helpers.cc
@@ -14,7 +14,7 @@
#include "base/scoped_ptr.h"
#include "chrome/browser/sync/protocol/service_constants.h"
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
namespace {
@@ -60,10 +60,10 @@ void* ThreadMainProc(void* parameter) {
} // namespace
-#endif // OS_WINDOWS
+#endif // OS_WIN
thread_handle CreatePThread(void *(*start) (void *), void* parameter) {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
scoped_ptr<ThreadStartParams> param(new ThreadStartParams);
if (NULL == param.get())
return NULL;
@@ -98,11 +98,11 @@ thread_handle CreatePThread(void *(*start) (void *), void* parameter) {
} else {
return 0;
}
-#endif // OS_WINDOWS
+#endif // OS_WIN
}
struct timespec GetPThreadAbsoluteTime(uint32 ms) {
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
FILETIME filenow;
GetSystemTimeAsFileTime(&filenow);
ULARGE_INTEGER n;
@@ -130,11 +130,11 @@ struct timespec GetPThreadAbsoluteTime(uint32 ms) {
deadline.tv_sec += ms / 1000;
deadline.tv_nsec = (ms % 1000) * 1000000;
return deadline;
-#endif // OS_WINDOWS
+#endif // OS_WIN
}
void NameCurrentThreadForDebugging(char* name) {
-#if defined(OS_WINDOWS)
+#if defined(OS_WIN)
// This implementation is taken from Chromium's platform_thread framework.
// The information on how to set the thread name comes from a MSDN article:
// http://msdn2.microsoft.com/en-us/library/xcb2z8hs.aspx
@@ -158,5 +158,5 @@ void NameCurrentThreadForDebugging(char* name) {
reinterpret_cast<DWORD_PTR*>(&info));
} __except(EXCEPTION_CONTINUE_EXECUTION) {
}
-#endif // defined(OS_WINDOWS)
+#endif // defined(OS_WIN)
}
diff --git a/chrome/browser/sync/util/pthread_helpers.h b/chrome/browser/sync/util/pthread_helpers.h
index 26defe0..c231f67 100644
--- a/chrome/browser/sync/util/pthread_helpers.h
+++ b/chrome/browser/sync/util/pthread_helpers.h
@@ -7,8 +7,9 @@
#include <pthread.h>
#include "base/logging.h"
+#include "build/build_config.h"
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
typedef void* thread_handle;
#else
typedef pthread_t thread_handle;
diff --git a/chrome/browser/sync/util/query_helpers.cc b/chrome/browser/sync/util/query_helpers.cc
index 59adcb9..34dc79f 100644
--- a/chrome/browser/sync/util/query_helpers.cc
+++ b/chrome/browser/sync/util/query_helpers.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/sync/util/query_helpers.h"
-#if defined(OS_WINDOWS)
+#if defined(OS_WIN)
#include <windows.h>
#endif
@@ -65,7 +65,7 @@ int SqliteOpen(PathString filename, sqlite3** db) {
(filename.c_str(), db);
LOG_IF(ERROR, SQLITE_OK != result) << "Error opening " << filename << ": "
<< result;
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
if (SQLITE_OK == result) {
// Make sure we mark the db file as not indexed so since if any other app
// opens it, it can break our db locking.
@@ -76,7 +76,7 @@ int SqliteOpen(PathString filename, sqlite3** db) {
attrs = attrs | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
SetFileAttributes(filename.c_str(), attrs);
}
-#endif // OS_WINDOWS
+#endif // OS_WIN
// Be patient as we set pragmas.
sqlite3_busy_timeout(*db, numeric_limits<int>::max());
#ifndef DISABLE_SQLITE_FULL_FSYNC
diff --git a/chrome/browser/sync/util/query_helpers.h b/chrome/browser/sync/util/query_helpers.h
index 73aa422..0aee3ad 100644
--- a/chrome/browser/sync/util/query_helpers.h
+++ b/chrome/browser/sync/util/query_helpers.h
@@ -13,6 +13,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
+#include "build/build_config.h"
#include "chrome/browser/sync/util/sync_types.h"
#include "third_party/sqlite/preprocessed/sqlite3.h"
diff --git a/chrome/browser/sync/util/query_helpers_unittest.cc b/chrome/browser/sync/util/query_helpers_unittest.cc
index 8be295d..0fb86e2 100644
--- a/chrome/browser/sync/util/query_helpers_unittest.cc
+++ b/chrome/browser/sync/util/query_helpers_unittest.cc
@@ -7,7 +7,7 @@
#include <limits>
#include <string>
-#include "chrome/browser/sync/util/compat-file.h"
+#include "chrome/browser/sync/util/compat_file.h"
#include "testing/gtest/include/gtest/gtest.h"
using std::numeric_limits;
diff --git a/chrome/browser/sync/util/sync_types.h b/chrome/browser/sync/util/sync_types.h
index 7a08575..02dad41 100644
--- a/chrome/browser/sync/util/sync_types.h
+++ b/chrome/browser/sync/util/sync_types.h
@@ -10,9 +10,10 @@
#include "base/basictypes.h"
#include "base/string_util.h"
+#include "build/build_config.h"
// TODO(timsteele): Use base/file_path.h instead of PathString.
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
#define PATHSTRING_IS_STD_STRING 0
typedef std::wstring PathString;
diff --git a/chrome/browser/sync/util/user_settings.cc b/chrome/browser/sync/util/user_settings.cc
index 8408b92..d9ff1bd 100644
--- a/chrome/browser/sync/util/user_settings.cc
+++ b/chrome/browser/sync/util/user_settings.cc
@@ -7,7 +7,9 @@
#include "chrome/browser/sync/util/user_settings.h"
-#if defined(OS_WINDOWS)
+#include "build/build_config.h"
+
+#if defined(OS_WIN)
#include <windows.h>
#endif
@@ -178,7 +180,7 @@ bool UserSettings::Init(const PathString& settings_path) {
}
ExecOrDie(dbhandle.get(), "COMMIT TRANSACTION");
}
-#ifdef OS_WINDOWS
+#ifdef OS_WIN
// Do not index this file. Scanning can occur every time we close the file,
// which causes long delays in SQLite's file locking.
const DWORD attrs = GetFileAttributes(settings_path.c_str());
diff --git a/chrome/browser/sync/util/user_settings.h b/chrome/browser/sync/util/user_settings.h
index f8f1ee4..303397a 100644
--- a/chrome/browser/sync/util/user_settings.h
+++ b/chrome/browser/sync/util/user_settings.h
@@ -9,6 +9,7 @@
#include <set>
#include <string>
+#include "build/build_config.h"
#include "chrome/browser/sync/util/pthread_helpers.h"
#include "chrome/browser/sync/util/signin.h"
#include "chrome/browser/sync/util/sync_types.h"
@@ -100,10 +101,10 @@ class UserSettings {
// TODO(sync): Use in-memory cache for service auth tokens on posix.
// Have someone competent in Windows switch it over to not use Sqlite in the
// future.
-#ifndef OS_WINDOWS
+#ifndef OS_WIN
typedef std::map<std::string, std::string> ServiceTokenMap;
ServiceTokenMap service_tokens_;
-#endif // OS_WINDOWS
+#endif // OS_WIN
DISALLOW_COPY_AND_ASSIGN(UserSettings);
};
diff --git a/chrome/browser/sync/util/user_settings-posix.cc b/chrome/browser/sync/util/user_settings_posix.cc
index 736d2d1..736d2d1 100644
--- a/chrome/browser/sync/util/user_settings-posix.cc
+++ b/chrome/browser/sync/util/user_settings_posix.cc
diff --git a/chrome/browser/sync/util/user_settings-win32.cc b/chrome/browser/sync/util/user_settings_win.cc
index 9895651..9895651 100644
--- a/chrome/browser/sync/util/user_settings-win32.cc
+++ b/chrome/browser/sync/util/user_settings_win.cc
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 5a7081e..2507e3a 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -22,6 +22,7 @@
'../webkit/webkit.gyp:inspector_resources',
],
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
+ 'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
# TODO(mmoss) This might need to go somewhere more general, then we can use
# it to also rewrite app/locales/locales.gyp with a helper script.
# NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
@@ -4484,7 +4485,7 @@
# Build a stub library.
'type': 'shared_library',
'defines': [
- 'COMPILING_SYNCAPI_LIBRARY'
+ 'COMPILING_SYNCAPI_LIBRARY',
],
'sources': [
'browser/sync/engine/syncapi_stub.cc',
@@ -4497,47 +4498,50 @@
],
}],
['chrome_personalization==1 and use_syncapi_stub==0', {
- 'type': 'none',
+ 'type': 'shared_library',
+ 'sources': [
+ 'browser/sync/engine/syncapi.cc',
+ ],
+ 'include_dirs': [
+ '..',
+ '<(protoc_out_dir)',
+ ],
+ 'defines' : [
+ 'COMPILER_MSVC',
+ 'COMPILING_SYNCAPI_LIBRARY',
+ '_CRT_SECURE_NO_WARNINGS',
+ '_USE_32BIT_TIME_T',
+ ],
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../build/temp_gyp/googleurl.gyp:googleurl',
+ '../net/net.gyp:net',
+ '../third_party/icu/icu.gyp:icuuc',
+ '../third_party/libjingle/libjingle.gyp:libjingle',
+ '../third_party/protobuf2/protobuf.gyp:protobuf',
+ '../third_party/sqlite/sqlite.gyp:sqlite',
+ 'notifier',
+ 'sync',
+ ],
'conditions': [
- # Linux-specific rules for using syncapi binaries.
- ['OS=="linux"', {
- # TODO(timsteele): Not sure if this linux-specific stuff
- # works anymore.
- 'copies': [
- {
- 'destination': '<(PRODUCT_DIR)/lib',
- 'files': [
- 'personalization/sync/engine/<(CONFIGURATION_NAME)/libsyncapi.so',
- ],
+ ['OS=="win"', {
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'ImportLibrary': '$(OutDir)\\lib\\syncapi.lib',
+ 'ProgramDatabaseFile': '$(OutDir)\\syncapi_dll.pdb',
},
- ],
+ },
'link_settings': {
'libraries': [
- '-lsyncapi',
- ],
+ '-lcrypt32.lib',
+ '-liphlpapi.lib',
+ '-lsecur32.lib',
+ ]
},
- }], # OS=="linux"
- # Windows-specific rules for using syncapi binaries.
- ['OS=="win"', {
- 'direct_dependent_settings': {
- 'link_settings': {
- 'libraries': [
- 'personalization/sync/engine/<(CONFIGURATION_NAME)/syncapi.lib',
- ],
- },
- },
- 'copies': [
- {
- 'destination': '<(PRODUCT_DIR)',
- 'files': [
- 'personalization/sync/engine/<(CONFIGURATION_NAME)/syncapi.dll',
- 'personalization/sync/engine/<(CONFIGURATION_NAME)/syncapi_dll.pdb',
- 'personalization/sync/engine/<(CONFIGURATION_NAME)/pthreads.dll',
- 'personalization/sync/engine/<(CONFIGURATION_NAME)/pthreads_dll.pdb',
- ],
- },
+ 'dependencies': [
+ '../third_party/pthreads-win32/pthreads.gyp:pthreads',
],
- }], # OS=="win"
+ }],
],
}],
['chrome_personalization==1 and OS=="win"', {
@@ -6145,5 +6149,313 @@
},
]
}],
+ ['chrome_personalization==1 and use_syncapi_stub==0', {
+ # These targets get built only where sync is supported.
+ 'targets': [
+ {
+ # Protobuf compiler / generate rule for sync.proto
+ 'target_name': 'sync_proto',
+ 'type': 'none',
+ 'actions': [
+ {
+ # TODO(chron): Remove this preprocessing step.
+ 'action_name': 'preprocessing sync.proto',
+ 'inputs': [
+ 'browser/sync/protocol/proto2_to_oproto.py',
+ 'browser/sync/protocol/sync.proto',
+ ],
+ 'outputs': [
+ '<(protoc_out_dir)/chrome/browser/sync/protocol/sync.proto',
+ ],
+ 'action': [
+ 'python',
+ 'browser/sync/protocol/proto2_to_oproto.py',
+ 'browser/sync/protocol/sync.proto',
+ '<(protoc_out_dir)/chrome/browser/sync/protocol/sync.proto',
+ ],
+ },
+ {
+ 'action_name': 'compiling sync.proto',
+ 'inputs': [
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
+ '<(protoc_out_dir)/chrome/browser/sync/protocol/sync.proto',
+ ],
+ 'outputs': [
+ '<(protoc_out_dir)/chrome/browser/sync/protocol/sync.pb.cc',
+ '<(protoc_out_dir)/chrome/browser/sync/protocol/sync.pb.h',
+ ],
+ 'action': [
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
+ '--proto_path=<(protoc_out_dir)/chrome/browser/sync/protocol',
+ '<(protoc_out_dir)/chrome/browser/sync/protocol/sync.proto',
+ '--cpp_out=<(protoc_out_dir)/chrome/browser/sync/protocol',
+ ],
+ },
+ ],
+ 'dependencies': [
+ '../third_party/protobuf2/protobuf.gyp:protobuf',
+ '../third_party/protobuf2/protobuf.gyp:protoc',
+ ],
+ },
+ {
+ 'target_name': 'notifier',
+ 'type': '<(library)',
+ 'sources': [
+ 'browser/sync/notifier/base/async_dns_lookup.cc',
+ 'browser/sync/notifier/base/async_dns_lookup.h',
+ 'browser/sync/notifier/base/async_network_alive.h',
+ 'browser/sync/notifier/base/fastalloc.h',
+ 'browser/sync/notifier/base/linux/network_status_detector_task_linux.cc',
+ 'browser/sync/notifier/base/linux/time_linux.cc',
+ 'browser/sync/notifier/base/nethelpers.cc',
+ 'browser/sync/notifier/base/nethelpers.h',
+ 'browser/sync/notifier/base/network_status_detector_task.cc',
+ 'browser/sync/notifier/base/network_status_detector_task.h',
+ 'browser/sync/notifier/base/network_status_detector_task_mt.cc',
+ 'browser/sync/notifier/base/network_status_detector_task_mt.h',
+ 'browser/sync/notifier/base/posix/time_posix.cc',
+ 'browser/sync/notifier/base/signal_thread_task.h',
+ 'browser/sync/notifier/base/static_assert.h',
+ 'browser/sync/notifier/base/string.cc',
+ 'browser/sync/notifier/base/string.h',
+ 'browser/sync/notifier/base/task_pump.cc',
+ 'browser/sync/notifier/base/task_pump.h',
+ 'browser/sync/notifier/base/time.cc',
+ 'browser/sync/notifier/base/time.h',
+ 'browser/sync/notifier/base/timer.cc',
+ 'browser/sync/notifier/base/timer.h',
+ 'browser/sync/notifier/base/utils.h',
+ 'browser/sync/notifier/base/win/async_network_alive_win32.cc',
+ 'browser/sync/notifier/base/win/time_win32.cc',
+ 'browser/sync/notifier/communicator/auth_task.cc',
+ 'browser/sync/notifier/communicator/auth_task.h',
+ 'browser/sync/notifier/communicator/auto_reconnect.cc',
+ 'browser/sync/notifier/communicator/auto_reconnect.h',
+ 'browser/sync/notifier/communicator/connection_options.cc',
+ 'browser/sync/notifier/communicator/connection_options.h',
+ 'browser/sync/notifier/communicator/connection_settings.cc',
+ 'browser/sync/notifier/communicator/connection_settings.h',
+ 'browser/sync/notifier/communicator/const_communicator.h',
+ 'browser/sync/notifier/communicator/login.cc',
+ 'browser/sync/notifier/communicator/login.h',
+ 'browser/sync/notifier/communicator/login_failure.cc',
+ 'browser/sync/notifier/communicator/login_failure.h',
+ 'browser/sync/notifier/communicator/login_settings.cc',
+ 'browser/sync/notifier/communicator/login_settings.h',
+ 'browser/sync/notifier/communicator/product_info.cc',
+ 'browser/sync/notifier/communicator/product_info.h',
+ 'browser/sync/notifier/communicator/single_login_attempt.cc',
+ 'browser/sync/notifier/communicator/single_login_attempt.h',
+ 'browser/sync/notifier/communicator/talk_auth_task.cc',
+ 'browser/sync/notifier/communicator/talk_auth_task.h',
+ 'browser/sync/notifier/communicator/xml_parse_helpers-inl.h',
+ 'browser/sync/notifier/communicator/xml_parse_helpers.cc',
+ 'browser/sync/notifier/communicator/xml_parse_helpers.h',
+ 'browser/sync/notifier/communicator/xmpp_connection_generator.cc',
+ 'browser/sync/notifier/communicator/xmpp_connection_generator.h',
+ 'browser/sync/notifier/communicator/xmpp_log.cc',
+ 'browser/sync/notifier/communicator/xmpp_log.h',
+ 'browser/sync/notifier/communicator/xmpp_socket_adapter.cc',
+ 'browser/sync/notifier/communicator/xmpp_socket_adapter.h',
+ 'browser/sync/notifier/gaia_auth/gaiaauth.cc',
+ 'browser/sync/notifier/gaia_auth/gaiaauth.h',
+ 'browser/sync/notifier/gaia_auth/gaiahelper.cc',
+ 'browser/sync/notifier/gaia_auth/gaiahelper.h',
+ 'browser/sync/notifier/gaia_auth/inet_aton.h',
+ 'browser/sync/notifier/gaia_auth/sigslotrepeater.h',
+ 'browser/sync/notifier/gaia_auth/win/win32window.cc',
+ 'browser/sync/notifier/listener/listen_task.cc',
+ 'browser/sync/notifier/listener/listen_task.h',
+ 'browser/sync/notifier/listener/mediator_thread.h',
+ 'browser/sync/notifier/listener/mediator_thread_impl.cc',
+ 'browser/sync/notifier/listener/mediator_thread_impl.h',
+ 'browser/sync/notifier/listener/mediator_thread_mock.h',
+ 'browser/sync/notifier/listener/send_update_task.cc',
+ 'browser/sync/notifier/listener/send_update_task.h',
+ 'browser/sync/notifier/listener/subscribe_task.cc',
+ 'browser/sync/notifier/listener/subscribe_task.h',
+ 'browser/sync/notifier/listener/talk_mediator.h',
+ 'browser/sync/notifier/listener/talk_mediator_impl.cc',
+ 'browser/sync/notifier/listener/talk_mediator_impl.h',
+ ],
+ 'include_dirs': [
+ '..',
+ '<(protoc_out_dir)',
+ ],
+ 'defines' : [
+ 'COMPILER_MSVC',
+ '_CRT_SECURE_NO_WARNINGS',
+ '_USE_32BIT_TIME_T',
+ 'kXmppProductName="chromium-sync"',
+ ],
+ 'dependencies': [
+ '../third_party/expat/expat.gyp:expat',
+ '../third_party/libjingle/libjingle.gyp:libjingle',
+ '../third_party/protobuf2/protobuf.gyp:protobuf',
+ 'sync_proto',
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'dependencies': [
+ '../third_party/pthreads-win32/pthreads.gyp:pthreads',
+ ],
+ }],
+ ],
+ },
+ {
+ 'target_name': 'sync',
+ 'type': '<(library)',
+ 'sources': [
+ '<(protoc_out_dir)/chrome/browser/sync/protocol/sync.pb.cc',
+ '<(protoc_out_dir)/chrome/browser/sync/protocol/sync.pb.h',
+ 'browser/sync/engine/all_status.cc',
+ 'browser/sync/engine/all_status.h',
+ 'browser/sync/engine/apply_updates_command.cc',
+ 'browser/sync/engine/apply_updates_command.h',
+ 'browser/sync/engine/auth_watcher.cc',
+ 'browser/sync/engine/auth_watcher.h',
+ 'browser/sync/engine/authenticator.cc',
+ 'browser/sync/engine/authenticator.h',
+ 'browser/sync/engine/build_and_process_conflict_sets_command.cc',
+ 'browser/sync/engine/build_and_process_conflict_sets_command.h',
+ 'browser/sync/engine/build_commit_command.cc',
+ 'browser/sync/engine/build_commit_command.h',
+ 'browser/sync/engine/change_reorder_buffer.cc',
+ 'browser/sync/engine/change_reorder_buffer.h',
+ 'browser/sync/engine/client_command_channel.h',
+ 'browser/sync/engine/conflict_resolution_view.cc',
+ 'browser/sync/engine/conflict_resolution_view.h',
+ 'browser/sync/engine/conflict_resolver.cc',
+ 'browser/sync/engine/conflict_resolver.h',
+ 'browser/sync/engine/download_updates_command.cc',
+ 'browser/sync/engine/download_updates_command.h',
+ 'browser/sync/engine/get_commit_ids_command.cc',
+ 'browser/sync/engine/get_commit_ids_command.h',
+ 'browser/sync/engine/model_changing_syncer_command.cc',
+ 'browser/sync/engine/model_changing_syncer_command.h',
+ 'browser/sync/engine/model_safe_worker.h',
+ 'browser/sync/engine/net/gaia_authenticator.cc',
+ 'browser/sync/engine/net/gaia_authenticator.h',
+ 'browser/sync/engine/net/http_return.h',
+ 'browser/sync/engine/net/server_connection_manager.cc',
+ 'browser/sync/engine/net/server_connection_manager.h',
+ 'browser/sync/engine/net/syncapi_server_connection_manager.cc',
+ 'browser/sync/engine/net/syncapi_server_connection_manager.h',
+ 'browser/sync/engine/net/url_translator.cc',
+ 'browser/sync/engine/net/url_translator.h',
+ 'browser/sync/engine/post_commit_message_command.cc',
+ 'browser/sync/engine/post_commit_message_command.h',
+ 'browser/sync/engine/process_commit_response_command.cc',
+ 'browser/sync/engine/process_commit_response_command.h',
+ 'browser/sync/engine/process_updates_command.cc',
+ 'browser/sync/engine/process_updates_command.h',
+ 'browser/sync/engine/resolve_conflicts_command.cc',
+ 'browser/sync/engine/resolve_conflicts_command.h',
+ 'browser/sync/engine/sync_cycle_state.h',
+ 'browser/sync/engine/sync_process_state.cc',
+ 'browser/sync/engine/sync_process_state.h',
+ 'browser/sync/engine/syncapi.h',
+ 'browser/sync/engine/syncer.cc',
+ 'browser/sync/engine/syncer.h',
+ 'browser/sync/engine/syncer_command.cc',
+ 'browser/sync/engine/syncer_command.h',
+ 'browser/sync/engine/syncer_end_command.cc',
+ 'browser/sync/engine/syncer_end_command.h',
+ 'browser/sync/engine/syncer_proto_util.cc',
+ 'browser/sync/engine/syncer_proto_util.h',
+ 'browser/sync/engine/syncer_session.h',
+ 'browser/sync/engine/syncer_status.cc',
+ 'browser/sync/engine/syncer_status.h',
+ 'browser/sync/engine/syncer_thread.cc',
+ 'browser/sync/engine/syncer_thread.h',
+ 'browser/sync/engine/syncer_types.h',
+ 'browser/sync/engine/syncer_util.cc',
+ 'browser/sync/engine/syncer_util.h',
+ 'browser/sync/engine/syncproto.h',
+ 'browser/sync/engine/update_applicator.cc',
+ 'browser/sync/engine/update_applicator.h',
+ 'browser/sync/engine/verify_updates_command.cc',
+ 'browser/sync/engine/verify_updates_command.h',
+ 'browser/sync/protocol/service_constants.h',
+ 'browser/sync/syncable/blob.h',
+ 'browser/sync/syncable/dir_open_result.h',
+ 'browser/sync/syncable/directory_backing_store.cc',
+ 'browser/sync/syncable/directory_backing_store.h',
+ 'browser/sync/syncable/directory_event.h',
+ 'browser/sync/syncable/directory_manager.cc',
+ 'browser/sync/syncable/directory_manager.h',
+ 'browser/sync/syncable/path_name_cmp.h',
+ 'browser/sync/syncable/syncable-inl.h',
+ 'browser/sync/syncable/syncable.cc',
+ 'browser/sync/syncable/syncable.h',
+ 'browser/sync/syncable/syncable_changes_version.h',
+ 'browser/sync/syncable/syncable_columns.h',
+ 'browser/sync/syncable/syncable_id.cc',
+ 'browser/sync/syncable/syncable_id.h',
+ 'browser/sync/util/character_set_converters.cc',
+ 'browser/sync/util/character_set_converters.h',
+ 'browser/sync/util/character_set_converters_linux.cc',
+ 'browser/sync/util/character_set_converters_win.cc',
+ 'browser/sync/util/closure.h',
+ 'browser/sync/util/compat_file.h',
+ 'browser/sync/util/compat_file_posix.cc',
+ 'browser/sync/util/compat_file_win.cc',
+ 'browser/sync/util/compat_pthread.h',
+ 'browser/sync/util/crypto_helpers.cc',
+ 'browser/sync/util/crypto_helpers.h',
+ 'browser/sync/util/data_encryption.cc',
+ 'browser/sync/util/data_encryption.h',
+ 'browser/sync/util/dbgq.h',
+ 'browser/sync/util/event_sys-inl.h',
+ 'browser/sync/util/event_sys.h',
+ 'browser/sync/util/fast_dump.h',
+ 'browser/sync/util/highres_timer.h',
+ 'browser/sync/util/highres_timer_linux.cc',
+ 'browser/sync/util/highres_timer_linux.h',
+ 'browser/sync/util/highres_timer_win.cc',
+ 'browser/sync/util/highres_timer_win.h',
+ 'browser/sync/util/path_helpers.cc',
+ 'browser/sync/util/path_helpers.h',
+ 'browser/sync/util/path_helpers_linux.cc',
+ 'browser/sync/util/path_helpers_posix.cc',
+ 'browser/sync/util/pthread_helpers.cc',
+ 'browser/sync/util/pthread_helpers.h',
+ 'browser/sync/util/pthread_helpers_fwd.h',
+ 'browser/sync/util/query_helpers.cc',
+ 'browser/sync/util/query_helpers.h',
+ 'browser/sync/util/row_iterator.h',
+ 'browser/sync/util/signin.h',
+ 'browser/sync/util/sync_types.h',
+ 'browser/sync/util/user_settings.cc',
+ 'browser/sync/util/user_settings.h',
+ 'browser/sync/util/user_settings_posix.cc',
+ 'browser/sync/util/user_settings_win.cc',
+ ],
+ 'include_dirs': [
+ '..',
+ '<(protoc_out_dir)',
+ ],
+ 'defines' : [
+ 'COMPILER_MSVC',
+ 'COMPILING_SYNCAPI_LIBRARY',
+ 'SYNC_ENGINE_VERSION_STRING="Unknown"',
+ '_CRT_SECURE_NO_WARNINGS',
+ '_USE_32BIT_TIME_T',
+ ],
+ 'dependencies': [
+ '../third_party/libjingle/libjingle.gyp:libjingle',
+ '../third_party/protobuf2/protobuf.gyp:protobuf',
+ 'sync_proto',
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'dependencies': [
+ '../third_party/pthreads-win32/pthreads.gyp:pthreads',
+ ],
+ }],
+ ],
+ },
+ ], # targets when chrome_personalization==1 and use_syncapi_stub==0
+ }],
], # 'conditions'
}