summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/engine
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/sync/engine')
-rw-r--r--chrome/browser/sync/engine/all_status.cc2
-rw-r--r--chrome/browser/sync/engine/all_status.h4
-rw-r--r--chrome/browser/sync/engine/net/server_connection_manager.cc6
-rw-r--r--chrome/browser/sync/engine/net/server_connection_manager.h26
-rw-r--r--chrome/browser/sync/engine/syncapi.cc8
-rw-r--r--chrome/browser/sync/engine/syncer.cc4
-rw-r--r--chrome/browser/sync/engine/syncer.h4
-rw-r--r--chrome/browser/sync/engine/syncer_thread.cc2
-rw-r--r--chrome/browser/sync/engine/syncer_thread_unittest.cc10
9 files changed, 33 insertions, 33 deletions
diff --git a/chrome/browser/sync/engine/all_status.cc b/chrome/browser/sync/engine/all_status.cc
index 8d4b85e..1580dc4 100644
--- a/chrome/browser/sync/engine/all_status.cc
+++ b/chrome/browser/sync/engine/all_status.cc
@@ -138,7 +138,7 @@ void AllStatus::HandleServerConnectionEvent(
}
sync_api::SyncManager::Status AllStatus::status() const {
- AutoLock lock(mutex_);
+ base::AutoLock lock(mutex_);
return status_;
}
diff --git a/chrome/browser/sync/engine/all_status.h b/chrome/browser/sync/engine/all_status.h
index 5b2f1d0..015bfb7 100644
--- a/chrome/browser/sync/engine/all_status.h
+++ b/chrome/browser/sync/engine/all_status.h
@@ -11,8 +11,8 @@
#include <map>
-#include "base/lock.h"
#include "base/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "chrome/browser/sync/engine/syncapi.h"
#include "chrome/browser/sync/engine/syncer_types.h"
@@ -57,7 +57,7 @@ class AllStatus : public SyncEngineEventListener {
sync_api::SyncManager::Status status_;
- mutable Lock mutex_; // Protects all data members.
+ mutable base::Lock mutex_; // Protects all data members.
DISALLOW_COPY_AND_ASSIGN(AllStatus);
};
diff --git a/chrome/browser/sync/engine/net/server_connection_manager.cc b/chrome/browser/sync/engine/net/server_connection_manager.cc
index 20776fe..7f53a29 100644
--- a/chrome/browser/sync/engine/net/server_connection_manager.cc
+++ b/chrome/browser/sync/engine/net/server_connection_manager.cc
@@ -255,7 +255,7 @@ bool ServerConnectionManager::CheckServerReachable() {
void ServerConnectionManager::kill() {
{
- AutoLock lock(terminate_all_io_mutex_);
+ base::AutoLock lock(terminate_all_io_mutex_);
terminate_all_io_ = true;
}
}
@@ -294,7 +294,7 @@ void ServerConnectionManager::SetServerParameters(const string& server_url,
int port,
bool use_ssl) {
{
- AutoLock lock(server_parameters_mutex_);
+ base::AutoLock lock(server_parameters_mutex_);
sync_server_ = server_url;
sync_server_port_ = port;
use_ssl_ = use_ssl;
@@ -305,7 +305,7 @@ void ServerConnectionManager::SetServerParameters(const string& server_url,
void ServerConnectionManager::GetServerParameters(string* server_url,
int* port,
bool* use_ssl) const {
- AutoLock lock(server_parameters_mutex_);
+ base::AutoLock lock(server_parameters_mutex_);
if (server_url != NULL)
*server_url = sync_server_;
if (port != NULL)
diff --git a/chrome/browser/sync/engine/net/server_connection_manager.h b/chrome/browser/sync/engine/net/server_connection_manager.h
index 6380151..8921428 100644
--- a/chrome/browser/sync/engine/net/server_connection_manager.h
+++ b/chrome/browser/sync/engine/net/server_connection_manager.h
@@ -10,8 +10,8 @@
#include <string>
#include "base/atomicops.h"
-#include "base/lock.h"
#include "base/string_util.h"
+#include "base/synchronization/lock.h"
#include "chrome/browser/sync/syncable/syncable_id.h"
#include "chrome/common/deprecated/event_sys.h"
#include "chrome/common/deprecated/event_sys-inl.h"
@@ -149,7 +149,7 @@ class ScopedServerStatusWatcher {
// one instance for every server that you need to talk to.
class ServerConnectionManager {
public:
- typedef EventChannel<ServerConnectionEvent, Lock> Channel;
+ typedef EventChannel<ServerConnectionEvent, base::Lock> Channel;
// buffer_in - will be POSTed
// buffer_out - string will be overwritten with response
@@ -192,7 +192,7 @@ class ServerConnectionManager {
void GetServerParams(std::string* server,
int* server_port,
bool* use_ssl) const {
- AutoLock lock(scm_->server_parameters_mutex_);
+ base::AutoLock lock(scm_->server_parameters_mutex_);
server->assign(scm_->sync_server_);
*server_port = scm_->sync_server_port_;
*use_ssl = scm_->use_ssl_;
@@ -269,7 +269,7 @@ class ServerConnectionManager {
std::string GetServerHost() const;
bool terminate_all_io() const {
- AutoLock lock(terminate_all_io_mutex_);
+ base::AutoLock lock(terminate_all_io_mutex_);
return terminate_all_io_;
}
@@ -284,23 +284,23 @@ class ServerConnectionManager {
void set_auth_token(const std::string& auth_token) {
// TODO(chron): Consider adding a message loop check here.
- AutoLock lock(auth_token_mutex_);
+ base::AutoLock lock(auth_token_mutex_);
auth_token_.assign(auth_token);
}
const std::string auth_token() const {
- AutoLock lock(auth_token_mutex_);
+ base::AutoLock lock(auth_token_mutex_);
return auth_token_;
}
protected:
inline std::string proto_sync_path() const {
- AutoLock lock(path_mutex_);
+ base::AutoLock lock(path_mutex_);
return proto_sync_path_;
}
std::string get_time_path() const {
- AutoLock lock(path_mutex_);
+ base::AutoLock lock(path_mutex_);
return get_time_path_;
}
@@ -317,7 +317,7 @@ class ServerConnectionManager {
ScopedServerStatusWatcher* watcher);
// Protects access to sync_server_, sync_server_port_ and use_ssl_:
- mutable Lock server_parameters_mutex_;
+ mutable base::Lock server_parameters_mutex_;
// The sync_server_ is the server that requests will be made to.
std::string sync_server_;
@@ -335,15 +335,15 @@ class ServerConnectionManager {
bool use_ssl_;
// The paths we post to.
- mutable Lock path_mutex_;
+ mutable base::Lock path_mutex_;
std::string proto_sync_path_;
std::string get_time_path_;
- mutable Lock auth_token_mutex_;
+ mutable base::Lock auth_token_mutex_;
// The auth token to use in authenticated requests. Set by the AuthWatcher.
std::string auth_token_;
- Lock error_count_mutex_; // Protects error_count_
+ base::Lock error_count_mutex_; // Protects error_count_
int error_count_; // Tracks the number of connection errors.
Channel* const channel_;
@@ -363,7 +363,7 @@ class ServerConnectionManager {
void NotifyStatusChanged();
void ResetConnection();
- mutable Lock terminate_all_io_mutex_;
+ mutable base::Lock terminate_all_io_mutex_;
bool terminate_all_io_; // When set to true, terminate all connections asap.
DISALLOW_COPY_AND_ASSIGN(ServerConnectionManager);
};
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 7725afd..bc11b31 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -11,12 +11,12 @@
#include <vector>
#include "base/base64.h"
-#include "base/lock.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/sha1.h"
#include "base/string_util.h"
+#include "base/synchronization/lock.h"
#include "base/task.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_thread.h"
@@ -1070,7 +1070,7 @@ class SyncManager::SyncInternal
// Whether we're initialized to the point of being able to accept changes
// (and hence allow transaction creation). See initialized_ for details.
bool initialized() const {
- AutoLock lock(initialized_mutex_);
+ base::AutoLock lock(initialized_mutex_);
return initialized_;
}
@@ -1310,7 +1310,7 @@ class SyncManager::SyncInternal
// meaning we are ready to accept changes. Protected by initialized_mutex_
// as it can get read/set by both the SyncerThread and the AuthWatcherThread.
bool initialized_;
- mutable Lock initialized_mutex_;
+ mutable base::Lock initialized_mutex_;
notifier::NotifierOptions notifier_options_;
@@ -1531,7 +1531,7 @@ void SyncManager::SyncInternal::MarkAndNotifyInitializationComplete() {
// between their respective threads to call MarkAndNotify. We need to make
// sure the observer is notified once and only once.
{
- AutoLock lock(initialized_mutex_);
+ base::AutoLock lock(initialized_mutex_);
if (initialized_)
return;
initialized_ = true;
diff --git a/chrome/browser/sync/engine/syncer.cc b/chrome/browser/sync/engine/syncer.cc
index cbf9753..70d585f 100644
--- a/chrome/browser/sync/engine/syncer.cc
+++ b/chrome/browser/sync/engine/syncer.cc
@@ -62,12 +62,12 @@ Syncer::Syncer()
Syncer::~Syncer() {}
bool Syncer::ExitRequested() {
- AutoLock lock(early_exit_requested_lock_);
+ base::AutoLock lock(early_exit_requested_lock_);
return early_exit_requested_;
}
void Syncer::RequestEarlyExit() {
- AutoLock lock(early_exit_requested_lock_);
+ base::AutoLock lock(early_exit_requested_lock_);
early_exit_requested_ = true;
}
diff --git a/chrome/browser/sync/engine/syncer.h b/chrome/browser/sync/engine/syncer.h
index 2789ed2..89f1307 100644
--- a/chrome/browser/sync/engine/syncer.h
+++ b/chrome/browser/sync/engine/syncer.h
@@ -12,8 +12,8 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/gtest_prod_util.h"
-#include "base/lock.h"
#include "base/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "chrome/browser/sync/engine/conflict_resolver.h"
#include "chrome/browser/sync/engine/syncer_types.h"
#include "chrome/browser/sync/engine/syncproto.h"
@@ -109,7 +109,7 @@ class Syncer {
SyncerStep last_step);
bool early_exit_requested_;
- Lock early_exit_requested_lock_;
+ base::Lock early_exit_requested_lock_;
int32 max_commit_batch_size_;
diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc
index e9a3a20..8813709 100644
--- a/chrome/browser/sync/engine/syncer_thread.cc
+++ b/chrome/browser/sync/engine/syncer_thread.cc
@@ -556,7 +556,7 @@ SyncSession* SyncerThread::SyncMain(Syncer* syncer, bool was_throttled,
continue_sync_cycle, initial_sync_for_thread, was_nudged));
scoped_ptr<SyncSession> session;
- AutoUnlock unlock(lock_);
+ base::AutoUnlock unlock(lock_);
do {
session.reset(new SyncSession(session_context_.get(), this,
info, routes, workers));
diff --git a/chrome/browser/sync/engine/syncer_thread_unittest.cc b/chrome/browser/sync/engine/syncer_thread_unittest.cc
index 4b13e8f..1553e9c 100644
--- a/chrome/browser/sync/engine/syncer_thread_unittest.cc
+++ b/chrome/browser/sync/engine/syncer_thread_unittest.cc
@@ -5,8 +5,8 @@
#include <list>
#include <map>
-#include "base/lock.h"
#include "base/scoped_ptr.h"
+#include "base/synchronization/lock.h"
#include "base/time.h"
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/sync/engine/model_safe_worker.h"
@@ -125,7 +125,7 @@ class SyncerThreadWithSyncerTest : public testing::Test,
void WaitForDisconnect() {
// Wait for the SyncerThread to detect loss of connection, up to a max of
// 10 seconds to timeout the test.
- AutoLock lock(syncer_thread()->lock_);
+ base::AutoLock lock(syncer_thread()->lock_);
TimeTicks start = TimeTicks::Now();
TimeDelta ten_seconds = TimeDelta::FromSeconds(10);
while (syncer_thread()->vault_.connected_) {
@@ -139,7 +139,7 @@ class SyncerThreadWithSyncerTest : public testing::Test,
bool Pause(ListenerMock* listener) {
WaitableEvent event(false, false);
{
- AutoLock lock(syncer_thread()->lock_);
+ base::AutoLock lock(syncer_thread()->lock_);
EXPECT_CALL(*listener, OnSyncEngineEvent(
Field(&SyncEngineEvent::what_happened,
SyncEngineEvent::SYNCER_THREAD_PAUSED))).
@@ -153,7 +153,7 @@ class SyncerThreadWithSyncerTest : public testing::Test,
bool Resume(ListenerMock* listener) {
WaitableEvent event(false, false);
{
- AutoLock lock(syncer_thread()->lock_);
+ base::AutoLock lock(syncer_thread()->lock_);
EXPECT_CALL(*listener, OnSyncEngineEvent(
Field(&SyncEngineEvent::what_happened,
SyncEngineEvent::SYNCER_THREAD_RESUMED))).
@@ -330,7 +330,7 @@ TEST_F(SyncerThreadTest, CalculatePollingWaitTime) {
scoped_refptr<SyncerThread> syncer_thread(new SyncerThread(context));
syncer_thread->DisableIdleDetection();
// Hold the lock to appease asserts in code.
- AutoLock lock(syncer_thread->lock_);
+ base::AutoLock lock(syncer_thread->lock_);
// Notifications disabled should result in a polling interval of
// kDefaultShortPollInterval.