summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 13:11:52 +0000
committerdeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 13:11:52 +0000
commitf1f642879ba2c3e7edb3af50d70ea11286f3ae93 (patch)
tree2464d0d298d6ca2c4af9ed3e398e2f56eb822eae
parentdb45a2f85588f7b1c1d62fe103c80a4eebca4e15 (diff)
downloadchromium_src-f1f642879ba2c3e7edb3af50d70ea11286f3ae93.zip
chromium_src-f1f642879ba2c3e7edb3af50d70ea11286f3ae93.tar.gz
chromium_src-f1f642879ba2c3e7edb3af50d70ea11286f3ae93.tar.bz2
Remove an unused include of deprecated atomic.h. Replace a custom singleton implementation with use of Singleton.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@507 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/base/dns_resolution_observer.cc6
-rw-r--r--net/base/ev_root_ca_metadata.cc12
-rw-r--r--net/base/ev_root_ca_metadata.h7
3 files changed, 10 insertions, 15 deletions
diff --git a/net/base/dns_resolution_observer.cc b/net/base/dns_resolution_observer.cc
index c9c9933..10c9650 100644
--- a/net/base/dns_resolution_observer.cc
+++ b/net/base/dns_resolution_observer.cc
@@ -30,11 +30,11 @@
// This file supports network stack independent notification of progress
// towards resolving a hostname.
-#include "net/base/dns_resolution_observer.h"
-
+#include <windows.h>
#include <string>
-#include "base/atomic.h"
+#include "net/base/dns_resolution_observer.h"
+
#include "base/logging.h"
namespace net {
diff --git a/net/base/ev_root_ca_metadata.cc b/net/base/ev_root_ca_metadata.cc
index 062e29e..30c37bb 100644
--- a/net/base/ev_root_ca_metadata.cc
+++ b/net/base/ev_root_ca_metadata.cc
@@ -27,6 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include "base/singleton.h"
#include "net/base/ev_root_ca_metadata.h"
namespace net {
@@ -165,17 +166,8 @@ static const EVMetadata ev_root_ca_metadata[] = {
};
// static
-EVRootCAMetadata* EVRootCAMetadata::instance_;
-
-// static
EVRootCAMetadata* EVRootCAMetadata::GetInstance() {
- if (!instance_) {
- EVRootCAMetadata* new_instance = new EVRootCAMetadata;
- if (InterlockedCompareExchangePointer(
- reinterpret_cast<PVOID*>(&instance_), new_instance, NULL))
- delete new_instance;
- }
- return instance_;
+ return Singleton<EVRootCAMetadata>::get();
}
bool EVRootCAMetadata::GetPolicyOID(
diff --git a/net/base/ev_root_ca_metadata.h b/net/base/ev_root_ca_metadata.h
index a849a92..373d09d 100644
--- a/net/base/ev_root_ca_metadata.h
+++ b/net/base/ev_root_ca_metadata.h
@@ -34,6 +34,9 @@
#include "net/base/x509_certificate.h"
+template <typename T>
+struct DefaultSingletonTraits;
+
namespace net {
// A singleton. This class stores the meta data of the root CAs that issue
@@ -54,7 +57,7 @@ class EVRootCAMetadata {
EVRootCAMetadata();
~EVRootCAMetadata() { }
- static EVRootCAMetadata* instance_;
+ friend DefaultSingletonTraits<EVRootCAMetadata>;
typedef std::map<X509Certificate::Fingerprint, std::string,
X509Certificate::FingerprintLessThan> StringMap;
@@ -73,4 +76,4 @@ class EVRootCAMetadata {
} // namespace net
-#endif // NET_BASE_EV_ROOT_CA_METADATA_H__ \ No newline at end of file
+#endif // NET_BASE_EV_ROOT_CA_METADATA_H__