Index: net/websockets/websocket_job.cc |
diff --git a/net/websockets/websocket_job.cc b/net/websockets/websocket_job.cc |
index 9adbaa341ce1dcaa94f6116f550eedd11c544032..44c944db39ff3fad6a1ef2c1df87923cedcfefc7 100644 |
--- a/net/websockets/websocket_job.cc |
+++ b/net/websockets/websocket_job.cc |
@@ -6,7 +6,7 @@ |
#include <algorithm> |
-#include "base/singleton.h" |
+#include "base/lazy_instance.h" |
#include "base/string_tokenizer.h" |
#include "googleurl/src/gurl.h" |
#include "net/base/net_errors.h" |
@@ -40,20 +40,23 @@ net::SocketStreamJob* WebSocketJobFactory( |
class WebSocketJobInitSingleton { |
private: |
- friend struct DefaultSingletonTraits<WebSocketJobInitSingleton>; |
+ friend struct base::DefaultLazyInstanceTraits<WebSocketJobInitSingleton>; |
WebSocketJobInitSingleton() { |
net::SocketStreamJob::RegisterProtocolFactory("ws", WebSocketJobFactory); |
net::SocketStreamJob::RegisterProtocolFactory("wss", WebSocketJobFactory); |
} |
}; |
+static base::LazyInstance<WebSocketJobInitSingleton> g_websocket_job_init( |
+ base::LINKER_INITIALIZED); |
+ |
} // anonymous namespace |
namespace net { |
// static |
void WebSocketJob::EnsureInit() { |
- Singleton<WebSocketJobInitSingleton>::get(); |
+ g_websocket_job_init.Get(); |
} |
WebSocketJob::WebSocketJob(SocketStream::Delegate* delegate) |