summaryrefslogtreecommitdiffstats
path: root/net/base/dns_resolution_observer.cc
diff options
context:
space:
mode:
authorjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-28 18:01:34 +0000
committerjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-28 18:01:34 +0000
commitcf5a15c8c36a965d09829263477713aadd1dff06 (patch)
tree171241b0a30b2fb95de405c44c37b5222cf58bf0 /net/base/dns_resolution_observer.cc
parent5906670f5fc160cb0953159395dd85941abbcece (diff)
downloadchromium_src-cf5a15c8c36a965d09829263477713aadd1dff06.zip
chromium_src-cf5a15c8c36a965d09829263477713aadd1dff06.tar.gz
chromium_src-cf5a15c8c36a965d09829263477713aadd1dff06.tar.bz2
Avoid using of interlocked increment to facilitate porting.
The code did not end up needing the use of interlocked operations. All the initialization is called on one thread (the main thread). bug=1311434 r=deanm Review URL: http://codereview.chromium.org/4076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/dns_resolution_observer.cc')
-rw-r--r--net/base/dns_resolution_observer.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/base/dns_resolution_observer.cc b/net/base/dns_resolution_observer.cc
index f65c2c6..71c2c10 100644
--- a/net/base/dns_resolution_observer.cc
+++ b/net/base/dns_resolution_observer.cc
@@ -20,10 +20,7 @@ void AddDnsResolutionObserver(DnsResolutionObserver* new_observer) {
if (new_observer == dns_resolution_observer)
return; // Facilitate unit tests that init/teardown repeatedly.
DCHECK(!dns_resolution_observer);
- if (InterlockedCompareExchangePointer(
- reinterpret_cast<PVOID*>(&dns_resolution_observer),
- new_observer, NULL))
- DCHECK(0) << "Second attempt to setup observer";
+ dns_resolution_observer = new_observer;
}
DnsResolutionObserver* RemoveDnsResolutionObserver() {