diff options
Diffstat (limited to 'chrome/browser/sync')
45 files changed, 99 insertions, 106 deletions
diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc index 0861940..8d63cd7 100644 --- a/chrome/browser/sync/engine/syncer_thread.cc +++ b/chrome/browser/sync/engine/syncer_thread.cc @@ -5,7 +5,7 @@ #include "build/build_config.h" -#ifdef OS_MACOSX +#if defined(OS_MACOSX) #include <CoreFoundation/CFNumber.h> #include <IOKit/IOTypes.h> #include <IOKit/IOKitLib.h> @@ -37,7 +37,7 @@ namespace { // Returns the amount of time since the user last interacted with the computer, // in milliseconds int UserIdleTime() { -#ifdef OS_WIN +#if defined(OS_WIN) LASTINPUTINFO last_input_info; last_input_info.cbSize = sizeof(LASTINPUTINFO); diff --git a/chrome/browser/sync/engine/syncer_thread_timed_stop.cc b/chrome/browser/sync/engine/syncer_thread_timed_stop.cc index 2ae8cd5..4bc9916 100644 --- a/chrome/browser/sync/engine/syncer_thread_timed_stop.cc +++ b/chrome/browser/sync/engine/syncer_thread_timed_stop.cc @@ -5,7 +5,7 @@ #include "build/build_config.h" -#ifdef OS_MACOSX +#if defined(OS_MACOSX) #include <CoreFoundation/CFNumber.h> #include <IOKit/IOTypes.h> #include <IOKit/IOKitLib.h> diff --git a/chrome/browser/sync/engine/syncer_unittest.cc b/chrome/browser/sync/engine/syncer_unittest.cc index 08ae1c1..f37083c 100644 --- a/chrome/browser/sync/engine/syncer_unittest.cc +++ b/chrome/browser/sync/engine/syncer_unittest.cc @@ -935,7 +935,7 @@ TEST_F(SyncerTest, UpdateWithZeroLengthName) { syncer_->SyncShare(); } -#ifdef OS_WIN +#if defined(OS_WIN) TEST_F(SyncerTest, NameSanitizationWithClientRename) { ScopedDirLookup dir(syncdb_.manager(), syncdb_.name()); ASSERT_TRUE(dir.good()); diff --git a/chrome/browser/sync/glue/bookmark_model_worker.cc b/chrome/browser/sync/glue/bookmark_model_worker.cc index fa30466..2425269 100644 --- a/chrome/browser/sync/glue/bookmark_model_worker.cc +++ b/chrome/browser/sync/glue/bookmark_model_worker.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "chrome/browser/sync/glue/bookmark_model_worker.h" @@ -111,5 +111,4 @@ void BookmarkModelWorker::CallDoWorkAndSignalTask::Run() { } // namespace browser_sync -#endif // CHROME_PERSONALIZATION - +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/bookmark_model_worker.h b/chrome/browser/sync/glue/bookmark_model_worker.h index 2c4520c..8b47729 100644 --- a/chrome/browser/sync/glue/bookmark_model_worker.h +++ b/chrome/browser/sync/glue/bookmark_model_worker.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. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #ifndef CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_WORKER_H_ #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_WORKER_H_ @@ -131,4 +131,4 @@ class BookmarkModelWorker #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_WORKER_H_ -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/bookmark_model_worker_unittest.cc b/chrome/browser/sync/glue/bookmark_model_worker_unittest.cc index 879948f..0576732 100644 --- a/chrome/browser/sync/glue/bookmark_model_worker_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_model_worker_unittest.cc @@ -1,7 +1,7 @@ // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "base/thread.h" #include "chrome/browser/sync/engine/syncapi.h" @@ -221,4 +221,4 @@ TEST_F(BookmarkModelWorkerTest, HypotheticalManualPumpFlooding) { core_thread()->Stop(); } -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/change_processor.cc b/chrome/browser/sync/glue/change_processor.cc index f5669cb..d90560f 100644 --- a/chrome/browser/sync/glue/change_processor.cc +++ b/chrome/browser/sync/glue/change_processor.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "chrome/browser/sync/glue/change_processor.h" @@ -542,4 +542,4 @@ void ChangeProcessor::SetSyncNodeFavicon( } // namespace browser_sync -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/change_processor.h b/chrome/browser/sync/glue/change_processor.h index c5c43f7..355c058 100644 --- a/chrome/browser/sync/glue/change_processor.h +++ b/chrome/browser/sync/glue/change_processor.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. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #ifndef CHROME_BROWSER_SYNC_GLUE_CHANGE_PROCESSOR_H_ #define CHROME_BROWSER_SYNC_GLUE_CHANGE_PROCESSOR_H_ @@ -185,4 +185,4 @@ class ChangeProcessor : public BookmarkModelObserver, #endif // CHROME_BROWSER_SYNC_GLUE_CHANGE_APPLICATOR_H_ -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc index ebf0c7a..dfda3b5 100644 --- a/chrome/browser/sync/glue/http_bridge.cc +++ b/chrome/browser/sync/glue/http_bridge.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "chrome/browser/sync/glue/http_bridge.h" @@ -225,4 +225,4 @@ void HttpBridge::OnURLFetchComplete(const URLFetcher *source, const GURL &url, } // namespace browser_sync -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/http_bridge.h b/chrome/browser/sync/glue/http_bridge.h index 3055ac8..6ddfcd3 100644 --- a/chrome/browser/sync/glue/http_bridge.h +++ b/chrome/browser/sync/glue/http_bridge.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. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #ifndef CHROME_BROWSER_SYNC_GLUE_HTTP_BRIDGE_H_ #define CHROME_BROWSER_SYNC_GLUE_HTTP_BRIDGE_H_ @@ -182,4 +182,4 @@ class HttpBridgeFactory #endif // CHROME_BROWSER_SYNC_GLUE_HTTP_BRIDGE_H_ -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc index 62892af..32e0bc8 100644 --- a/chrome/browser/sync/glue/http_bridge_unittest.cc +++ b/chrome/browser/sync/glue/http_bridge_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "base/thread.h" #include "chrome/browser/sync/glue/http_bridge.h" @@ -207,4 +207,4 @@ TEST_F(HttpBridgeTest, TestExtraRequestHeaders) { EXPECT_NE(std::string::npos, response.find(test_payload.c_str())); } -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/model_associator.cc b/chrome/browser/sync/glue/model_associator.cc index 29a8f01..8fc1411 100644 --- a/chrome/browser/sync/glue/model_associator.cc +++ b/chrome/browser/sync/glue/model_associator.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "chrome/browser/sync/glue/model_associator.h" @@ -509,4 +509,4 @@ bool ModelAssociator::LoadAssociations() { } // namespace browser_sync -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/model_associator.h b/chrome/browser/sync/glue/model_associator.h index 70fc486..d0db911 100644 --- a/chrome/browser/sync/glue/model_associator.h +++ b/chrome/browser/sync/glue/model_associator.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. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #ifndef CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCATOR_H_ #define CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCATOR_H_ @@ -140,4 +140,4 @@ class ModelAssociator } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_MODEL_ASSOCATOR_H_ -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index 0ff9d6b..0e24c80 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "build/build_config.h" #include "base/file_version_info.h" @@ -326,4 +326,4 @@ void SyncBackendHost::Core::SaveChanges() { } // namespace browser_sync -#endif +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h index 89c581e..b5473f0 100644 --- a/chrome/browser/sync/glue/sync_backend_host.h +++ b/chrome/browser/sync/glue/sync_backend_host.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. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ @@ -114,7 +114,7 @@ class SyncBackendHost { // GAIA) has confirmed the username is authentic. string16 GetAuthenticatedUsername() const; -#ifdef UNIT_TEST +#if defined(UNIT_TEST) // Called from unit test to bypass authentication and initialize the syncapi // to a state suitable for testing but not production. void InitializeForTestMode(const std::wstring& test_user) { @@ -191,7 +191,7 @@ class SyncBackendHost { sync_api::SyncManager* syncapi() { return syncapi_.get(); } -#ifdef UNIT_TEST +#if defined(UNIT_TEST) // Special form of initialization that does not try and authenticate the // last known user (since it will fail in test mode) and does some extra // setup to nudge the syncapi into a useable state. @@ -290,4 +290,4 @@ class SyncBackendHost { } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/notifier/base/async_dns_lookup.cc b/chrome/browser/sync/notifier/base/async_dns_lookup.cc index a9fcd0c..869eb23 100644 --- a/chrome/browser/sync/notifier/base/async_dns_lookup.cc +++ b/chrome/browser/sync/notifier/base/async_dns_lookup.cc @@ -4,17 +4,20 @@ #include "chrome/browser/sync/notifier/base/async_dns_lookup.h" -#ifdef POSIX +#include "build/build_config.h" + +#if defined(OS_POSIX) #include <arpa/inet.h> #include <netdb.h> #include <netinet/in.h> #include <netinet/ip.h> #include <sys/socket.h> #include <sys/types.h> -#endif // POSIX +#endif // defined(OS_POSIX) #include <vector> +#include "base/basictypes.h" #include "base/logging.h" #include "chrome/browser/sync/notifier/base/nethelpers.h" #include "chrome/browser/sync/notifier/gaia_auth/inet_aton.h" diff --git a/chrome/browser/sync/notifier/base/fastalloc.h b/chrome/browser/sync/notifier/base/fastalloc.h index ed19a53..244a1f8 100644 --- a/chrome/browser/sync/notifier/base/fastalloc.h +++ b/chrome/browser/sync/notifier/base/fastalloc.h @@ -38,7 +38,7 @@ class FastAlloc { private: void freeBuffer() { -#ifdef DEBUG +#if defined(DEBUG) memset(buffer_, 0xCC, size_ * sizeof(T)); #endif diff --git a/chrome/browser/sync/notifier/base/nethelpers.h b/chrome/browser/sync/notifier/base/nethelpers.h index 604e69df..6c859a3 100644 --- a/chrome/browser/sync/notifier/base/nethelpers.h +++ b/chrome/browser/sync/notifier/base/nethelpers.h @@ -5,10 +5,12 @@ #ifndef CHROME_BROWSER_SYNC_NOTIFIER_BASE_NETHELPERS_H_ #define CHROME_BROWSER_SYNC_NOTIFIER_BASE_NETHELPERS_H_ -#ifdef POSIX +#include "base/basictypes.h" + +#if defined(OS_POSIX) #include <cstddef> #include <netdb.h> -#elif WIN32 +#elif defined(OS_WIN) #include <winsock2.h> #endif diff --git a/chrome/browser/sync/notifier/base/time.h b/chrome/browser/sync/notifier/base/time.h index 338ad71..c6b6352 100644 --- a/chrome/browser/sync/notifier/base/time.h +++ b/chrome/browser/sync/notifier/base/time.h @@ -21,7 +21,7 @@ const time64 kMaxTime100ns = UINT64_C(9223372036854775807); // Time difference in 100NS granularity between platform-dependent starting // time and Jan 1, 1970. -#ifdef WIN32 +#if defined(OS_WIN) // On Windows time64 is seconds since Jan 1, 1601. #define kStart100NsTimeToEpoch (116444736000000000uI64) #else diff --git a/chrome/browser/sync/notifier/communicator/mailbox.cc b/chrome/browser/sync/notifier/communicator/mailbox.cc index ebb32a8..df8d7cf 100644 --- a/chrome/browser/sync/notifier/communicator/mailbox.cc +++ b/chrome/browser/sync/notifier/communicator/mailbox.cc @@ -195,7 +195,7 @@ bool MessageThread::unread() const { return (labels_->find("^u") != labels_->end()); } -#ifdef _DEBUG +#if defined(DEBUG) // Non-debug version is inline and empty. void MessageThread::AssertValid() const { assert(thread_id_ != 0); diff --git a/chrome/browser/sync/notifier/communicator/mailbox.h b/chrome/browser/sync/notifier/communicator/mailbox.h index feadc86..ae44cb3 100644 --- a/chrome/browser/sync/notifier/communicator/mailbox.h +++ b/chrome/browser/sync/notifier/communicator/mailbox.h @@ -105,7 +105,7 @@ class MessageThread { bool starred() const; bool unread() const; -#ifdef _DEBUG +#if defined(DEBUG) void AssertValid() const; #else inline void AssertValid() const {} diff --git a/chrome/browser/sync/notifier/gaia_auth/inet_aton.h b/chrome/browser/sync/notifier/gaia_auth/inet_aton.h index 6a5aee5..29e4dcb 100644 --- a/chrome/browser/sync/notifier/gaia_auth/inet_aton.h +++ b/chrome/browser/sync/notifier/gaia_auth/inet_aton.h @@ -7,7 +7,7 @@ #ifndef CHROME_BROWSER_SYNC_NOTIFIER_GAIA_AUTH_INET_ATON_H_ #define CHROME_BROWSER_SYNC_NOTIFIER_GAIA_AUTH_INET_ATON_H_ -#ifdef WIN32 +#if defined(OS_WIN) int inet_aton(const char* cp, struct in_addr* inp); #endif diff --git a/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc b/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc index fd25620..e4c8061 100644 --- a/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc +++ b/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc @@ -17,7 +17,7 @@ #include "chrome/browser/sync/notifier/listener/subscribe_task.h" #include "chrome/browser/sync/protocol/service_constants.h" #include "talk/base/thread.h" -#ifdef WIN32 +#if defined(OS_WIN) #include "talk/base/win32socketserver.h" #endif #include "talk/xmpp/xmppclient.h" @@ -41,7 +41,7 @@ void MediatorThreadImpl::Run() { PlatformThread::SetName("SyncEngine_MediatorThread"); // For win32, this sets up the win32socketserver. Note that it needs to // dispatch windows messages since that is what the win32 socket server uses. -#ifdef WIN32 +#if defined(OS_WIN) scoped_ptr<talk_base::SocketServer> socket_server( new talk_base::Win32SocketServer(this)); talk_base::SocketServer* old_socket_server = socketserver(); @@ -62,7 +62,7 @@ void MediatorThreadImpl::Run() { ProcessMessages(talk_base::kForever); -#ifdef WIN32 +#if defined(OS_WIN) set_socketserver(old_socket_server); socket_server.reset(); #endif diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 2efba68..08d486c 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "chrome/browser/sync/profile_sync_service.h" #include <stack> @@ -428,4 +428,4 @@ bool ProfileSyncService::ShouldPushChanges() { return change_processor_->IsRunning(); } -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index 9eedbef..eca2480 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.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. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ @@ -314,4 +314,4 @@ class ProfileSyncService : public NotificationObserver, #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc index b2062b5..cef0204 100644 --- a/chrome/browser/sync/profile_sync_service_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include <stack> #include <vector> @@ -1273,4 +1273,4 @@ TEST_F(ProfileSyncServiceTestWithData, RecoverAfterDeletingSyncDataDirectory) { ExpectModelMatch(); } -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc index 2784572..4b5d241 100644 --- a/chrome/browser/sync/sync_setup_flow.cc +++ b/chrome/browser/sync/sync_setup_flow.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "chrome/browser/sync/sync_setup_flow.h" @@ -301,4 +301,4 @@ SyncSetupFlow* SyncSetupFlow::Run(ProfileSyncService* service, return flow; } -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_setup_flow.h b/chrome/browser/sync/sync_setup_flow.h index 32e3db1..20668ee 100644 --- a/chrome/browser/sync/sync_setup_flow.h +++ b/chrome/browser/sync/sync_setup_flow.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. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #ifndef CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ #define CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ @@ -186,4 +186,4 @@ class FlowHandler : public DOMMessageHandler { }; #endif // CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_ -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/sync/sync_setup_wizard.cc index 7d00ab9..2027bdb 100644 --- a/chrome/browser/sync/sync_setup_wizard.cc +++ b/chrome/browser/sync/sync_setup_wizard.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "chrome/browser/sync/sync_setup_wizard.h" @@ -196,4 +196,4 @@ SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( return result; } -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_setup_wizard_unittest.cc b/chrome/browser/sync/sync_setup_wizard_unittest.cc index 3a04746..b4cb572 100644 --- a/chrome/browser/sync/sync_setup_wizard_unittest.cc +++ b/chrome/browser/sync/sync_setup_wizard_unittest.cc @@ -1,7 +1,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "testing/gtest/include/gtest/gtest.h" @@ -373,4 +373,4 @@ TEST_F(SyncSetupWizardTest, DiscreteRun) { EXPECT_TRUE(test_window_->TestAndResetWasShowHTMLDialogCalled()); } -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_status_ui_helper.cc b/chrome/browser/sync/sync_status_ui_helper.cc index b642d3c..abffddc 100644 --- a/chrome/browser/sync/sync_status_ui_helper.cc +++ b/chrome/browser/sync/sync_status_ui_helper.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #include "chrome/browser/sync/sync_status_ui_helper.h" @@ -114,4 +114,4 @@ SyncStatusUIHelper::MessageType SyncStatusUIHelper::GetLabels( return result_type; } -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/sync_status_ui_helper.h b/chrome/browser/sync/sync_status_ui_helper.h index 6241ead..f0d874b 100644 --- a/chrome/browser/sync/sync_status_ui_helper.h +++ b/chrome/browser/sync/sync_status_ui_helper.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. -#ifdef CHROME_PERSONALIZATION +#if defined(BROWSER_SYNC) #ifndef CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ #define CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ @@ -31,4 +31,4 @@ class SyncStatusUIHelper { }; #endif // CHROME_BROWSER_SYNC_SYNC_STATUS_UI_HELPER_H_ -#endif // CHROME_PERSONALIZATION +#endif // defined(BROWSER_SYNC) diff --git a/chrome/browser/sync/syncable/directory_backing_store.cc b/chrome/browser/sync/syncable/directory_backing_store.cc index d693fb0..fd1eb34 100644 --- a/chrome/browser/sync/syncable/directory_backing_store.cc +++ b/chrome/browser/sync/syncable/directory_backing_store.cc @@ -6,7 +6,7 @@ #include "build/build_config.h" -#ifdef OS_MACOSX +#if defined(OS_MACOSX) #include <CoreFoundation/CoreFoundation.h> #endif @@ -75,7 +75,7 @@ static void PathNameMatch16WithEscape(sqlite3_context* context, #endif static void RegisterPathNameCollate(sqlite3* dbhandle) { -#ifdef OS_WIN +#if defined(OS_WIN) const int collate = SQLITE_UTF16; #else const int collate = SQLITE_UTF8; @@ -93,7 +93,7 @@ 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_WIN +#if defined(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", diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc index 4d7b1c0..a182303 100644 --- a/chrome/browser/sync/syncable/syncable.cc +++ b/chrome/browser/sync/syncable/syncable.cc @@ -7,12 +7,12 @@ #include "build/build_config.h" #include <sys/stat.h> -#ifdef OS_POSIX +#if defined(OS_POSIX) #include <sys/time.h> #endif #include <sys/types.h> #include <time.h> -#ifdef OS_MACOSX +#if defined(OS_MACOSX) #include <CoreFoundation/CoreFoundation.h> #elif defined(OS_WIN) #include <shlwapi.h> // for PathMatchSpec @@ -70,7 +70,7 @@ using std::string; namespace syncable { int64 Now() { -#ifdef OS_WIN +#if defined(OS_WIN) FILETIME filetime; SYSTEMTIME systime; GetSystemTime(&systime); @@ -94,7 +94,7 @@ int64 Now() { // Callback for sqlite3 int ComparePathNames16(void*, int a_bytes, const void* a, int b_bytes, const void* b) { -#ifdef OS_WIN +#if defined(OS_WIN) DCHECK_EQ(0, a_bytes % 2); DCHECK_EQ(0, b_bytes % 2); int result = CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, @@ -238,7 +238,7 @@ Directory::~Directory() { } BOOL PathNameMatch(const PathString& pathname, const PathString& pathspec) { -#ifdef OS_WIN +#if defined(OS_WIN) // Note that if we go Vista only this is easier: // http://msdn2.microsoft.com/en-us/library/ms628611.aspx @@ -1729,7 +1729,7 @@ void DBName::MakeNoncollidingForEntry(BaseTransaction* trans, PathString GetFullPath(BaseTransaction* trans, const Entry& e) { PathString result; -#ifdef COMPILER_MSVC +#if defined(COMPILER_MSVC) result.reserve(MAX_PATH); #endif ReverseAppend(e.Get(NAME), &result); diff --git a/chrome/browser/sync/syncable/syncable_unittest.cc b/chrome/browser/sync/syncable/syncable_unittest.cc index f117aaf..db5bc08 100644 --- a/chrome/browser/sync/syncable/syncable_unittest.cc +++ b/chrome/browser/sync/syncable/syncable_unittest.cc @@ -1088,7 +1088,7 @@ TEST(Syncable, ComparePathNames) { } } -#ifdef OS_WIN +#if defined(OS_WIN) TEST(Syncable, PathNameMatch) { // basic stuff, not too many otherwise we're testing the os. EXPECT_TRUE(PathNameMatch(PSTR("bob"), PSTR("bob"))); @@ -1111,7 +1111,7 @@ TEST(Syncable, PathNameMatch) { // other whitespace should give no matches. EXPECT_FALSE(PathNameMatch(PSTR("bob"), PSTR("\tbob"))); } -#endif // OS_WIN +#endif // defined(OS_WIN) void FakeSync(MutableEntry* e, const char* fake_id) { e->Put(IS_UNSYNCED, false); diff --git a/chrome/browser/sync/util/character_set_converters_unittest.cc b/chrome/browser/sync/util/character_set_converters_unittest.cc index b1aa604..6274a1d 100644 --- a/chrome/browser/sync/util/character_set_converters_unittest.cc +++ b/chrome/browser/sync/util/character_set_converters_unittest.cc @@ -35,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_WIN +#if defined(OS_WIN) // On Linux, PathString is already UTF8 ASSERT_EQ(string(ascii), static_cast<string>(ToUTF8(wide))); #endif @@ -44,7 +44,7 @@ TEST_F(CharacterSetConverterTest, ASCIIConversionTest) { // ASSERT_TRUE(wide == ToPathString(utf8).get_string16()); } -#ifdef OS_WIN +#if defined(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 @@ -78,7 +78,7 @@ TEST_F(CharacterSetConverterTest, UnicodeConversionText) { ASSERT_TRUE(wide == to_16.get_string16()); ASSERT_EQ(string(utf8), reinterpret_cast<const string&>(ToUTF8(wide))); } -#endif +#endif // defined(OS_WIN) TEST_F(CharacterSetConverterTest, AppendUTF8Tests) { PathString one = PSTR("one"); @@ -108,7 +108,7 @@ TEST_F(CharacterSetConverterTest, AppendPathStringTests) { ASSERT_TRUE(out == PathString(PSTR("onetwothree"))); } -#ifdef OS_WIN +#if defined(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/compat_file.h b/chrome/browser/sync/util/compat_file.h index a2bbf78..011dafe 100644 --- a/chrome/browser/sync/util/compat_file.h +++ b/chrome/browser/sync/util/compat_file.h @@ -20,7 +20,7 @@ extern const PathChar* const kPathSeparator; // Returns 0 on success, non-zero on failure. int PathRemove(const PathString& path); -#ifdef OS_WIN +#if defined(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 62ba56f..f84a379e6 100644 --- a/chrome/browser/sync/util/compat_file_posix.cc +++ b/chrome/browser/sync/util/compat_file_posix.cc @@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if !defined(POSIX) +#include "build/build_config.h" + +#if !defined(OS_POSIX) #error Compile this file on Mac OS X or Linux only. #endif diff --git a/chrome/browser/sync/util/event_sys-inl.h b/chrome/browser/sync/util/event_sys-inl.h index c2f3b44..320a6f93 100644 --- a/chrome/browser/sync/util/event_sys-inl.h +++ b/chrome/browser/sync/util/event_sys-inl.h @@ -118,7 +118,7 @@ class EventChannel { // Make sure all the listeners have been disconnected. Otherwise, they // will try to call RemoveListener() at a later date. -#ifdef DEBUG +#if defined(DEBUG) AutoLock lock(listeners_mutex_); for (typename Listeners::iterator i = listeners_.begin(); i != listeners_.end(); ++i) { diff --git a/chrome/browser/sync/util/event_sys_unittest.cc b/chrome/browser/sync/util/event_sys_unittest.cc index c39ea9a..9afd64b 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/message_loop.h" +#include "base/platform_thread.h" #include "base/port.h" #include "build/build_config.h" #include "chrome/browser/sync/util/event_sys-inl.h" @@ -223,12 +224,7 @@ class ThreadTester : public EventListener<TestEvent>, remove_event_mutex_.Release(); remove_event_.Broadcast(); - // Windows and posix use different functions to sleep. -#ifdef OS_WIN - Sleep(1); -#else - sleep(1); -#endif + PlatformThread::Sleep(1); for (size_t i = 0; i < threads_.size(); i++) { if (threads_[i].completed) diff --git a/chrome/browser/sync/util/highres_timer_unittest.cc b/chrome/browser/sync/util/highres_timer_unittest.cc index 0d3a905..2257262 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 "base/platform_thread.h" #include "build/build_config.h" #include "chrome/browser/sync/util/highres_timer.h" #include "testing/gtest/include/gtest/gtest.h" @@ -31,20 +32,10 @@ TEST(HighresTimer, DISABLED_SecondClock) { HighresTimer timer; EXPECT_TRUE(0 == timer.GetElapsedSec()); -#ifdef OS_WIN - ::Sleep(250); -#else - struct timespec ts1 = {0, 250000000}; - nanosleep(&ts1, 0); -#endif + PlatformThread::Sleep(250); EXPECT_TRUE(0 == timer.GetElapsedSec()); EXPECT_TRUE(230 <= timer.GetElapsedMs()); EXPECT_TRUE(270 >= timer.GetElapsedMs()); -#ifdef OS_WIN - ::Sleep(251); -#else - struct timespec ts2 = {0, 251000000}; - nanosleep(&ts2, 0); -#endif + PlatformThread::Sleep(251); EXPECT_TRUE(1 == timer.GetElapsedSec()); } diff --git a/chrome/browser/sync/util/path_helpers_unittest.cc b/chrome/browser/sync/util/path_helpers_unittest.cc index 827e2c3..62359e1 100644 --- a/chrome/browser/sync/util/path_helpers_unittest.cc +++ b/chrome/browser/sync/util/path_helpers_unittest.cc @@ -65,7 +65,7 @@ TEST(PathHelpersTest, PathStrutil) { } TEST(PathHelpersTest, SanitizePathComponent) { -#ifdef OS_WIN +#if defined(OS_WIN) EXPECT_EQ(MakePathComponentOSLegal(L"bar"), L""); EXPECT_EQ(MakePathComponentOSLegal(L"bar <"), L"bar"); EXPECT_EQ(MakePathComponentOSLegal(L"bar.<"), L"bar"); @@ -117,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_WIN +#else // !defined(OS_WIN) EXPECT_EQ(MakePathComponentOSLegal("bar"), ""); EXPECT_EQ(MakePathComponentOSLegal("b"), ""); @@ -126,7 +126,7 @@ TEST(PathHelpersTest, SanitizePathComponent) { EXPECT_EQ(MakePathComponentOSLegal("/"), ":"); EXPECT_EQ(MakePathComponentOSLegal(":"), ""); -#endif // OS_WIN +#endif // defined(OS_WIN) } } // namespace syncable diff --git a/chrome/browser/sync/util/query_helpers.cc b/chrome/browser/sync/util/query_helpers.cc index 34dc79f..c27a877 100644 --- a/chrome/browser/sync/util/query_helpers.cc +++ b/chrome/browser/sync/util/query_helpers.cc @@ -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_WIN +#if defined(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,12 +76,12 @@ int SqliteOpen(PathString filename, sqlite3** db) { attrs = attrs | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; SetFileAttributes(filename.c_str(), attrs); } -#endif // OS_WIN +#endif // defined(OS_WIN) // Be patient as we set pragmas. sqlite3_busy_timeout(*db, numeric_limits<int>::max()); -#ifndef DISABLE_SQLITE_FULL_FSYNC +#if !defined(DISABLE_SQLITE_FULL_FSYNC) ExecOrDie(*db, "PRAGMA fullfsync = 1"); -#endif // DISABLE_SQLITE_FULL_FSYNC +#endif // !defined(DISABLE_SQLITE_FULL_FSYNC) ExecOrDie(*db, "PRAGMA synchronous = 2"); sqlite3_busy_timeout(*db, 0); return SQLITE_OK; diff --git a/chrome/browser/sync/util/sync_types.h b/chrome/browser/sync/util/sync_types.h index 26469cc..71b9c42 100644 --- a/chrome/browser/sync/util/sync_types.h +++ b/chrome/browser/sync/util/sync_types.h @@ -13,7 +13,7 @@ #include "build/build_config.h" // TODO(timsteele): Use base/file_path.h instead of PathString. -#ifdef OS_WIN +#if defined(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 a8ab972..1c867a6 100644 --- a/chrome/browser/sync/util/user_settings.cc +++ b/chrome/browser/sync/util/user_settings.cc @@ -180,7 +180,7 @@ bool UserSettings::Init(const PathString& settings_path) { } ExecOrDie(dbhandle.get(), "COMMIT TRANSACTION"); } -#ifdef OS_WIN +#if defined(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()); |