summaryrefslogtreecommitdiffstats
path: root/net/ocsp
diff options
context:
space:
mode:
Diffstat (limited to 'net/ocsp')
-rw-r--r--net/ocsp/nss_ocsp.cc40
-rw-r--r--net/ocsp/nss_ocsp.h6
2 files changed, 23 insertions, 23 deletions
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc
index 02edd05..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,7 +24,8 @@
#include "base/stl_util-inl.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
-#include "base/thread_checker.h"
+#include "base/synchronization/condition_variable.h"
+#include "base/threading/thread_checker.h"
#include "base/time.h"
#include "googleurl/src/gurl.h"
#include "net/base/io_buffer.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,13 +74,13 @@ 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_|.
// This should not be modified after |used_|.
MessageLoopForIO* io_loop_; // Protected by |lock_|.
- ThreadChecker thread_checker_;
+ base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(OCSPIOLoop);
};
@@ -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/ocsp/nss_ocsp.h b/net/ocsp/nss_ocsp.h
index cf2e66e..fae7a87 100644
--- a/net/ocsp/nss_ocsp.h
+++ b/net/ocsp/nss_ocsp.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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,10 +6,10 @@
#define NET_OCSP_NSS_OCSP_H_
#pragma once
-class URLRequestContext;
-
namespace net {
+class URLRequestContext;
+
// Sets the MessageLoop for OCSP to the current message loop.
// This should be called before EnsureOCSPInit() if you want to
// control the message loop for OCSP.