diff options
author | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-02 08:31:51 +0000 |
---|---|---|
committer | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-02 08:31:51 +0000 |
commit | cc7a544c7ed441865a8cabe21409314c857d1831 (patch) | |
tree | ed56e6182e951d985abbe2a10c627565e0d90f7e | |
parent | dcc72db730c7fb95e9590e01b2e3237d1b13ba98 (diff) | |
download | chromium_src-cc7a544c7ed441865a8cabe21409314c857d1831.zip chromium_src-cc7a544c7ed441865a8cabe21409314c857d1831.tar.gz chromium_src-cc7a544c7ed441865a8cabe21409314c857d1831.tar.bz2 |
[sync] Componentize sync: Part 6: Add more SYNC_EXPORTs to files in src/sync/
One of the long term goals of the sync team is to pull sync code out of
chrome.dll and into its own component. As of today, several chrome targets
depend on various sync targets as defined in sync.gyp. We'd like to move
to a world where all chrome targets outside sync.gyp simply depend on the
target sync.gyp:sync, which is built into its own component.
This patch sets the stage for full componentization by adding
SYNC_EXPORT_PRIVATE (and some SYNC_EXPORT) annotations to classes / methods
within src/sync so that various chrome targets can reference them.
It also makes a few assorted fixes like adding missing destructors, etc. These
errors get flagged when component builds are enabled after componentizing
sync.
The final step of breaking off sync into its own component will be done
in https://codereview.chromium.org/11412211.
BUG=136928
Review URL: https://codereview.chromium.org/11624037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174801 0039d316-1c4b-4281-b951-d872f2087c98
95 files changed, 389 insertions, 267 deletions
diff --git a/sync/api/sync_change.h b/sync/api/sync_change.h index 50becf4..7f25f8a 100644 --- a/sync/api/sync_change.h +++ b/sync/api/sync_change.h @@ -71,7 +71,7 @@ class SYNC_EXPORT SyncChange { }; // gmock printer helper. -void PrintTo(const SyncChange& sync_change, std::ostream* os); +SYNC_EXPORT void PrintTo(const SyncChange& sync_change, std::ostream* os); } // namespace syncer diff --git a/sync/api/sync_error.h b/sync/api/sync_error.h index a3382b4..e9ca0f6 100644 --- a/sync/api/sync_error.h +++ b/sync/api/sync_error.h @@ -82,7 +82,7 @@ class SYNC_EXPORT SyncError { }; // gmock printer helper. -void PrintTo(const SyncError& sync_error, std::ostream* os); +SYNC_EXPORT void PrintTo(const SyncError& sync_error, std::ostream* os); } // namespace syncer diff --git a/sync/engine/apply_control_data_updates.h b/sync/engine/apply_control_data_updates.h index 8d19f47..4646cb0 100644 --- a/sync/engine/apply_control_data_updates.h +++ b/sync/engine/apply_control_data_updates.h @@ -1,10 +1,12 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. #ifndef SYNC_ENGINE_APPLY_CONTROL_DATA_UPDATES_H_ #define SYNC_ENGINE_APPLY_CONTROL_DATA_UPDATES_H_ +#include "sync/base/sync_export.h" + namespace syncer { class Cryptographer; @@ -19,7 +21,8 @@ class MutableEntry; class WriteTransaction; } -void ApplyControlDataUpdates(sessions::SyncSession* session); +SYNC_EXPORT_PRIVATE void ApplyControlDataUpdates( + sessions::SyncSession* session); void ApplyNigoriUpdate(syncable::WriteTransaction* trans, syncable::MutableEntry* const entry, Cryptographer* cryptographer); diff --git a/sync/engine/apply_updates_and_resolve_conflicts_command.h b/sync/engine/apply_updates_and_resolve_conflicts_command.h index 9c015b9..5072f80 100644 --- a/sync/engine/apply_updates_and_resolve_conflicts_command.h +++ b/sync/engine/apply_updates_and_resolve_conflicts_command.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -6,11 +6,12 @@ #define SYNC_ENGINE_APPLY_UPDATES_AND_RESOLVE_CONFLICTS_COMMAND_H_ #include "base/compiler_specific.h" +#include "sync/base/sync_export.h" #include "sync/engine/model_changing_syncer_command.h" namespace syncer { -class ApplyUpdatesAndResolveConflictsCommand +class SYNC_EXPORT_PRIVATE ApplyUpdatesAndResolveConflictsCommand : public ModelChangingSyncerCommand { public: ApplyUpdatesAndResolveConflictsCommand(); diff --git a/sync/engine/backoff_delay_provider.h b/sync/engine/backoff_delay_provider.h index 84293f9..3aaa93a 100644 --- a/sync/engine/backoff_delay_provider.h +++ b/sync/engine/backoff_delay_provider.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -6,6 +6,7 @@ #define SYNC_ENGINE_BACKOFF_DELAY_PROVIDER_H_ #include "base/time.h" +#include "sync/base/sync_export.h" namespace syncer { @@ -14,7 +15,7 @@ struct ModelNeutralState; } // A component used to get time delays associated with exponential backoff. -class BackoffDelayProvider { +class SYNC_EXPORT_PRIVATE BackoffDelayProvider { public: // Factory function to create a standard BackoffDelayProvider. static BackoffDelayProvider* FromDefaults(); diff --git a/sync/engine/build_commit_command.h b/sync/engine/build_commit_command.h index c1712a6..b4190ca 100644 --- a/sync/engine/build_commit_command.h +++ b/sync/engine/build_commit_command.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -8,6 +8,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" +#include "sync/base/sync_export.h" #include "sync/engine/syncer_command.h" #include "sync/syncable/entry_kernel.h" @@ -28,7 +29,7 @@ class Entry; // committed. // // See SyncerCommand documentation for more info. -class BuildCommitCommand : public SyncerCommand { +class SYNC_EXPORT_PRIVATE BuildCommitCommand : public SyncerCommand { public: // The batch_commit_set parameter contains a set of references to the items // that should be committed. diff --git a/sync/engine/download_updates_command.h b/sync/engine/download_updates_command.h index 8e79ac9..c875695 100644 --- a/sync/engine/download_updates_command.h +++ b/sync/engine/download_updates_command.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -37,7 +37,7 @@ namespace syncer { // downloaded for all enabled datatypes (i.e., until the server indicates // changes_remaining == 0 in the GetUpdates response), or until an error // is encountered. -class DownloadUpdatesCommand : public SyncerCommand { +class SYNC_EXPORT_PRIVATE DownloadUpdatesCommand : public SyncerCommand { public: // |create_mobile_bookmarks_folder| controls whether or not to // create the mobile bookmarks folder if it's not already created. diff --git a/sync/engine/get_commit_ids_command.h b/sync/engine/get_commit_ids_command.h index 83f3e62..86abf24 100644 --- a/sync/engine/get_commit_ids_command.h +++ b/sync/engine/get_commit_ids_command.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -9,6 +9,7 @@ #include <vector> #include "base/compiler_specific.h" +#include "sync/base/sync_export.h" #include "sync/engine/syncer_command.h" #include "sync/engine/syncer_util.h" #include "sync/sessions/ordered_commit_set.h" @@ -24,7 +25,7 @@ namespace syncer { // locally modified items that are ready to be committed to the server. // // See SyncerCommand documentation for more info. -class GetCommitIdsCommand : public SyncerCommand { +class SYNC_EXPORT_PRIVATE GetCommitIdsCommand : public SyncerCommand { friend class SyncerTest; public: diff --git a/sync/engine/model_changing_syncer_command.h b/sync/engine/model_changing_syncer_command.h index 3d780e7..f9ffe37 100644 --- a/sync/engine/model_changing_syncer_command.h +++ b/sync/engine/model_changing_syncer_command.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -6,6 +6,7 @@ #define SYNC_ENGINE_MODEL_CHANGING_SYNCER_COMMAND_H_ #include "base/compiler_specific.h" +#include "sync/base/sync_export.h" #include "sync/engine/syncer_command.h" #include "sync/internal_api/public/engine/model_safe_worker.h" @@ -24,7 +25,7 @@ class SyncSession; // fields on any syncable::Entry. If the operation involves creating a // WriteTransaction, this is a sign that ModelChangingSyncerCommand is likely // necessary. -class ModelChangingSyncerCommand : public SyncerCommand { +class SYNC_EXPORT_PRIVATE ModelChangingSyncerCommand : public SyncerCommand { public: ModelChangingSyncerCommand() : work_session_(NULL) { } virtual ~ModelChangingSyncerCommand() { } diff --git a/sync/engine/net/server_connection_manager.h b/sync/engine/net/server_connection_manager.h index 0df25df..05619dd 100644 --- a/sync/engine/net/server_connection_manager.h +++ b/sync/engine/net/server_connection_manager.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -15,6 +15,7 @@ #include "base/synchronization/lock.h" #include "base/threading/non_thread_safe.h" #include "base/threading/thread_checker.h" +#include "sync/base/sync_export.h" #include "sync/syncable/syncable_id.h" namespace sync_pb { @@ -34,7 +35,7 @@ static const int32 kUnsetPayloadLength = -1; // HttpResponse gathers the relevant output properties of an HTTP request. // Depending on the value of the server_status code, response_code, and // content_length may not be valid. -struct HttpResponse { +struct SYNC_EXPORT_PRIVATE HttpResponse { enum ServerConnectionCode { // For uninitialized state. NONE, @@ -95,7 +96,7 @@ struct ServerConnectionEvent { connection_code(code) {} }; -class ServerConnectionEventListener { +class SYNC_EXPORT_PRIVATE ServerConnectionEventListener { public: virtual void OnServerConnectionEvent(const ServerConnectionEvent& event) = 0; protected: @@ -106,7 +107,8 @@ class ServerConnectionManager; // A helper class that automatically notifies when the status changes. // TODO(tim): This class shouldn't be exposed outside of the implementation, // bug 35060. -class ScopedServerStatusWatcher : public base::NonThreadSafe { +class SYNC_EXPORT_PRIVATE ScopedServerStatusWatcher + : public base::NonThreadSafe { public: ScopedServerStatusWatcher(ServerConnectionManager* conn_mgr, HttpResponse* response); @@ -120,7 +122,7 @@ class ScopedServerStatusWatcher : public base::NonThreadSafe { // Use this class to interact with the sync server. // The ServerConnectionManager currently supports POSTing protocol buffers. // -class ServerConnectionManager { +class SYNC_EXPORT_PRIVATE ServerConnectionManager { public: // buffer_in - will be POSTed // buffer_out - string will be overwritten with response diff --git a/sync/engine/process_commit_response_command.h b/sync/engine/process_commit_response_command.h index a849255..f7efcfc 100644 --- a/sync/engine/process_commit_response_command.h +++ b/sync/engine/process_commit_response_command.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -10,6 +10,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" +#include "sync/base/sync_export.h" #include "sync/engine/model_changing_syncer_command.h" #include "sync/protocol/sync.pb.h" @@ -38,7 +39,8 @@ class Directory; // trouble processing the request. // // See SyncerCommand documentation for more info. -class ProcessCommitResponseCommand : public ModelChangingSyncerCommand { +class SYNC_EXPORT_PRIVATE ProcessCommitResponseCommand + : public ModelChangingSyncerCommand { public: // The commit_set parameter contains references to all the items which were diff --git a/sync/engine/process_updates_command.h b/sync/engine/process_updates_command.h index 9f89a63..ce79387 100644 --- a/sync/engine/process_updates_command.h +++ b/sync/engine/process_updates_command.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -6,6 +6,7 @@ #define SYNC_ENGINE_PROCESS_UPDATES_COMMAND_H_ #include "base/compiler_specific.h" +#include "sync/base/sync_export.h" #include "sync/engine/model_changing_syncer_command.h" #include "sync/engine/syncer_types.h" @@ -27,7 +28,8 @@ class Cryptographer; // // Postconditions - All of the verified SyncEntity data will be copied to // the server fields of the corresponding syncable entries. -class ProcessUpdatesCommand : public ModelChangingSyncerCommand { +class SYNC_EXPORT_PRIVATE ProcessUpdatesCommand + : public ModelChangingSyncerCommand { public: ProcessUpdatesCommand(); virtual ~ProcessUpdatesCommand(); diff --git a/sync/engine/sync_engine_event.h b/sync/engine/sync_engine_event.h index 94abfe3..c30f830 100644 --- a/sync/engine/sync_engine_event.h +++ b/sync/engine/sync_engine_event.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -8,6 +8,7 @@ #include <string> #include "base/observer_list.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/sessions/sync_session_snapshot.h" namespace syncable { @@ -16,7 +17,7 @@ class Id; namespace syncer { -struct SyncEngineEvent { +struct SYNC_EXPORT_PRIVATE SyncEngineEvent { enum EventCause { //////////////////////////////////////////////////////////////// // Sent on entry of Syncer state machine @@ -57,7 +58,7 @@ struct SyncEngineEvent { std::string updated_token; }; -class SyncEngineEventListener { +class SYNC_EXPORT_PRIVATE SyncEngineEventListener { public: // TODO(tim): Consider splitting this up to multiple callbacks, rather than // have to do Event e(type); OnSyncEngineEvent(e); at all callsites, diff --git a/sync/engine/sync_scheduler.h b/sync/engine/sync_scheduler.h index 4673192..db21ab0 100644 --- a/sync/engine/sync_scheduler.h +++ b/sync/engine/sync_scheduler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -11,6 +11,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/time.h" +#include "sync/base/sync_export.h" #include "sync/engine/nudge_source.h" #include "sync/internal_api/public/base/model_type_invalidation_map.h" #include "sync/sessions/sync_session.h" @@ -25,7 +26,7 @@ namespace syncer { struct ServerConnectionEvent; -struct ConfigurationParams { +struct SYNC_EXPORT_PRIVATE ConfigurationParams { ConfigurationParams(); ConfigurationParams( const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& source, @@ -44,7 +45,8 @@ struct ConfigurationParams { base::Closure ready_task; }; -class SyncScheduler : public sessions::SyncSession::Delegate { +class SYNC_EXPORT_PRIVATE SyncScheduler + : public sessions::SyncSession::Delegate { public: enum Mode { // In this mode, the thread only performs configuration tasks. This is diff --git a/sync/engine/sync_scheduler_impl.h b/sync/engine/sync_scheduler_impl.h index f2edfaf..ea399ec 100644 --- a/sync/engine/sync_scheduler_impl.h +++ b/sync/engine/sync_scheduler_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -17,6 +17,7 @@ #include "base/observer_list.h" #include "base/time.h" #include "base/timer.h" +#include "sync/base/sync_export.h" #include "sync/engine/net/server_connection_manager.h" #include "sync/engine/nudge_source.h" #include "sync/engine/sync_scheduler.h" @@ -32,7 +33,7 @@ namespace syncer { class BackoffDelayProvider; -class SyncSchedulerImpl : public SyncScheduler { +class SYNC_EXPORT_PRIVATE SyncSchedulerImpl : public SyncScheduler { public: // |name| is a display string to identify the syncer thread. Takes // |ownership of |syncer| and |delay_provider|. @@ -116,7 +117,7 @@ class SyncSchedulerImpl : public SyncScheduler { FRIEND_TEST_ALL_PREFIXES(SyncSchedulerTest, ConnectionChangeCanaryPreemptedByNudge); - struct WaitInterval { + struct SYNC_EXPORT_PRIVATE WaitInterval { enum Mode { // Uninitialized state, should not be set in practice. UNKNOWN = -1, diff --git a/sync/engine/sync_session_job.h b/sync/engine/sync_session_job.h index 136f1de..dfb9c90 100644 --- a/sync/engine/sync_session_job.h +++ b/sync/engine/sync_session_job.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -8,13 +8,14 @@ #include "base/memory/scoped_ptr.h" #include "base/time.h" #include "base/tracked_objects.h" +#include "sync/base/sync_export.h" #include "sync/engine/sync_scheduler.h" #include "sync/engine/syncer.h" #include "sync/sessions/sync_session.h" namespace syncer { -class SyncSessionJob { +class SYNC_EXPORT_PRIVATE SyncSessionJob { public: enum Purpose { // Uninitialized state, should never be hit in practice. diff --git a/sync/engine/syncer.h b/sync/engine/syncer.h index 4bcac92..ac7892e 100644 --- a/sync/engine/syncer.h +++ b/sync/engine/syncer.h @@ -11,6 +11,7 @@ #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/synchronization/lock.h" +#include "sync/base/sync_export.h" #include "sync/engine/conflict_resolver.h" #include "sync/engine/syncer_types.h" #include "sync/internal_api/public/base/model_type.h" @@ -44,7 +45,7 @@ enum SyncerStep { // to SyncShare() may take an unbounded amount of time, as SyncerCommands // may block on network i/o, on lock contention, or on tasks posted to // other threads. -class Syncer { +class SYNC_EXPORT_PRIVATE Syncer { public: typedef std::vector<int64> UnsyncedMetaHandles; diff --git a/sync/engine/syncer_command.h b/sync/engine/syncer_command.h index 575e55b..303aad5 100644 --- a/sync/engine/syncer_command.h +++ b/sync/engine/syncer_command.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -7,6 +7,7 @@ #include "base/basictypes.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/util/syncer_error.h" namespace syncer { @@ -27,7 +28,7 @@ class SyncSession; // cmd->Execute(session); // delete cmd; -class SyncerCommand { +class SYNC_EXPORT_PRIVATE SyncerCommand { public: SyncerCommand(); virtual ~SyncerCommand(); diff --git a/sync/engine/syncer_proto_util.h b/sync/engine/syncer_proto_util.h index 5b8832a..1f271d8 100644 --- a/sync/engine/syncer_proto_util.h +++ b/sync/engine/syncer_proto_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -47,7 +47,7 @@ SYNC_EXPORT_PRIVATE ModelTypeSet GetTypesToMigrate( SYNC_EXPORT_PRIVATE SyncProtocolError ConvertErrorPBToLocalType( const sync_pb::ClientToServerResponse_Error& error); -class SyncerProtoUtil { +class SYNC_EXPORT_PRIVATE SyncerProtoUtil { public: // Posts the given message and fills the buffer with the returned value. // Returns true on success. Also handles store birthday verification: will diff --git a/sync/engine/throttled_data_type_tracker.h b/sync/engine/throttled_data_type_tracker.h index 53c5dbe..9054ae6 100644 --- a/sync/engine/throttled_data_type_tracker.h +++ b/sync/engine/throttled_data_type_tracker.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -8,6 +8,7 @@ #include <map> #include "base/gtest_prod_util.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" namespace base { @@ -18,7 +19,7 @@ namespace syncer { class AllStatus; -class ThrottledDataTypeTracker { +class SYNC_EXPORT_PRIVATE ThrottledDataTypeTracker { public: // The given allstatus argument will be kept up to date on this object's list // of throttled types. The argument may be NULL in tests. diff --git a/sync/engine/traffic_recorder.h b/sync/engine/traffic_recorder.h index 28edec5..0e6e452 100644 --- a/sync/engine/traffic_recorder.h +++ b/sync/engine/traffic_recorder.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -11,6 +11,7 @@ #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/values.h" +#include "sync/base/sync_export.h" #include "sync/protocol/sync.pb.h" namespace sync_pb { @@ -20,7 +21,7 @@ class ClientToServerMessage; namespace syncer { -class TrafficRecorder { +class SYNC_EXPORT_PRIVATE TrafficRecorder { public: enum TrafficMessageType { CLIENT_TO_SERVER_MESSAGE, @@ -28,7 +29,7 @@ class TrafficRecorder { UNKNOWN_MESSAGE_TYPE }; - struct TrafficRecord { + struct SYNC_EXPORT_PRIVATE TrafficRecord { // The serialized message. std::string message; TrafficMessageType message_type; diff --git a/sync/internal_api/debug_info_event_listener.h b/sync/internal_api/debug_info_event_listener.h index 3ccdcb0..8aa72f8 100644 --- a/sync/internal_api/debug_info_event_listener.h +++ b/sync/internal_api/debug_info_event_listener.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -9,6 +9,7 @@ #include <string> #include "base/compiler_specific.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/data_type_debug_info_listener.h" #include "sync/internal_api/public/sessions/sync_session_snapshot.h" #include "sync/internal_api/public/sync_encryption_handler.h" @@ -27,10 +28,11 @@ const unsigned int kMaxEntries = 25; // Listens to events and records them in a queue. And passes the events to // syncer when requested. // This class is not thread safe and should only be accessed on the sync thread. -class DebugInfoEventListener : public SyncManager::Observer, - public SyncEncryptionHandler::Observer, - public sessions::DebugInfoGetter, - public DataTypeDebugInfoListener { +class SYNC_EXPORT_PRIVATE DebugInfoEventListener + : public SyncManager::Observer, + public SyncEncryptionHandler::Observer, + public sessions::DebugInfoGetter, + public DataTypeDebugInfoListener { public: DebugInfoEventListener(); virtual ~DebugInfoEventListener(); diff --git a/sync/internal_api/http_bridge.cc b/sync/internal_api/http_bridge.cc index 5b38233..71f822c 100644 --- a/sync/internal_api/http_bridge.cc +++ b/sync/internal_api/http_bridge.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -312,4 +312,9 @@ void HttpBridge::OnURLFetchComplete(const net::URLFetcher* source) { http_post_completed_.Signal(); } +net::URLRequestContextGetter* HttpBridge::GetRequestContextGetterForTest() + const { + return context_getter_for_request_; +} + } // namespace syncer diff --git a/sync/internal_api/http_bridge_unittest.cc b/sync/internal_api/http_bridge_unittest.cc index 5dae475..71b4f41 100644 --- a/sync/internal_api/http_bridge_unittest.cc +++ b/sync/internal_api/http_bridge_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -75,7 +75,7 @@ class SyncHttpBridgeTest : public testing::Test { test->GetTestRequestContextGetter()->GetURLRequestContext()-> http_transaction_factory()->GetSession(); EXPECT_EQ(test_session, - http_bridge->GetRequestContextGetter()-> + http_bridge->GetRequestContextGetterForTest()-> GetURLRequestContext()-> http_transaction_factory()->GetSession()); main_message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); diff --git a/sync/internal_api/js_mutation_event_observer.h b/sync/internal_api/js_mutation_event_observer.h index 2fb1d48..9d23351 100644 --- a/sync/internal_api/js_mutation_event_observer.h +++ b/sync/internal_api/js_mutation_event_observer.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -11,6 +11,7 @@ #include "base/compiler_specific.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/sync_manager.h" #include "sync/internal_api/public/util/weak_handle.h" #include "sync/syncable/transaction_observer.h" @@ -26,7 +27,7 @@ class JsEventHandler; // Observes all change- and transaction-related events and routes a // summarized version to a JsEventHandler. -class JsMutationEventObserver +class SYNC_EXPORT_PRIVATE JsMutationEventObserver : public SyncManager::ChangeObserver, public syncable::TransactionObserver, public base::NonThreadSafe { diff --git a/sync/internal_api/js_sync_encryption_handler_observer.h b/sync/internal_api/js_sync_encryption_handler_observer.h index 39dfcd1..9c74178 100644 --- a/sync/internal_api/js_sync_encryption_handler_observer.h +++ b/sync/internal_api/js_sync_encryption_handler_observer.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -9,6 +9,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/sync_encryption_handler.h" #include "sync/internal_api/public/util/weak_handle.h" #include "sync/protocol/sync_protocol_error.h" @@ -23,7 +24,8 @@ class JsEventDetails; class JsEventHandler; // Routes SyncEncryptionHandler events to a JsEventHandler. -class JsSyncEncryptionHandlerObserver : public SyncEncryptionHandler::Observer { +class SYNC_EXPORT_PRIVATE JsSyncEncryptionHandlerObserver + : public SyncEncryptionHandler::Observer { public: JsSyncEncryptionHandlerObserver(); virtual ~JsSyncEncryptionHandlerObserver(); diff --git a/sync/internal_api/js_sync_manager_observer.h b/sync/internal_api/js_sync_manager_observer.h index 867c734..bda6d8c 100644 --- a/sync/internal_api/js_sync_manager_observer.h +++ b/sync/internal_api/js_sync_manager_observer.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -9,6 +9,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/sync_manager.h" #include "sync/internal_api/public/util/weak_handle.h" #include "sync/protocol/sync_protocol_error.h" @@ -23,7 +24,7 @@ class JsEventDetails; class JsEventHandler; // Routes SyncManager events to a JsEventHandler. -class JsSyncManagerObserver : public SyncManager::Observer { +class SYNC_EXPORT_PRIVATE JsSyncManagerObserver : public SyncManager::Observer { public: JsSyncManagerObserver(); virtual ~JsSyncManagerObserver(); diff --git a/sync/internal_api/public/base/invalidation.cc b/sync/internal_api/public/base/invalidation.cc index 58f5cce..1fb7a0c 100644 --- a/sync/internal_api/public/base/invalidation.cc +++ b/sync/internal_api/public/base/invalidation.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -61,10 +61,16 @@ AckHandle::AckHandle(const std::string& state, base::Time timestamp) : state_(state), timestamp_(timestamp) { } +AckHandle::~AckHandle() { +} + Invalidation::Invalidation() : ack_handle(AckHandle::InvalidAckHandle()) { } +Invalidation::~Invalidation() { +} + bool Invalidation::Equals(const Invalidation& other) const { return (payload == other.payload) && ack_handle.Equals(other.ack_handle); } diff --git a/sync/internal_api/public/base/invalidation.h b/sync/internal_api/public/base/invalidation.h index 18afcab..ba70493 100644 --- a/sync/internal_api/public/base/invalidation.h +++ b/sync/internal_api/public/base/invalidation.h @@ -32,6 +32,8 @@ class SYNC_EXPORT AckHandle { bool IsValid() const; + ~AckHandle(); + private: // Explicitly copyable and assignable for STL containers. AckHandle(const std::string& state, base::Time timestamp); @@ -45,8 +47,9 @@ class SYNC_EXPORT AckHandle { // associated ack handle that an InvalidationHandler implementation can use to // acknowledge receipt of the invalidation. It does not embed the object ID, // since it is typically associated with it through ObjectIdInvalidationMap. -struct Invalidation { +struct SYNC_EXPORT Invalidation { Invalidation(); + ~Invalidation(); bool Equals(const Invalidation& other) const; diff --git a/sync/internal_api/public/base/model_type.h b/sync/internal_api/public/base/model_type.h index 23ca2d8..f24e61d 100644 --- a/sync/internal_api/public/base/model_type.h +++ b/sync/internal_api/public/base/model_type.h @@ -123,7 +123,8 @@ SYNC_EXPORT void AddDefaultFieldValue(ModelType datatype, // local concept: the enum is not in the protocol. The SyncEntity's ModelType // is inferred from the presence of particular datatype field in the // entity specifics. -ModelType GetModelType(const sync_pb::SyncEntity& sync_entity); +SYNC_EXPORT_PRIVATE ModelType GetModelType( + const sync_pb::SyncEntity& sync_entity); // Extract the model type from an EntitySpecifics field. Note that there // are some ModelTypes (like TOP_LEVEL_FOLDER) that can't be inferred this way; @@ -140,7 +141,7 @@ bool ShouldMaintainPosition(ModelType model_type); SYNC_EXPORT ModelTypeSet UserTypes(); // This is the subset of UserTypes() that can be encrypted. -ModelTypeSet EncryptableUserTypes(); +SYNC_EXPORT_PRIVATE ModelTypeSet EncryptableUserTypes(); // Returns a list of all control types. // @@ -179,7 +180,8 @@ SYNC_EXPORT bool IsControlType(ModelType model_type); // } // model_types.Put(model_type); // } -ModelType GetModelTypeFromSpecificsFieldNumber(int field_number); +SYNC_EXPORT_PRIVATE ModelType GetModelTypeFromSpecificsFieldNumber( + int field_number); // Return the field number of the EntitySpecifics field associated with // a model type. @@ -199,10 +201,10 @@ SYNC_EXPORT const char* ModelTypeToString(ModelType model_type); // Handles all model types, and not just real ones. // // Caller takes ownership of returned value. -base::StringValue* ModelTypeToValue(ModelType model_type); +SYNC_EXPORT_PRIVATE base::StringValue* ModelTypeToValue(ModelType model_type); // Converts a Value into a ModelType - complement to ModelTypeToValue(). -ModelType ModelTypeFromValue(const base::Value& value); +SYNC_EXPORT_PRIVATE ModelType ModelTypeFromValue(const base::Value& value); // Returns the ModelType corresponding to the name |model_type_string|. SYNC_EXPORT ModelType ModelTypeFromString( diff --git a/sync/internal_api/public/base/model_type_invalidation_map.h b/sync/internal_api/public/base/model_type_invalidation_map.h index 7cc4a14..9216562 100644 --- a/sync/internal_api/public/base/model_type_invalidation_map.h +++ b/sync/internal_api/public/base/model_type_invalidation_map.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -33,20 +33,20 @@ typedef std::map<ModelType, Invalidation> ModelTypeInvalidationMap; SYNC_EXPORT ModelTypeInvalidationMap ModelTypeSetToInvalidationMap( ModelTypeSet model_types, const std::string& payload); -ModelTypeSet ModelTypeInvalidationMapToSet( +SYNC_EXPORT_PRIVATE ModelTypeSet ModelTypeInvalidationMapToSet( const ModelTypeInvalidationMap& invalidation_map); std::string ModelTypeInvalidationMapToString( const ModelTypeInvalidationMap& invalidation_map); // Caller takes ownership of the returned dictionary. -base::DictionaryValue* ModelTypeInvalidationMapToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* ModelTypeInvalidationMapToValue( const ModelTypeInvalidationMap& invalidation_map); // Coalesce |update| into |original|, overwriting only when |update| has // a non-empty payload. -void CoalesceStates(ModelTypeInvalidationMap* original, - const ModelTypeInvalidationMap& update); +SYNC_EXPORT_PRIVATE void CoalesceStates(ModelTypeInvalidationMap* original, + const ModelTypeInvalidationMap& update); } // namespace syncer diff --git a/sync/internal_api/public/base/node_ordinal.h b/sync/internal_api/public/base/node_ordinal.h index 1c49be0..bc9a04b 100644 --- a/sync/internal_api/public/base/node_ordinal.h +++ b/sync/internal_api/public/base/node_ordinal.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -6,6 +6,7 @@ #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_ORDINAL_H_ #include "base/basictypes.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/ordinal.h" namespace syncer { @@ -42,13 +43,13 @@ COMPILE_ASSERT(NodeOrdinal::kRadix == 256, // field of SyncEntity) to a NodeOrdinal. This transformation // preserves the ordering relation: a < b under integer ordering if // and only if Int64ToNodeOrdinal(a) < Int64ToNodeOrdinal(b). -NodeOrdinal Int64ToNodeOrdinal(int64 x); +SYNC_EXPORT_PRIVATE NodeOrdinal Int64ToNodeOrdinal(int64 x); // The inverse of Int64ToNodeOrdinal. This conversion is, in general, // lossy: NodeOrdinals can have arbitrary fidelity, while numeric // positions contain only 64 bits of information (in fact, this is the // reason we've moved away from them). -int64 NodeOrdinalToInt64(const NodeOrdinal& ordinal); +SYNC_EXPORT_PRIVATE int64 NodeOrdinalToInt64(const NodeOrdinal& ordinal); } // namespace syncer diff --git a/sync/internal_api/public/base/progress_marker_map.h b/sync/internal_api/public/base/progress_marker_map.h index 7091ca1..cf022e2 100644 --- a/sync/internal_api/public/base/progress_marker_map.h +++ b/sync/internal_api/public/base/progress_marker_map.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -27,7 +27,7 @@ namespace syncer { // DataTypeProgressMarkers. typedef std::map<ModelType, std::string> ProgressMarkerMap; -scoped_ptr<base::DictionaryValue> ProgressMarkerMapToValue( +SYNC_EXPORT_PRIVATE scoped_ptr<base::DictionaryValue> ProgressMarkerMapToValue( const ProgressMarkerMap& marker_map); } // namespace syncer diff --git a/sync/internal_api/public/change_record.h b/sync/internal_api/public/change_record.h index d7dc587..062d6fa 100644 --- a/sync/internal_api/public/change_record.h +++ b/sync/internal_api/public/change_record.h @@ -41,7 +41,7 @@ class SYNC_EXPORT ExtraPasswordChangeRecordData { // operation. This gives the sync id of the node that changed, and the type // of change. To get the actual property values after an ADD or UPDATE, the // client should get the node with InitByIdLookup(), using the provided id. -struct ChangeRecord { +struct SYNC_EXPORT_PRIVATE ChangeRecord { enum Action { ACTION_ADD, ACTION_DELETE, diff --git a/sync/internal_api/public/engine/model_safe_worker.h b/sync/internal_api/public/engine/model_safe_worker.h index 380beda..fbec6b1 100644 --- a/sync/internal_api/public/engine/model_safe_worker.h +++ b/sync/internal_api/public/engine/model_safe_worker.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -74,7 +74,7 @@ class SYNC_EXPORT ModelSafeWorker typedef std::map<ModelType, ModelSafeGroup> ModelSafeRoutingInfo; // Caller takes ownership of return value. -base::DictionaryValue* ModelSafeRoutingInfoToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* ModelSafeRoutingInfoToValue( const ModelSafeRoutingInfo& routing_info); SYNC_EXPORT std::string ModelSafeRoutingInfoToString( @@ -82,9 +82,10 @@ SYNC_EXPORT std::string ModelSafeRoutingInfoToString( // Make a ModelTypeInvalidationMap for all the enabled types in a // ModelSafeRoutingInfo using a default payload. -ModelTypeInvalidationMap ModelSafeRoutingInfoToInvalidationMap( - const ModelSafeRoutingInfo& routes, - const std::string& payload); +SYNC_EXPORT_PRIVATE ModelTypeInvalidationMap + ModelSafeRoutingInfoToInvalidationMap( + const ModelSafeRoutingInfo& routes, + const std::string& payload); SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( const ModelSafeRoutingInfo& routing_info); diff --git a/sync/internal_api/public/engine/polling_constants.h b/sync/internal_api/public/engine/polling_constants.h index 8a57f28..8f4f100 100644 --- a/sync/internal_api/public/engine/polling_constants.h +++ b/sync/internal_api/public/engine/polling_constants.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -11,8 +11,8 @@ namespace syncer { -extern const int64 kDefaultShortPollIntervalSeconds; -extern const int64 kDefaultLongPollIntervalSeconds; +SYNC_EXPORT_PRIVATE extern const int64 kDefaultShortPollIntervalSeconds; +SYNC_EXPORT_PRIVATE extern const int64 kDefaultLongPollIntervalSeconds; SYNC_EXPORT extern const int64 kMaxBackoffSeconds; SYNC_EXPORT extern const int kBackoffRandomizationFactor; SYNC_EXPORT_PRIVATE extern const int kInitialBackoffRetrySeconds; diff --git a/sync/internal_api/public/http_bridge.h b/sync/internal_api/public/http_bridge.h index 880c588..470c1c6 100644 --- a/sync/internal_api/public/http_bridge.h +++ b/sync/internal_api/public/http_bridge.h @@ -38,10 +38,13 @@ namespace syncer { // This is a one-time use bridge. Create one for each request you want to make. // It is RefCountedThreadSafe because it can PostTask to the io loop, and thus // needs to stick around across context switches, etc. -class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, - public HttpPostProviderInterface, - public net::URLFetcherDelegate { +class SYNC_EXPORT_PRIVATE HttpBridge + : public base::RefCountedThreadSafe<HttpBridge>, + public HttpPostProviderInterface, + public net::URLFetcherDelegate { public: + friend class SyncHttpBridgeTest; + // A request context used for HTTP requests bridged from the sync backend. // A bridged RequestContext has a dedicated in-memory cookie store and does // not use a cache. Thus the same type can be used for incognito mode. @@ -69,7 +72,8 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, }; // Lazy-getter for RequestContext objects. - class RequestContextGetter : public net::URLRequestContextGetter { + class SYNC_EXPORT_PRIVATE RequestContextGetter + : public net::URLRequestContextGetter { public: RequestContextGetter( net::URLRequestContextGetter* baseline_context_getter, @@ -118,11 +122,7 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, // net::URLFetcherDelegate implementation. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; -#if defined(UNIT_TEST) - net::URLRequestContextGetter* GetRequestContextGetter() const { - return context_getter_for_request_; - } -#endif + net::URLRequestContextGetter* GetRequestContextGetterForTest() const; protected: friend class base::RefCountedThreadSafe<HttpBridge>; diff --git a/sync/internal_api/public/http_post_provider_interface.h b/sync/internal_api/public/http_post_provider_interface.h index c703e30..7e7ba3c 100644 --- a/sync/internal_api/public/http_post_provider_interface.h +++ b/sync/internal_api/public/http_post_provider_interface.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -7,13 +7,15 @@ #include <string> +#include "sync/base/sync_export.h" + namespace syncer { // An interface the embedding application (e.g. Chromium) implements to provide // required HTTP POST functionality to the syncer backend. This interface is // designed for one-time use. You create one, use it, and create another if you // want to make a subsequent POST. -class HttpPostProviderInterface { +class SYNC_EXPORT_PRIVATE HttpPostProviderInterface { public: // Add additional headers to the request. virtual void SetExtraRequestHeaders(const char* headers) = 0; diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h index 9746928..9ae1940 100644 --- a/sync/internal_api/public/sync_manager.h +++ b/sync/internal_api/public/sync_manager.h @@ -131,7 +131,7 @@ class SYNC_EXPORT SyncManager { // Like ChangeDelegate, except called only on the sync thread and // not while a transaction is held. For objects that want to know // when changes happen, but don't need to process them. - class ChangeObserver { + class SYNC_EXPORT_PRIVATE ChangeObserver { public: // Ids referred to in |changes| may or may not be in the write // transaction specified by |write_transaction_id|. If they're diff --git a/sync/internal_api/public/user_share.h b/sync/internal_api/public/user_share.h index af4e231e..d1c4be7 100644 --- a/sync/internal_api/public/user_share.h +++ b/sync/internal_api/public/user_share.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -8,6 +8,7 @@ #include <string> #include "base/memory/scoped_ptr.h" +#include "sync/base/sync_export.h" namespace syncer { @@ -19,7 +20,7 @@ class Directory; // user and their data (share). // This encompasses all pieces required to build transaction objects on the // syncable share. -struct UserShare { +struct SYNC_EXPORT_PRIVATE UserShare { UserShare(); ~UserShare(); diff --git a/sync/internal_api/public/util/syncer_error.h b/sync/internal_api/public/util/syncer_error.h index f3ee9ee..9711597 100644 --- a/sync/internal_api/public/util/syncer_error.h +++ b/sync/internal_api/public/util/syncer_error.h @@ -18,7 +18,7 @@ namespace syncer { // For convenience, functions which are invoked only by SyncerCommands may also // return a SyncerError. It saves us having to write a conversion function, and // it makes refactoring easier. -enum SyncerError { +enum SYNC_EXPORT_PRIVATE SyncerError { UNSET = 0, // Default value. CANNOT_DO_WORK, // A model worker could not process a work item. diff --git a/sync/internal_api/public/util/weak_handle.h b/sync/internal_api/public/util/weak_handle.h index bac7c37..57a44bd 100644 --- a/sync/internal_api/public/util/weak_handle.h +++ b/sync/internal_api/public/util/weak_handle.h @@ -58,6 +58,7 @@ #include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" +#include "sync/base/sync_export.h" namespace base { class MessageLoopProxy; @@ -99,7 +100,7 @@ struct ParamTraits<T[]> { // Base class for WeakHandleCore<T> to avoid template bloat. Handles // the interaction with the owner thread and its message loop. -class WeakHandleCoreBase { +class SYNC_EXPORT WeakHandleCoreBase { public: // Assumes the current thread is the owner thread. WeakHandleCoreBase(); @@ -125,7 +126,7 @@ class WeakHandleCoreBase { // WeakHandleCore<T> contains all the logic for WeakHandle<T>. template <typename T> class WeakHandleCore - : public NON_EXPORTED_BASE(WeakHandleCoreBase), + : public WeakHandleCoreBase, public base::RefCountedThreadSafe<WeakHandleCore<T> > { public: // Must be called on |ptr|'s owner thread, which is assumed to be diff --git a/sync/internal_api/sync_encryption_handler_impl.h b/sync/internal_api/sync_encryption_handler_impl.h index a308503..f3a7909 100644 --- a/sync/internal_api/sync_encryption_handler_impl.h +++ b/sync/internal_api/sync_encryption_handler_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -14,6 +14,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/sync_encryption_handler.h" #include "sync/syncable/nigori_handler.h" #include "sync/util/cryptographer.h" @@ -41,7 +42,7 @@ class WriteTransaction; // sync methods. // All methods are non-thread-safe and should only be called from the sync // thread unless explicitly noted otherwise. -class SyncEncryptionHandlerImpl +class SYNC_EXPORT_PRIVATE SyncEncryptionHandlerImpl : public SyncEncryptionHandler, public syncable::NigoriHandler { public: diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h index d36ca2e..8942201 100644 --- a/sync/internal_api/sync_manager_impl.h +++ b/sync/internal_api/sync_manager_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -9,6 +9,7 @@ #include <vector> #include "net/base/network_change_notifier.h" +#include "sync/base/sync_export.h" #include "sync/engine/all_status.h" #include "sync/engine/net/server_connection_manager.h" #include "sync/engine/sync_engine_event.h" @@ -46,7 +47,7 @@ class SyncSessionContext; // // Unless stated otherwise, all methods of SyncManager should be called on the // same thread. -class SyncManagerImpl : +class SYNC_EXPORT_PRIVATE SyncManagerImpl : public SyncManager, public net::NetworkChangeNotifier::IPAddressObserver, public net::NetworkChangeNotifier::ConnectionTypeObserver, diff --git a/sync/internal_api/syncapi_internal.h b/sync/internal_api/syncapi_internal.h index 19932e8..06689aad 100644 --- a/sync/internal_api/syncapi_internal.h +++ b/sync/internal_api/syncapi_internal.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -10,6 +10,8 @@ #include <string> +#include "sync/base/sync_export.h" + namespace sync_pb { class EntitySpecifics; class PasswordSpecificsData; @@ -23,8 +25,8 @@ sync_pb::PasswordSpecificsData* DecryptPasswordSpecifics( const sync_pb::EntitySpecifics& specifics, Cryptographer* crypto); -void SyncAPINameToServerName(const std::string& syncer_name, - std::string* out); +SYNC_EXPORT_PRIVATE void SyncAPINameToServerName(const std::string& syncer_name, + std::string* out); bool IsNameServerIllegalAfterTrimming(const std::string& name); diff --git a/sync/internal_api/syncapi_server_connection_manager.h b/sync/internal_api/syncapi_server_connection_manager.h index 99656c1..6f0fb3f 100644 --- a/sync/internal_api/syncapi_server_connection_manager.h +++ b/sync/internal_api/syncapi_server_connection_manager.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" +#include "sync/base/sync_export.h" #include "sync/engine/net/server_connection_manager.h" namespace syncer { @@ -46,7 +47,8 @@ class SyncAPIBridgedConnection : public ServerConnectionManager::Connection { // A ServerConnectionManager subclass used by the syncapi layer. We use a // subclass so that we can override MakePost() to generate a POST object using // an instance of the HttpPostProviderFactory class. -class SyncAPIServerConnectionManager : public ServerConnectionManager { +class SYNC_EXPORT_PRIVATE SyncAPIServerConnectionManager + : public ServerConnectionManager { public: // Takes ownership of factory. SyncAPIServerConnectionManager(const std::string& server, diff --git a/sync/js/js_backend.h b/sync/js/js_backend.h index ea1d7aa..e39600a 100644 --- a/sync/js/js_backend.h +++ b/sync/js/js_backend.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -9,6 +9,8 @@ #include <string> +#include "sync/base/sync_export.h" + namespace syncer { class JsArgList; @@ -19,7 +21,7 @@ template <typename T> class WeakHandle; // Interface representing the backend of chrome://sync-internals. A // JsBackend can handle messages and can emit events to a // JsEventHandler. -class JsBackend { +class SYNC_EXPORT_PRIVATE JsBackend { public: // Starts emitting events to the given handler, if initialized. virtual void SetJsEventHandler( diff --git a/sync/notifier/ack_tracker.h b/sync/notifier/ack_tracker.h index 1609ac9..08fcad9 100644 --- a/sync/notifier/ack_tracker.h +++ b/sync/notifier/ack_tracker.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -14,6 +14,7 @@ #include "base/time.h" #include "base/timer.h" #include "net/base/backoff_entry.h" +#include "sync/base/sync_export.h" #include "sync/notifier/invalidation_util.h" namespace syncer { @@ -23,9 +24,9 @@ namespace syncer { // periodically triggers a callback for each timeout period. The timeout is a // simple exponentially increasing time that starts at 60 seconds and is capped // at 600 seconds. -class AckTracker { +class SYNC_EXPORT_PRIVATE AckTracker { public: - class Delegate { + class SYNC_EXPORT_PRIVATE Delegate { public: virtual ~Delegate(); diff --git a/sync/notifier/invalidation_handler.h b/sync/notifier/invalidation_handler.h index 0dd4721..057c37b 100644 --- a/sync/notifier/invalidation_handler.h +++ b/sync/notifier/invalidation_handler.h @@ -1,10 +1,11 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. #ifndef SYNC_NOTIFIER_INVALIDATION_HANDLER_H_ #define SYNC_NOTIFIER_INVALIDATION_HANDLER_H_ +#include "sync/base/sync_export.h" #include "sync/notifier/invalidator_state.h" #include "sync/notifier/object_id_invalidation_map.h" @@ -17,7 +18,7 @@ enum IncomingInvalidationSource { LOCAL_INVALIDATION, }; -class InvalidationHandler { +class SYNC_EXPORT InvalidationHandler { public: // Called when the invalidator state changes. virtual void OnInvalidatorStateChange(InvalidatorState state) = 0; diff --git a/sync/notifier/invalidation_notifier.h b/sync/notifier/invalidation_notifier.h index 471beba..0942364 100644 --- a/sync/notifier/invalidation_notifier.h +++ b/sync/notifier/invalidation_notifier.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -18,6 +18,7 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/threading/non_thread_safe.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/util/weak_handle.h" #include "sync/notifier/invalidation_state_tracker.h" @@ -33,7 +34,7 @@ namespace syncer { // This class must live on the IO thread. // TODO(dcheng): Think of a name better than InvalidationInvalidator. -class InvalidationNotifier +class SYNC_EXPORT_PRIVATE InvalidationNotifier : public Invalidator, public SyncInvalidationListener::Delegate, public base::NonThreadSafe { diff --git a/sync/notifier/invalidation_state_tracker.h b/sync/notifier/invalidation_state_tracker.h index ba769e9..957b9c4 100644 --- a/sync/notifier/invalidation_state_tracker.h +++ b/sync/notifier/invalidation_state_tracker.h @@ -40,7 +40,8 @@ struct SYNC_EXPORT InvalidationState { }; // TODO(dcheng): Remove this in favor of adding an Equals() method. -bool operator==(const InvalidationState& lhs, const InvalidationState& rhs); +SYNC_EXPORT_PRIVATE bool operator==(const InvalidationState& lhs, + const InvalidationState& rhs); typedef std::map<invalidation::ObjectId, InvalidationState, ObjectIdLessThan> InvalidationStateMap; diff --git a/sync/notifier/invalidation_util.h b/sync/notifier/invalidation_util.h index 414e3fe..670f612 100644 --- a/sync/notifier/invalidation_util.h +++ b/sync/notifier/invalidation_util.h @@ -25,7 +25,8 @@ class Invalidation; class ObjectId; // Gmock print helper -void PrintTo(const invalidation::ObjectId& id, std::ostream* os); +SYNC_EXPORT_PRIVATE void PrintTo(const invalidation::ObjectId& id, + std::ostream* os); } // namespace invalidation @@ -51,7 +52,8 @@ scoped_ptr<base::DictionaryValue> ObjectIdToValue( bool ObjectIdFromValue(const base::DictionaryValue& value, invalidation::ObjectId* out); -std::string ObjectIdToString(const invalidation::ObjectId& object_id); +SYNC_EXPORT_PRIVATE std::string ObjectIdToString( + const invalidation::ObjectId& object_id); SYNC_EXPORT_PRIVATE ObjectIdSet ModelTypeSetToObjectIdSet(ModelTypeSet models); ModelTypeSet ObjectIdSetToModelTypeSet(const ObjectIdSet& ids); diff --git a/sync/notifier/invalidator.h b/sync/notifier/invalidator.h index 4aa5d70..4d84b91 100644 --- a/sync/notifier/invalidator.h +++ b/sync/notifier/invalidator.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -11,6 +11,7 @@ #include <string> +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/notifier/invalidation_util.h" #include "sync/notifier/invalidator_state.h" @@ -19,7 +20,7 @@ namespace syncer { class InvalidationHandler; -class Invalidator { +class SYNC_EXPORT Invalidator { public: Invalidator() {} virtual ~Invalidator() {} diff --git a/sync/notifier/invalidator_state.h b/sync/notifier/invalidator_state.h index 80b607b..bb4b3d6 100644 --- a/sync/notifier/invalidator_state.h +++ b/sync/notifier/invalidator_state.h @@ -30,8 +30,8 @@ InvalidatorState FromNotifierReason( notifier::NotificationsDisabledReason reason); // Should not be called when |state| == INVALIDATIONS_ENABLED. -notifier::NotificationsDisabledReason ToNotifierReasonForTest( - InvalidatorState state); +SYNC_EXPORT_PRIVATE notifier::NotificationsDisabledReason + ToNotifierReasonForTest(InvalidatorState state); } // namespace syncer diff --git a/sync/notifier/non_blocking_invalidator.h b/sync/notifier/non_blocking_invalidator.h index 5e27cb0..b2be5d4 100644 --- a/sync/notifier/non_blocking_invalidator.h +++ b/sync/notifier/non_blocking_invalidator.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -15,6 +15,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "jingle/notifier/base/notifier_options.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/util/weak_handle.h" #include "sync/notifier/invalidation_handler.h" #include "sync/notifier/invalidation_state_tracker.h" @@ -29,7 +30,7 @@ namespace syncer { // TODO(akalin): Generalize the interface so it can use any Invalidator. // (http://crbug.com/140409). -class NonBlockingInvalidator +class SYNC_EXPORT_PRIVATE NonBlockingInvalidator : public Invalidator, // InvalidationHandler to "observe" our Core via WeakHandle. public InvalidationHandler { diff --git a/sync/notifier/object_id_invalidation_map.h b/sync/notifier/object_id_invalidation_map.h index 4a7c017..6560b3b 100644 --- a/sync/notifier/object_id_invalidation_map.h +++ b/sync/notifier/object_id_invalidation_map.h @@ -31,7 +31,7 @@ ObjectIdSet ObjectIdInvalidationMapToSet( SYNC_EXPORT ObjectIdInvalidationMap ObjectIdSetToInvalidationMap( const ObjectIdSet& ids, const std::string& payload); -bool ObjectIdInvalidationMapEquals( +SYNC_EXPORT bool ObjectIdInvalidationMapEquals( const ObjectIdInvalidationMap& invalidation_map1, const ObjectIdInvalidationMap& invalidation_map2); @@ -42,8 +42,9 @@ bool ObjectIdInvalidationMapFromValue(const base::ListValue& value, ObjectIdInvalidationMap* out); // Converts between ObjectIdInvalidationMaps and ModelTypeInvalidationMaps. -ModelTypeInvalidationMap ObjectIdInvalidationMapToModelTypeInvalidationMap( - const ObjectIdInvalidationMap& invalidation_map); +SYNC_EXPORT_PRIVATE ModelTypeInvalidationMap + ObjectIdInvalidationMapToModelTypeInvalidationMap( + const ObjectIdInvalidationMap& invalidation_map); SYNC_EXPORT ObjectIdInvalidationMap ModelTypeInvalidationMapToObjectIdInvalidationMap( const ModelTypeInvalidationMap& invalidation_map); diff --git a/sync/notifier/p2p_invalidator.h b/sync/notifier/p2p_invalidator.h index 9f3df2c..9bb28a5 100644 --- a/sync/notifier/p2p_invalidator.h +++ b/sync/notifier/p2p_invalidator.h @@ -30,7 +30,7 @@ class PushClient; namespace syncer { // The channel to use for sync notifications. -SYNC_EXPORT_PRIVATE extern const char kSyncP2PNotificationChannel[]; +SYNC_EXPORT extern const char kSyncP2PNotificationChannel[]; // The intended recipient(s) of a P2P notification. enum P2PNotificationTarget { @@ -41,11 +41,11 @@ enum P2PNotificationTarget { LAST_NOTIFICATION_TARGET = NOTIFY_ALL }; -std::string P2PNotificationTargetToString( +SYNC_EXPORT_PRIVATE std::string P2PNotificationTargetToString( P2PNotificationTarget target); // If |target_str| can't be parsed, assumes NOTIFY_SELF. -P2PNotificationTarget P2PNotificationTargetFromString( +SYNC_EXPORT_PRIVATE P2PNotificationTarget P2PNotificationTargetFromString( const std::string& target_str); // Helper notification data class that can be serialized to and @@ -88,8 +88,9 @@ class SYNC_EXPORT_PRIVATE P2PNotificationData { IncomingInvalidationSource source_; }; -class P2PInvalidator : public Invalidator, - public notifier::PushClientObserver { +class SYNC_EXPORT_PRIVATE P2PInvalidator + : public Invalidator, + public NON_EXPORTED_BASE(notifier::PushClientObserver) { public: // The |send_notification_target| parameter was added to allow us to send // self-notifications in some cases, but not others. The value should be diff --git a/sync/notifier/push_client_channel.h b/sync/notifier/push_client_channel.h index 0933f8b..7bf908a 100644 --- a/sync/notifier/push_client_channel.h +++ b/sync/notifier/push_client_channel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -13,6 +13,7 @@ #include "base/memory/scoped_ptr.h" #include "google/cacheinvalidation/include/system-resources.h" #include "jingle/notifier/listener/push_client_observer.h" +#include "sync/base/sync_export.h" namespace notifier { class PushClient; @@ -22,9 +23,9 @@ namespace syncer { // A PushClientChannel is an implementation of NetworkChannel that // routes messages through a PushClient. -class PushClientChannel - : public invalidation::NetworkChannel, - public notifier::PushClientObserver { +class SYNC_EXPORT_PRIVATE PushClientChannel + : public NON_EXPORTED_BASE(invalidation::NetworkChannel), + public NON_EXPORTED_BASE(notifier::PushClientObserver) { public: // |push_client| is guaranteed to be destroyed only when this object // is destroyed. diff --git a/sync/notifier/registration_manager.h b/sync/notifier/registration_manager.h index 01ae7b9..7dfef1a 100644 --- a/sync/notifier/registration_manager.h +++ b/sync/notifier/registration_manager.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -17,6 +17,7 @@ // For invalidation::InvalidationListener::RegistrationState. #include "google/cacheinvalidation/include/invalidation-listener.h" #include "google/cacheinvalidation/include/types.h" +#include "sync/base/sync_export.h" #include "sync/notifier/invalidation_util.h" namespace syncer { @@ -31,7 +32,7 @@ using ::invalidation::InvalidationListener; // implementations include the syncer thread (both versions) and XMPP // retries. The most sophisticated one is URLRequestThrottler; making // that generic should work for everyone. -class RegistrationManager : public base::NonThreadSafe { +class SYNC_EXPORT_PRIVATE RegistrationManager : public base::NonThreadSafe { public: // Constants for exponential backoff (used by tests). static const int kInitialRegistrationDelaySeconds; diff --git a/sync/notifier/state_writer.h b/sync/notifier/state_writer.h index 84abd17..b40bd45 100644 --- a/sync/notifier/state_writer.h +++ b/sync/notifier/state_writer.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -9,9 +9,11 @@ #include <string> +#include "sync/base/sync_export.h" + namespace syncer { -class StateWriter { +class SYNC_EXPORT_PRIVATE StateWriter { public: virtual ~StateWriter() {} diff --git a/sync/notifier/sync_invalidation_listener.h b/sync/notifier/sync_invalidation_listener.h index a3249ee..345a671 100644 --- a/sync/notifier/sync_invalidation_listener.h +++ b/sync/notifier/sync_invalidation_listener.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -18,6 +18,7 @@ #include "base/threading/non_thread_safe.h" #include "google/cacheinvalidation/include/invalidation-listener.h" #include "jingle/notifier/listener/push_client_observer.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/util/weak_handle.h" #include "sync/notifier/invalidation_state_tracker.h" #include "sync/notifier/invalidator_state.h" @@ -39,10 +40,10 @@ class RegistrationManager; // SyncInvalidationListener is not thread-safe and lives on the sync // thread. -class SyncInvalidationListener - : public invalidation::InvalidationListener, +class SYNC_EXPORT_PRIVATE SyncInvalidationListener + : public NON_EXPORTED_BASE(invalidation::InvalidationListener), public StateWriter, - public notifier::PushClientObserver, + public NON_EXPORTED_BASE(notifier::PushClientObserver), public base::NonThreadSafe { public: typedef base::Callback<invalidation::InvalidationClient*( @@ -52,7 +53,7 @@ class SyncInvalidationListener const invalidation::string&, invalidation::InvalidationListener*)> CreateInvalidationClientCallback; - class Delegate { + class SYNC_EXPORT_PRIVATE Delegate { public: virtual ~Delegate(); diff --git a/sync/notifier/sync_system_resources.h b/sync/notifier/sync_system_resources.h index bd6fc48..9b660bf 100644 --- a/sync/notifier/sync_system_resources.h +++ b/sync/notifier/sync_system_resources.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. // @@ -19,6 +19,7 @@ #include "base/message_loop.h" #include "base/threading/non_thread_safe.h" #include "google/cacheinvalidation/include/system-resources.h" +#include "sync/base/sync_export.h" #include "sync/notifier/push_client_channel.h" #include "sync/notifier/state_writer.h" @@ -116,7 +117,8 @@ class SyncStorage : public invalidation::Storage { std::string cached_state_; }; -class SyncSystemResources : public invalidation::SystemResources { +class SYNC_EXPORT_PRIVATE SyncSystemResources + : public NON_EXPORTED_BASE(invalidation::SystemResources) { public: SyncSystemResources(scoped_ptr<notifier::PushClient> push_client, StateWriter* state_writer); diff --git a/sync/protocol/proto_enum_conversions.h b/sync/protocol/proto_enum_conversions.h index 81b86f8..a027858 100644 --- a/sync/protocol/proto_enum_conversions.h +++ b/sync/protocol/proto_enum_conversions.h @@ -20,25 +20,27 @@ namespace syncer { // The returned strings (which don't have to be freed) are in ASCII. // The result of passing in an invalid enum value is undefined. -const char* GetBrowserTypeString( +SYNC_EXPORT_PRIVATE const char* GetBrowserTypeString( sync_pb::SessionWindow::BrowserType browser_type); -const char* GetPageTransitionString( +SYNC_EXPORT_PRIVATE const char* GetPageTransitionString( sync_pb::SyncEnums::PageTransition page_transition); -const char* GetPageTransitionRedirectTypeString( +SYNC_EXPORT_PRIVATE const char* GetPageTransitionRedirectTypeString( sync_pb::SyncEnums::PageTransitionRedirectType redirect_type); SYNC_EXPORT const char* GetUpdatesSourceString( sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source); -const char* GetResponseTypeString( +SYNC_EXPORT_PRIVATE const char* GetResponseTypeString( sync_pb::CommitResponse::ResponseType response_type); -const char* GetErrorTypeString(sync_pb::SyncEnums::ErrorType error_type); +SYNC_EXPORT_PRIVATE const char* GetErrorTypeString( + sync_pb::SyncEnums::ErrorType error_type); -const char* GetActionString(sync_pb::SyncEnums::Action action); +SYNC_EXPORT_PRIVATE const char* GetActionString( + sync_pb::SyncEnums::Action action); const char* GetDeviceTypeString( sync_pb::SyncEnums::DeviceType device_type); diff --git a/sync/protocol/proto_value_conversions.h b/sync/protocol/proto_value_conversions.h index cbfd447..5c150ce 100644 --- a/sync/protocol/proto_value_conversions.h +++ b/sync/protocol/proto_value_conversions.h @@ -70,30 +70,30 @@ namespace syncer { // caller. // TODO(akalin): Perhaps extend this to decrypt? -base::DictionaryValue* EncryptedDataToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* EncryptedDataToValue( const sync_pb::EncryptedData& encrypted_data); // Sub-protocol of AppSpecifics. -base::DictionaryValue* AppSettingsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* AppSettingsToValue( const sync_pb::AppNotificationSettings& app_notification_settings); // Sub-protocols of SessionSpecifics. -base::DictionaryValue* SessionHeaderToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* SessionHeaderToValue( const sync_pb::SessionHeader& session_header); -base::DictionaryValue* SessionTabToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* SessionTabToValue( const sync_pb::SessionTab& session_tab); -base::DictionaryValue* SessionWindowToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* SessionWindowToValue( const sync_pb::SessionWindow& session_window); -base::DictionaryValue* TabNavigationToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* TabNavigationToValue( const sync_pb::TabNavigation& tab_navigation); // Sub-protocol of PasswordSpecifics. -base::DictionaryValue* PasswordSpecificsDataToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* PasswordSpecificsDataToValue( const sync_pb::PasswordSpecificsData& password_specifics_data); // Sub-protocol of NigoriSpecifics. @@ -116,71 +116,71 @@ base::DictionaryValue* KeystoreEncryptionToValue( // Main *SpecificsToValue functions. -base::DictionaryValue* AppNotificationToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* AppNotificationToValue( const sync_pb::AppNotification& app_notification_specifics); base::DictionaryValue* AppSettingSpecificsToValue( const sync_pb::AppSettingSpecifics& app_setting_specifics); -base::DictionaryValue* AppSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* AppSpecificsToValue( const sync_pb::AppSpecifics& app_specifics); -base::DictionaryValue* AutofillSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* AutofillSpecificsToValue( const sync_pb::AutofillSpecifics& autofill_specifics); -base::DictionaryValue* AutofillProfileSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* AutofillProfileSpecificsToValue( const sync_pb::AutofillProfileSpecifics& autofill_profile_specifics); -base::DictionaryValue* BookmarkSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* BookmarkSpecificsToValue( const sync_pb::BookmarkSpecifics& bookmark_specifics); -base::DictionaryValue* DeviceInfoSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* DeviceInfoSpecificsToValue( const sync_pb::DeviceInfoSpecifics& device_info_specifics); -base::DictionaryValue* ExperimentsSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* ExperimentsSpecificsToValue( const sync_pb::ExperimentsSpecifics& proto); -base::DictionaryValue* ExtensionSettingSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* ExtensionSettingSpecificsToValue( const sync_pb::ExtensionSettingSpecifics& extension_setting_specifics); -base::DictionaryValue* ExtensionSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* ExtensionSpecificsToValue( const sync_pb::ExtensionSpecifics& extension_specifics); SYNC_EXPORT base::DictionaryValue* HistoryDeleteDirectiveSpecificsToValue( const sync_pb::HistoryDeleteDirectiveSpecifics& history_delete_directive_specifics); -base::DictionaryValue* NigoriSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* NigoriSpecificsToValue( const sync_pb::NigoriSpecifics& nigori_specifics); -base::DictionaryValue* PasswordSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* PasswordSpecificsToValue( const sync_pb::PasswordSpecifics& password_specifics); -base::DictionaryValue* PreferenceSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* PreferenceSpecificsToValue( const sync_pb::PreferenceSpecifics& password_specifics); -base::DictionaryValue* SearchEngineSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* SearchEngineSpecificsToValue( const sync_pb::SearchEngineSpecifics& search_engine_specifics); -base::DictionaryValue* SessionSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* SessionSpecificsToValue( const sync_pb::SessionSpecifics& session_specifics); -base::DictionaryValue* ThemeSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* ThemeSpecificsToValue( const sync_pb::ThemeSpecifics& theme_specifics); -base::DictionaryValue* TypedUrlSpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* TypedUrlSpecificsToValue( const sync_pb::TypedUrlSpecifics& typed_url_specifics); // Any present extensions are mapped to sub-dictionary values with the // key equal to the extension name. -base::DictionaryValue* EntitySpecificsToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* EntitySpecificsToValue( const sync_pb::EntitySpecifics& specifics); -base::DictionaryValue* ClientToServerMessageToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* ClientToServerMessageToValue( const sync_pb::ClientToServerMessage& proto, bool include_specifics); -base::DictionaryValue* ClientToServerResponseToValue( +SYNC_EXPORT_PRIVATE base::DictionaryValue* ClientToServerResponseToValue( const sync_pb::ClientToServerResponse& proto, bool include_specifics); diff --git a/sync/sessions/DEPS b/sync/sessions/DEPS index bdbefee..57778b0 100644 --- a/sync/sessions/DEPS +++ b/sync/sessions/DEPS @@ -1,4 +1,5 @@ include_rules = [ + "+sync/base", "+sync/engine", "+sync/internal_api/public/base", "+sync/internal_api/public/engine", diff --git a/sync/sessions/debug_info_getter.h b/sync/sessions/debug_info_getter.h index c434091..c1536ba 100644 --- a/sync/sessions/debug_info_getter.h +++ b/sync/sessions/debug_info_getter.h @@ -1,10 +1,11 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. #ifndef SYNC_SESSIONS_DEBUG_INFO_GETTER_H_ #define SYNC_SESSIONS_DEBUG_INFO_GETTER_H_ +#include "sync/base/sync_export.h" #include "sync/protocol/sync.pb.h" namespace syncer { @@ -12,7 +13,7 @@ namespace sessions { // This is the interface that needs to be implemented by the event listener // to communicate the debug info data to the syncer. -class DebugInfoGetter { +class SYNC_EXPORT_PRIVATE DebugInfoGetter { public: // Gets the client debug info and clears the state so the same data is not // sent again. diff --git a/sync/sessions/ordered_commit_set.h b/sync/sessions/ordered_commit_set.h index cc6940a..862ee23 100644 --- a/sync/sessions/ordered_commit_set.h +++ b/sync/sessions/ordered_commit_set.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -9,6 +9,7 @@ #include <set> #include <vector> +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/engine/model_safe_worker.h" #include "sync/syncable/syncable_id.h" @@ -19,7 +20,7 @@ namespace sessions { // TODO(ncarter): This code is more generic than just Commit and can // be reused elsewhere (e.g. ChangeReorderBuffer do similar things). Merge // all these implementations. -class OrderedCommitSet { +class SYNC_EXPORT_PRIVATE OrderedCommitSet { public: // A list of indices into the full list of commit ids such that: // 1 - each element is an index belonging to a particular ModelSafeGroup. diff --git a/sync/sessions/status_controller.h b/sync/sessions/status_controller.h index 9e1e73c..bf100b0 100644 --- a/sync/sessions/status_controller.h +++ b/sync/sessions/status_controller.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -34,13 +34,14 @@ #include "base/logging.h" #include "base/stl_util.h" #include "base/time.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/sessions/model_neutral_state.h" #include "sync/sessions/ordered_commit_set.h" namespace syncer { namespace sessions { -class StatusController { +class SYNC_EXPORT_PRIVATE StatusController { public: explicit StatusController(const ModelSafeRoutingInfo& routes); ~StatusController(); diff --git a/sync/sessions/sync_session.h b/sync/sessions/sync_session.h index 58065b7..901e3b5 100644 --- a/sync/sessions/sync_session.h +++ b/sync/sessions/sync_session.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -23,6 +23,7 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/time.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/engine/model_safe_worker.h" #include "sync/internal_api/public/sessions/sync_session_snapshot.h" @@ -40,12 +41,12 @@ class WriteTransaction; namespace sessions { -class SyncSession { +class SYNC_EXPORT_PRIVATE SyncSession { public: // The Delegate services events that occur during the session requiring an // explicit (and session-global) action, as opposed to events that are simply // recorded in per-session state. - class Delegate { + class SYNC_EXPORT_PRIVATE Delegate { public: // The client was throttled and should cease-and-desist syncing activity // until the specified time. diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h index 16b56be..d47c3e2 100644 --- a/sync/sessions/sync_session_context.h +++ b/sync/sessions/sync_session_context.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -22,6 +22,7 @@ #include <string> #include <vector> +#include "sync/base/sync_export.h" #include "sync/engine/sync_engine_event.h" #include "sync/engine/syncer_types.h" #include "sync/engine/traffic_recorder.h" @@ -45,7 +46,7 @@ static const int kDefaultMaxCommitBatchSize = 25; namespace sessions { class TestScopedSessionEventListener; -class SyncSessionContext { +class SYNC_EXPORT_PRIVATE SyncSessionContext { public: SyncSessionContext(ServerConnectionManager* connection_manager, syncable::Directory* directory, diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h index 0eb0ae7..3b88112 100644 --- a/sync/syncable/directory.h +++ b/sync/syncable/directory.h @@ -151,7 +151,7 @@ class SYNC_EXPORT Directory { // Various data that the Directory::Kernel we are backing (persisting data // for) needs saved across runs of the application. - struct PersistedKernelInfo { + struct SYNC_EXPORT_PRIVATE PersistedKernelInfo { PersistedKernelInfo(); ~PersistedKernelInfo(); @@ -203,7 +203,7 @@ class SYNC_EXPORT Directory { // When the Directory is told to SaveChanges, a SaveChangesSnapshot is // constructed and forms a consistent snapshot of what needs to be sent to // the backing store. - struct SaveChangesSnapshot { + struct SYNC_EXPORT_PRIVATE SaveChangesSnapshot { SaveChangesSnapshot(); ~SaveChangesSnapshot(); diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc index a609527..f18bada 100644 --- a/sync/syncable/directory_backing_store.cc +++ b/sync/syncable/directory_backing_store.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -39,7 +39,6 @@ namespace syncable { static const string::size_type kUpdateStatementBufferSize = 2048; // Increment this version whenever updating DB tables. -extern const int32 kCurrentDBVersion; // Global visibility for our unittest. const int32 kCurrentDBVersion = 85; // Iterate over the fields of |entry| and bind each to |statement| for diff --git a/sync/syncable/directory_backing_store.h b/sync/syncable/directory_backing_store.h index 8170733..b7a97d3 100644 --- a/sync/syncable/directory_backing_store.h +++ b/sync/syncable/directory_backing_store.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -11,6 +11,7 @@ #include "base/threading/non_thread_safe.h" #include "sql/connection.h" #include "sql/statement.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/syncable/dir_open_result.h" #include "sync/syncable/directory.h" @@ -23,6 +24,8 @@ class EntitySpecifics; namespace syncer { namespace syncable { +SYNC_EXPORT_PRIVATE extern const int32 kCurrentDBVersion; + struct ColumnSpec; typedef Directory::MetahandlesIndex MetahandlesIndex; @@ -41,7 +44,7 @@ typedef Directory::MetahandlesIndex MetahandlesIndex; // This class is abstract so that we can extend it in interesting ways for use // in tests. The concrete class used in non-test scenarios is // OnDiskDirectoryBackingStore. -class DirectoryBackingStore : public base::NonThreadSafe { +class SYNC_EXPORT_PRIVATE DirectoryBackingStore : public base::NonThreadSafe { public: explicit DirectoryBackingStore(const std::string& dir_name); virtual ~DirectoryBackingStore(); diff --git a/sync/syncable/directory_backing_store_unittest.cc b/sync/syncable/directory_backing_store_unittest.cc index 1b89ae0..bfa4cfb 100644 --- a/sync/syncable/directory_backing_store_unittest.cc +++ b/sync/syncable/directory_backing_store_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -14,6 +14,7 @@ #include "base/string_number_conversions.h" #include "sql/connection.h" #include "sql/statement.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/node_ordinal.h" #include "sync/protocol/bookmark_specifics.pb.h" #include "sync/protocol/sync.pb.h" @@ -27,7 +28,7 @@ namespace syncer { namespace syncable { -extern const int32 kCurrentDBVersion; +SYNC_EXPORT_PRIVATE extern const int32 kCurrentDBVersion; class MigrationTest : public testing::TestWithParam<int> { public: diff --git a/sync/syncable/directory_change_delegate.h b/sync/syncable/directory_change_delegate.h index 725a344..fb76450 100644 --- a/sync/syncable/directory_change_delegate.h +++ b/sync/syncable/directory_change_delegate.h @@ -1,10 +1,11 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. #ifndef SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_ #define SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_ +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/syncable/write_transaction_info.h" @@ -21,7 +22,7 @@ namespace syncable { // (HandleTransactionCompleteChangeEvent). // // Note that these methods may be called on *any* thread. -class DirectoryChangeDelegate { +class SYNC_EXPORT_PRIVATE DirectoryChangeDelegate { public: // Returns the handles of changed entries in |entry_changed|. virtual void HandleCalculateChangesChangeEventFromSyncApi( diff --git a/sync/syncable/entry.h b/sync/syncable/entry.h index eec8051..6714696 100644 --- a/sync/syncable/entry.h +++ b/sync/syncable/entry.h @@ -1,10 +1,11 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. #ifndef SYNC_SYNCABLE_ENTRY_H_ #define SYNC_SYNCABLE_ENTRY_H_ +#include "sync/base/sync_export.h" #include "sync/syncable/entry_kernel.h" namespace syncer { @@ -41,7 +42,7 @@ enum GetByHandle { GET_BY_HANDLE }; -class Entry { +class SYNC_EXPORT Entry { public: // After constructing, you must check good() to test whether the Get // succeeded. diff --git a/sync/syncable/entry_kernel.h b/sync/syncable/entry_kernel.h index 77ad87d..6dc88a7 100644 --- a/sync/syncable/entry_kernel.h +++ b/sync/syncable/entry_kernel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -7,6 +7,7 @@ #include "base/time.h" #include "base/values.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/base/node_ordinal.h" #include "sync/internal_api/public/util/immutable.h" @@ -174,7 +175,7 @@ enum { -struct EntryKernel { +struct SYNC_EXPORT_PRIVATE EntryKernel { private: std::string string_fields[STRING_FIELDS_COUNT]; sync_pb::EntitySpecifics specifics_fields[PROTO_FIELDS_COUNT]; diff --git a/sync/syncable/in_memory_directory_backing_store.h b/sync/syncable/in_memory_directory_backing_store.h index cf45c74..79dbed8 100644 --- a/sync/syncable/in_memory_directory_backing_store.h +++ b/sync/syncable/in_memory_directory_backing_store.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -6,6 +6,7 @@ #define SYNC_SYNCABLE_IN_MEMORY_DIRECTORY_BACKING_STORE_H_ #include "sync/syncable/directory_backing_store.h" +#include "sync/base/sync_export.h" namespace syncer { namespace syncable { @@ -19,12 +20,16 @@ namespace syncable { // When an InMemoryDirectoryBackingStore is destroyed, all data stored in this // database is lost. If these limitations are a problem for you, consider using // TestDirectoryBackingStore. -class InMemoryDirectoryBackingStore : public DirectoryBackingStore { +class SYNC_EXPORT_PRIVATE InMemoryDirectoryBackingStore + : public DirectoryBackingStore { public: explicit InMemoryDirectoryBackingStore(const std::string& dir_name); virtual DirOpenResult Load( MetahandlesIndex* entry_bucket, Directory::KernelLoadInfo* kernel_load_info) OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(InMemoryDirectoryBackingStore); }; } // namespace syncable diff --git a/sync/syncable/invalid_directory_backing_store.h b/sync/syncable/invalid_directory_backing_store.h index bbd3a18..9d5f139 100644 --- a/sync/syncable/invalid_directory_backing_store.h +++ b/sync/syncable/invalid_directory_backing_store.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -6,12 +6,14 @@ #define SYNC_SYNCABLE_INVALID_DIRECTORY_BACKING_STORE_H_ #include "sync/syncable/directory_backing_store.h" +#include "sync/base/sync_export.h" namespace syncer { namespace syncable { // A class used to test scenarios where loading a directory fails. -class InvalidDirectoryBackingStore : public DirectoryBackingStore { +class SYNC_EXPORT_PRIVATE InvalidDirectoryBackingStore + : public DirectoryBackingStore { public: InvalidDirectoryBackingStore(); virtual ~InvalidDirectoryBackingStore(); diff --git a/sync/syncable/mutable_entry.h b/sync/syncable/mutable_entry.h index f01fcf6..cf7768a 100644 --- a/sync/syncable/mutable_entry.h +++ b/sync/syncable/mutable_entry.h @@ -1,10 +1,11 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. #ifndef SYNC_SYNCABLE_MUTABLE_ENTRY_H_ #define SYNC_SYNCABLE_MUTABLE_ENTRY_H_ +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/node_ordinal.h" #include "sync/syncable/entry.h" #include "sync/syncable/metahandle_set.h" @@ -26,7 +27,7 @@ enum CreateNewUpdateItem { // A mutable meta entry. Changes get committed to the database when the // WriteTransaction is destroyed. -class MutableEntry : public Entry { +class SYNC_EXPORT_PRIVATE MutableEntry : public Entry { void Init(WriteTransaction* trans, const Id& parent_id, const std::string& name); diff --git a/sync/syncable/nigori_handler.h b/sync/syncable/nigori_handler.h index 952aee1..d39ddf9 100644 --- a/sync/syncable/nigori_handler.h +++ b/sync/syncable/nigori_handler.h @@ -1,10 +1,11 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. #ifndef SYNC_SYNCABLE_NIGORI_HANDLER_H_ #define SYNC_SYNCABLE_NIGORI_HANDLER_H_ +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" namespace google{ @@ -26,7 +27,7 @@ class BaseTransaction; // Sync internal interface for dealing with nigori node and querying // the current set of encrypted types. Not thread safe, so a sync transaction // must be held by a caller whenever invoking methods. -class NigoriHandler { +class SYNC_EXPORT_PRIVATE NigoriHandler { public: NigoriHandler(); virtual ~NigoriHandler(); diff --git a/sync/syncable/nigori_util.h b/sync/syncable/nigori_util.h index 7eefed4..c2f0040 100644 --- a/sync/syncable/nigori_util.h +++ b/sync/syncable/nigori_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -8,6 +8,7 @@ #define SYNC_SYNCABLE_NIGORI_UTIL_H_ #include "base/compiler_specific.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/nigori_specifics.pb.h" @@ -33,7 +34,7 @@ class WriteTransaction; // false if some unsynced changes need to be encrypted. // This method is similar to ProcessUnsyncedChangesForEncryption but does not // modify the data and does not care if data is unnecessarily encrypted. -bool VerifyUnsyncedChangesAreEncrypted( +SYNC_EXPORT_PRIVATE bool VerifyUnsyncedChangesAreEncrypted( BaseTransaction* const trans, ModelTypeSet encrypted_types); @@ -49,11 +50,12 @@ bool EntryNeedsEncryption(ModelTypeSet encrypted_types, const Entry& entry); // Same as EntryNeedsEncryption, but looks at specifics. -bool SpecificsNeedsEncryption(ModelTypeSet encrypted_types, - const sync_pb::EntitySpecifics& specifics); +SYNC_EXPORT_PRIVATE bool SpecificsNeedsEncryption( + ModelTypeSet encrypted_types, + const sync_pb::EntitySpecifics& specifics); // Verifies all data of type |type| is encrypted appropriately. -bool VerifyDataTypeEncryptionForTest( +SYNC_EXPORT_PRIVATE bool VerifyDataTypeEncryptionForTest( BaseTransaction* const trans, ModelType type, bool is_encrypted) WARN_UNUSED_RESULT; @@ -68,9 +70,10 @@ bool UpdateEntryWithEncryption( // Updates |nigori| to match the encryption state specified by |encrypted_types| // and |encrypt_everything|. -void UpdateNigoriFromEncryptedTypes(ModelTypeSet encrypted_types, - bool encrypt_everything, - sync_pb::NigoriSpecifics* nigori); +SYNC_EXPORT_PRIVATE void UpdateNigoriFromEncryptedTypes( + ModelTypeSet encrypted_types, + bool encrypt_everything, + sync_pb::NigoriSpecifics* nigori); // Extracts the set of encrypted types from a nigori node. ModelTypeSet GetEncryptedTypesFromNigori( diff --git a/sync/syncable/on_disk_directory_backing_store.h b/sync/syncable/on_disk_directory_backing_store.h index 0bf720b..95a61e1 100644 --- a/sync/syncable/on_disk_directory_backing_store.h +++ b/sync/syncable/on_disk_directory_backing_store.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -6,6 +6,7 @@ #define SYNC_SYNCABLE_ON_DISK_DIRECTORY_BACKING_STORE_H_ #include "base/file_path.h" +#include "sync/base/sync_export.h" #include "sync/syncable/directory_backing_store.h" namespace syncer { @@ -13,7 +14,8 @@ namespace syncable { // This is the concrete class that provides a useful implementation of // DirectoryBackingStore. -class OnDiskDirectoryBackingStore : public DirectoryBackingStore { +class SYNC_EXPORT_PRIVATE OnDiskDirectoryBackingStore + : public DirectoryBackingStore { public: OnDiskDirectoryBackingStore(const std::string& dir_name, const FilePath& backing_filepath); @@ -37,6 +39,8 @@ class OnDiskDirectoryBackingStore : public DirectoryBackingStore { bool allow_failure_for_test_; FilePath backing_filepath_; + + DISALLOW_COPY_AND_ASSIGN(OnDiskDirectoryBackingStore); }; } // namespace syncable diff --git a/sync/syncable/syncable_base_transaction.h b/sync/syncable/syncable_base_transaction.h index 4e9a220..c8652b6 100644 --- a/sync/syncable/syncable_base_transaction.h +++ b/sync/syncable/syncable_base_transaction.h @@ -6,6 +6,7 @@ #define SYNC_SYNCABLE_SYNCABLE_BASE_TRANSACTION_H_ #include "base/location.h" +#include "sync/base/sync_export.h" #include "sync/syncable/syncable_id.h" namespace syncer { @@ -29,7 +30,7 @@ enum WriterTag { // Make sure to update this if you update WriterTag. std::string WriterTagToString(WriterTag writer_tag); -class BaseTransaction { +class SYNC_EXPORT_PRIVATE BaseTransaction { public: inline Directory* directory() const { return directory_; } inline Id root_id() const { return Id(); } diff --git a/sync/syncable/syncable_enum_conversions.h b/sync/syncable/syncable_enum_conversions.h index 5ab66f0..3727420 100644 --- a/sync/syncable/syncable_enum_conversions.h +++ b/sync/syncable/syncable_enum_conversions.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -7,6 +7,7 @@ // Keep this file in sync with entry_kernel.h. +#include "sync/base/sync_export.h" #include "sync/syncable/entry_kernel.h" // Utility functions to get the string equivalent for some syncable @@ -18,29 +19,32 @@ namespace syncable { // The returned strings (which don't have to be freed) are in ASCII. // The result of passing in an invalid enum value is undefined. -const char* GetMetahandleFieldString(MetahandleField metahandle_field); +SYNC_EXPORT_PRIVATE const char* GetMetahandleFieldString( + MetahandleField metahandle_field); -const char* GetBaseVersionString(BaseVersion base_version); +SYNC_EXPORT_PRIVATE const char* GetBaseVersionString(BaseVersion base_version); -const char* GetInt64FieldString(Int64Field int64_field); +SYNC_EXPORT_PRIVATE const char* GetInt64FieldString(Int64Field int64_field); -const char* GetTimeFieldString(TimeField time_field); +SYNC_EXPORT_PRIVATE const char* GetTimeFieldString(TimeField time_field); -const char* GetIdFieldString(IdField id_field); +SYNC_EXPORT_PRIVATE const char* GetIdFieldString(IdField id_field); -const char* GetIndexedBitFieldString(IndexedBitField indexed_bit_field); +SYNC_EXPORT_PRIVATE const char* GetIndexedBitFieldString( + IndexedBitField indexed_bit_field); -const char* GetIsDelFieldString(IsDelField is_del_field); +SYNC_EXPORT_PRIVATE const char* GetIsDelFieldString(IsDelField is_del_field); -const char* GetBitFieldString(BitField bit_field); +SYNC_EXPORT_PRIVATE const char* GetBitFieldString(BitField bit_field); -const char* GetStringFieldString(StringField string_field); +SYNC_EXPORT_PRIVATE const char* GetStringFieldString(StringField string_field); -const char* GetProtoFieldString(ProtoField proto_field); +SYNC_EXPORT_PRIVATE const char* GetProtoFieldString(ProtoField proto_field); -const char* GetOrdinalFieldString(OrdinalField ordinal_field); +SYNC_EXPORT_PRIVATE const char* GetOrdinalFieldString( + OrdinalField ordinal_field); -const char* GetBitTempString(BitTemp bit_temp); +SYNC_EXPORT_PRIVATE const char* GetBitTempString(BitTemp bit_temp); } // namespace syncable } // namespace syncer diff --git a/sync/syncable/syncable_id.h b/sync/syncable/syncable_id.h index 64fc7f6..9fe4bdc 100644 --- a/sync/syncable/syncable_id.h +++ b/sync/syncable/syncable_id.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -12,6 +12,7 @@ #include "base/memory/scoped_ptr.h" #include "base/hash_tables.h" +#include "sync/base/sync_export.h" class MockConnectionManager; @@ -28,7 +29,7 @@ namespace syncable { struct EntryKernel; class Id; -std::ostream& operator<<(std::ostream& out, const Id& id); +SYNC_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& out, const Id& id); // For historical reasons, 3 concepts got everloaded into the Id: // 1. A unique, opaque identifier for the object. @@ -40,7 +41,7 @@ std::ostream& operator<<(std::ostream& out, const Id& id); // 1. c<client only opaque id> for client items that have not been committed. // 2. r for the root item. // 3. s<server provided opaque id> for items that the server knows about. -class Id { +class SYNC_EXPORT Id { public: // This constructor will be handy even when we move away from int64s, just // for unit tests. @@ -115,14 +116,15 @@ class Id { friend scoped_ptr<EntryKernel> UnpackEntry(sql::Statement* statement); friend void BindFields(const EntryKernel& entry, sql::Statement* statement); - friend std::ostream& operator<<(std::ostream& out, const Id& id); + SYNC_EXPORT_PRIVATE friend std::ostream& operator<<(std::ostream& out, + const Id& id); friend class MockConnectionManager; friend class SyncableIdTest; std::string s_; }; -Id GetNullId(); +SYNC_EXPORT_PRIVATE Id GetNullId(); } // namespace syncable } // namespace syncer diff --git a/sync/syncable/syncable_proto_util.h b/sync/syncable/syncable_proto_util.h index 299aca5..305fc4c 100644 --- a/sync/syncable/syncable_proto_util.h +++ b/sync/syncable/syncable_proto_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -7,6 +7,7 @@ #include <string> +#include "sync/base/sync_export.h" #include "sync/syncable/syncable_id.h" namespace sync_pb { @@ -21,7 +22,8 @@ syncable::Id SyncableIdFromProto(const std::string& proto_string); // Converts from a syncable::Id to a formatted std::string. This is useful for // populating the fields of a protobuf which will be sent to the server. -std::string SyncableIdToProto(const syncable::Id& syncable_id); +SYNC_EXPORT_PRIVATE std::string SyncableIdToProto( + const syncable::Id& syncable_id); // Helper function to determine if this SyncEntity's properties indicate that it // is a folder. diff --git a/sync/syncable/syncable_read_transaction.h b/sync/syncable/syncable_read_transaction.h index 276e930..ecaf59b 100644 --- a/sync/syncable/syncable_read_transaction.h +++ b/sync/syncable/syncable_read_transaction.h @@ -5,6 +5,7 @@ #ifndef SYNC_SYNCABLE_SYNCABLE_READ_TRANSACTION_H_ #define SYNC_SYNCABLE_SYNCABLE_READ_TRANSACTION_H_ +#include "sync/base/sync_export.h" #include "sync/syncable/syncable_base_transaction.h" namespace syncer { @@ -12,7 +13,7 @@ class ReadTransaction; namespace syncable { // Locks db in constructor, unlocks in destructor. -class ReadTransaction : public BaseTransaction { +class SYNC_EXPORT_PRIVATE ReadTransaction : public BaseTransaction { public: ReadTransaction(const tracked_objects::Location& from_here, Directory* directory); diff --git a/sync/syncable/syncable_util.h b/sync/syncable/syncable_util.h index add3e2d..4ea8a6f 100644 --- a/sync/syncable/syncable_util.h +++ b/sync/syncable/syncable_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -9,6 +9,7 @@ #include <vector> #include "base/basictypes.h" +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" namespace tracked_objects { @@ -23,22 +24,24 @@ class WriteTransaction; class MutableEntry; class Id; -void ChangeEntryIDAndUpdateChildren(WriteTransaction* trans, - MutableEntry* entry, - const Id& new_id); +SYNC_EXPORT_PRIVATE void ChangeEntryIDAndUpdateChildren(WriteTransaction* trans, + MutableEntry* entry, + const Id& new_id); -bool IsLegalNewParent(BaseTransaction* trans, const Id& id, const Id& parentid); +SYNC_EXPORT_PRIVATE bool IsLegalNewParent(BaseTransaction* trans, + const Id& id, + const Id& parentid); bool SyncAssert(bool condition, const tracked_objects::Location& location, const char* msg, BaseTransaction* trans); -int GetUnsyncedEntries(BaseTransaction* trans, - std::vector<int64> *handles); +SYNC_EXPORT_PRIVATE int GetUnsyncedEntries(BaseTransaction* trans, + std::vector<int64> *handles); // Generates a fixed-length tag for the given string under the given model_type. -std::string GenerateSyncableHash( +SYNC_EXPORT_PRIVATE std::string GenerateSyncableHash( ModelType model_type, const std::string& client_tag); } // namespace syncable diff --git a/sync/syncable/syncable_write_transaction.h b/sync/syncable/syncable_write_transaction.h index d45ee5f..ea52d45 100644 --- a/sync/syncable/syncable_write_transaction.h +++ b/sync/syncable/syncable_write_transaction.h @@ -15,7 +15,7 @@ namespace syncable { SYNC_EXPORT extern const int64 kInvalidTransactionVersion; // Locks db in constructor, unlocks in destructor. -class WriteTransaction : public BaseTransaction { +class SYNC_EXPORT_PRIVATE WriteTransaction : public BaseTransaction { public: WriteTransaction(const tracked_objects::Location& from_here, WriterTag writer, Directory* directory); diff --git a/sync/syncable/transaction_observer.h b/sync/syncable/transaction_observer.h index 2c43473..183fd85 100644 --- a/sync/syncable/transaction_observer.h +++ b/sync/syncable/transaction_observer.h @@ -1,17 +1,18 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. #ifndef SYNC_SYNCABLE_TRANSACTION_OBSERVER_H_ #define SYNC_SYNCABLE_TRANSACTION_OBSERVER_H_ +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/syncable/write_transaction_info.h" namespace syncer { namespace syncable { -class TransactionObserver { +class SYNC_EXPORT_PRIVATE TransactionObserver { public: virtual void OnTransactionWrite( const ImmutableWriteTransactionInfo& write_transaction_info, diff --git a/sync/util/cryptographer.h b/sync/util/cryptographer.h index 384ba78..2dfdedc 100644 --- a/sync/util/cryptographer.h +++ b/sync/util/cryptographer.h @@ -24,7 +24,7 @@ namespace syncer { class Encryptor; -extern const char kNigoriTag[]; +SYNC_EXPORT_PRIVATE extern const char kNigoriTag[]; // The parameters used to initialize a Nigori instance. struct KeyParams { diff --git a/sync/util/data_encryption_win.h b/sync/util/data_encryption_win.h index 5b7dc09..1b037c7 100644 --- a/sync/util/data_encryption_win.h +++ b/sync/util/data_encryption_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 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. @@ -9,11 +9,13 @@ #include <vector> #include "base/basictypes.h" +#include "sync/base/sync_export.h" namespace syncer { -std::vector<uint8> EncryptData(const std::string& data); -bool DecryptData(const std::vector<uint8>& in_data, std::string* out_data); +SYNC_EXPORT_PRIVATE std::vector<uint8> EncryptData(const std::string& data); +SYNC_EXPORT bool DecryptData(const std::vector<uint8>& in_data, + std::string* out_data); } // namespace syncer diff --git a/sync/util/get_session_name.h b/sync/util/get_session_name.h index 4a0600d..724ae3c 100644 --- a/sync/util/get_session_name.h +++ b/sync/util/get_session_name.h @@ -21,7 +21,7 @@ SYNC_EXPORT void GetSessionName( const scoped_refptr<base::TaskRunner>& task_runner, const base::Callback<void(const std::string&)>& done_callback); -std::string GetSessionNameSynchronouslyForTesting(); +SYNC_EXPORT_PRIVATE std::string GetSessionNameSynchronouslyForTesting(); } // namespace syncer diff --git a/sync/util/time.h b/sync/util/time.h index 2b0b245..79cb958 100644 --- a/sync/util/time.h +++ b/sync/util/time.h @@ -20,7 +20,7 @@ namespace syncer { SYNC_EXPORT int64 TimeToProtoTime(const base::Time& t); // Converts a time field from sync protobufs to a time object. -base::Time ProtoTimeToTime(int64 proto_t); +SYNC_EXPORT_PRIVATE base::Time ProtoTimeToTime(int64 proto_t); SYNC_EXPORT std::string GetTimeDebugString(const base::Time& t); |