summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-01 23:16:20 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-01 23:16:20 +0000
commitbc581a6829fe49e43f4869075781d6dc94843f09 (patch)
treea94363488dadff28fe2c03f3a169b6ad2eeb02e8 /net
parent10f33b1bd6c6adb6306759a45bf3a5c18221d878 (diff)
downloadchromium_src-bc581a6829fe49e43f4869075781d6dc94843f09.zip
chromium_src-bc581a6829fe49e43f4869075781d6dc94843f09.tar.gz
chromium_src-bc581a6829fe49e43f4869075781d6dc94843f09.tar.bz2
Move base/lock and base/condition_variable to base/synchronization/
I kept a base/lock.h in place with a using statement to avoid updating all callers in one CL. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6018013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/dnsrr_resolver_unittest.cc3
-rw-r--r--net/base/listen_socket_unittest.h8
-rw-r--r--net/ocsp/nss_ocsp.cc36
-rw-r--r--net/tools/hresolv/hresolv.cc1
4 files changed, 23 insertions, 25 deletions
diff --git a/net/base/dnsrr_resolver_unittest.cc b/net/base/dnsrr_resolver_unittest.cc
index f5b545b..dfa904a 100644
--- a/net/base/dnsrr_resolver_unittest.cc
+++ b/net/base/dnsrr_resolver_unittest.cc
@@ -5,8 +5,7 @@
#include "net/base/dnsrr_resolver.h"
#include "base/callback.h"
-#include "base/condition_variable.h"
-#include "base/lock.h"
+#include "base/synchronization/lock.h"
#include "net/base/dns_util.h"
#include "net/base/net_errors.h"
#include "net/base/net_log.h"
diff --git a/net/base/listen_socket_unittest.h b/net/base/listen_socket_unittest.h
index 176dfcb..f283cb0 100644
--- a/net/base/listen_socket_unittest.h
+++ b/net/base/listen_socket_unittest.h
@@ -17,11 +17,11 @@
#endif
#include "base/basictypes.h"
-#include "base/condition_variable.h"
-#include "base/lock.h"
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/string_util.h"
+#include "base/synchronization/condition_variable.h"
+#include "base/synchronization/lock.h"
#include "base/threading/thread.h"
#include "net/base/listen_socket.h"
#include "net/base/net_util.h"
@@ -116,8 +116,8 @@ class ListenSocketTester :
SOCKET test_socket_;
static const int kTestPort;
- Lock lock_; // protects |queue_| and wraps |cv_|
- ConditionVariable cv_;
+ base::Lock lock_; // protects |queue_| and wraps |cv_|
+ base::ConditionVariable cv_;
std::deque<ListenSocketTestAction> queue_;
};
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc
index c35c572..78eb7f5 100644
--- a/net/ocsp/nss_ocsp.cc
+++ b/net/ocsp/nss_ocsp.cc
@@ -16,7 +16,6 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/condition_variable.h"
#include "base/lazy_instance.h"
#include "base/lock.h"
#include "base/logging.h"
@@ -25,6 +24,7 @@
#include "base/stl_util-inl.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
+#include "base/synchronization/condition_variable.h"
#include "base/threading/thread_checker.h"
#include "base/time.h"
#include "googleurl/src/gurl.h"
@@ -46,7 +46,7 @@ class OCSPRequestSession;
class OCSPIOLoop {
public:
void StartUsing() {
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
used_ = true;
}
@@ -54,7 +54,7 @@ class OCSPIOLoop {
void Shutdown();
bool used() const {
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
return used_;
}
@@ -74,7 +74,7 @@ class OCSPIOLoop {
void CancelAllRequests();
- mutable Lock lock_;
+ mutable base::Lock lock_;
bool shutdown_; // Protected by |lock_|.
std::set<OCSPRequestSession*> requests_; // Protected by |lock_|.
bool used_; // Protected by |lock_|.
@@ -188,18 +188,18 @@ class OCSPRequestSession
void Cancel() {
// IO thread may set |io_loop_| to NULL, so protect by |lock_|.
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
CancelLocked();
}
bool Finished() const {
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
return finished_;
}
bool Wait() {
base::TimeDelta timeout = timeout_;
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
while (!finished_) {
base::TimeTicks last_time = base::TimeTicks::Now();
cv_.TimedWait(timeout);
@@ -290,7 +290,7 @@ class OCSPRequestSession
request_ = NULL;
g_ocsp_io_loop.Get().RemoveRequest(this);
{
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
finished_ = true;
io_loop_ = NULL;
}
@@ -303,7 +303,7 @@ class OCSPRequestSession
void CancelURLRequest() {
#ifndef NDEBUG
{
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
if (io_loop_)
DCHECK_EQ(MessageLoopForIO::current(), io_loop_);
}
@@ -314,7 +314,7 @@ class OCSPRequestSession
request_ = NULL;
g_ocsp_io_loop.Get().RemoveRequest(this);
{
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
finished_ = true;
io_loop_ = NULL;
}
@@ -356,7 +356,7 @@ class OCSPRequestSession
return;
{
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
DCHECK(!io_loop_);
io_loop_ = MessageLoopForIO::current();
g_ocsp_io_loop.Get().AddRequest(this);
@@ -401,8 +401,8 @@ class OCSPRequestSession
std::string data_; // Results of the requst
// |lock_| protects |finished_| and |io_loop_|.
- mutable Lock lock_;
- ConditionVariable cv_;
+ mutable base::Lock lock_;
+ base::ConditionVariable cv_;
MessageLoop* io_loop_; // Message loop of the IO thread
bool finished_;
@@ -462,7 +462,7 @@ OCSPIOLoop::~OCSPIOLoop() {
// IO thread was already deleted before the singleton is deleted
// in AtExitManager.
{
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
DCHECK(!io_loop_);
DCHECK(!used_);
DCHECK(shutdown_);
@@ -479,7 +479,7 @@ void OCSPIOLoop::Shutdown() {
// Prevent the worker thread from trying to access |io_loop_|.
{
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
io_loop_ = NULL;
used_ = false;
shutdown_ = true;
@@ -494,13 +494,13 @@ void OCSPIOLoop::Shutdown() {
void OCSPIOLoop::PostTaskToIOLoop(
const tracked_objects::Location& from_here, Task* task) {
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
if (io_loop_)
io_loop_->PostTask(from_here, task);
}
void OCSPIOLoop::EnsureIOLoop() {
- AutoLock autolock(lock_);
+ base::AutoLock autolock(lock_);
DCHECK_EQ(MessageLoopForIO::current(), io_loop_);
}
@@ -512,7 +512,7 @@ void OCSPIOLoop::AddRequest(OCSPRequestSession* request) {
void OCSPIOLoop::RemoveRequest(OCSPRequestSession* request) {
{
// Ignore if we've already shutdown.
- AutoLock auto_lock(lock_);
+ base::AutoLock auto_lock(lock_);
if (shutdown_)
return;
}
diff --git a/net/tools/hresolv/hresolv.cc b/net/tools/hresolv/hresolv.cc
index 16124d7..24d73a8 100644
--- a/net/tools/hresolv/hresolv.cc
+++ b/net/tools/hresolv/hresolv.cc
@@ -24,7 +24,6 @@
#include "base/at_exit.h"
#include "base/command_line.h"
-#include "base/condition_variable.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/message_loop.h"