Chromium Code Reviews

Unified Diff: chrome_frame/chrome_frame_automation.cc

Issue 5682008: Make members of Singleton<T> private and only visible to the singleton type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: chrome_frame/chrome_frame_automation.cc
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index b670548dd6dfa6597c6c14e1c1116fa50ca99a3e..ab13151d2d34ef90a46d01ec53b8d15d0aeb4a98 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -11,11 +11,11 @@
#include "base/debug/trace_event.h"
#include "base/file_util.h"
#include "base/file_version_info.h"
+#include "base/lazy_instance.h"
#include "base/lock.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/process_util.h"
-#include "base/singleton.h"
#include "base/string_util.h"
#include "base/sys_info.h"
#include "base/utf_string_conversions.h"
@@ -569,7 +569,9 @@ bool ProxyFactory::ReleaseAutomationServer(void* server_id,
return true;
}
-Singleton<ProxyFactory, LeakySingletonTraits<ProxyFactory> > g_proxy_factory;
+static base::LazyInstance<ProxyFactory,
+ base::LeakyLazyInstanceTraits<ProxyFactory> >
+ g_proxy_factory(base::LINKER_INITIALIZED);
template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> {
static void RetainCallee(ChromeFrameAutomationClient* obj) {}
@@ -586,7 +588,7 @@ ChromeFrameAutomationClient::ChromeFrameAutomationClient()
ui_thread_id_(NULL),
init_state_(UNINITIALIZED),
use_chrome_network_(false),
- proxy_factory_(g_proxy_factory.get()),
+ proxy_factory_(g_proxy_factory.Pointer()),
handle_top_level_requests_(false),
tab_handle_(-1),
session_id_(-1),

Powered by Google App Engine