summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chromeos/browser_main_chromeos.cc9
-rw-r--r--chrome/browser/chromeos/login/screen_locker.cc7
-rw-r--r--chrome/browser/chromeos/login/signed_settings_helper.cc9
-rw-r--r--chrome/browser/chromeos/offline/offline_load_service.cc9
-rw-r--r--chrome/browser/enumerate_modules_model_win.cc5
-rw-r--r--chrome/browser/enumerate_modules_model_win.h4
-rw-r--r--chrome/browser/gtk/browser_toolbar_gtk.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc5
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.h6
-rw-r--r--chrome/common/sqlite_utils.cc7
-rw-r--r--chrome/common/time_format.cc12
-rw-r--r--chrome/plugin/webplugin_proxy.cc12
-rw-r--r--chrome/renderer/extensions/bindings_utils.cc10
-rw-r--r--chrome/renderer/extensions/renderer_extension_bindings.cc13
-rw-r--r--chrome/renderer/ggl/ggl.cc8
-rw-r--r--chrome/renderer/render_view.cc13
16 files changed, 80 insertions, 51 deletions
diff --git a/chrome/browser/chromeos/browser_main_chromeos.cc b/chrome/browser/chromeos/browser_main_chromeos.cc
index df4653a..776a82b 100644
--- a/chrome/browser/chromeos/browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/browser_main_chromeos.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/chromeos/browser_main_chromeos.h"
+#include "base/lazy_instance.h"
#include "base/message_loop.h"
-#include "base/singleton.h"
#include <gtk/gtk.h>
@@ -38,12 +38,13 @@ class MessageLoopObserver : public MessageLoopForUI::Observer {
}
};
-void BrowserMainPartsChromeos::PostMainMessageLoopStart() {
- static Singleton<MessageLoopObserver> observer;
+static base::LazyInstance<MessageLoopObserver> g_message_loop_observer(
+ base::LINKER_INITIALIZED);
+void BrowserMainPartsChromeos::PostMainMessageLoopStart() {
BrowserMainPartsPosix::PostMainMessageLoopStart();
MessageLoopForUI* message_loop = MessageLoopForUI::current();
- message_loop->AddObserver(observer.get());
+ message_loop->AddObserver(g_message_loop_observer.Pointer());
}
// static
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index f59307b..2167650 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -16,9 +16,9 @@
#include "app/resource_bundle.h"
#include "app/x11_util.h"
#include "base/command_line.h"
+#include "base/lazy_instance.h"
#include "base/metrics/histogram.h"
#include "base/message_loop.h"
-#include "base/singleton.h"
#include "base/string_util.h"
#include "base/timer.h"
#include "base/utf_string_conversions.h"
@@ -194,6 +194,9 @@ class ScreenLockObserver : public chromeos::ScreenLockLibrary::Observer,
DISALLOW_COPY_AND_ASSIGN(ScreenLockObserver);
};
+static base::LazyInstance<ScreenLockObserver> g_screen_lock_observer(
+ base::LINKER_INITIALIZED);
+
// A ScreenLock window that covers entire screen to keep the keyboard
// focus/events inside the grab widget.
class LockWindow : public views::WidgetGtk {
@@ -901,7 +904,7 @@ void ScreenLocker::UnlockScreenFailed() {
// static
void ScreenLocker::InitClass() {
- Singleton<ScreenLockObserver>::get();
+ g_screen_lock_observer.Get();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/chromeos/login/signed_settings_helper.cc b/chrome/browser/chromeos/login/signed_settings_helper.cc
index ad86e83..6a1a735 100644
--- a/chrome/browser/chromeos/login/signed_settings_helper.cc
+++ b/chrome/browser/chromeos/login/signed_settings_helper.cc
@@ -7,9 +7,9 @@
#include <string>
#include <vector>
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/ref_counted.h"
-#include "base/singleton.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/chromeos/login/signed_settings.h"
@@ -262,10 +262,13 @@ class SignedSettingsHelperImpl : public SignedSettingsHelper,
std::vector<OpContext*> pending_contexts_;
- friend struct DefaultSingletonTraits<SignedSettingsHelperImpl>;
+ friend struct base::DefaultLazyInstanceTraits<SignedSettingsHelperImpl>;
DISALLOW_COPY_AND_ASSIGN(SignedSettingsHelperImpl);
};
+static base::LazyInstance<SignedSettingsHelperImpl>
+ g_signed_settings_helper_impl(base::LINKER_INITIALIZED);
+
SignedSettingsHelperImpl::SignedSettingsHelperImpl() {
}
@@ -371,7 +374,7 @@ void SignedSettingsHelperImpl::OnOpCompleted(OpContext* context) {
}
SignedSettingsHelper* SignedSettingsHelper::Get() {
- return Singleton<SignedSettingsHelperImpl>::get();
+ return g_signed_settings_helper_impl.Pointer();
}
} // namespace chromeos
diff --git a/chrome/browser/chromeos/offline/offline_load_service.cc b/chrome/browser/chromeos/offline/offline_load_service.cc
index 08f2362..ace85d8 100644
--- a/chrome/browser/chromeos/offline/offline_load_service.cc
+++ b/chrome/browser/chromeos/offline/offline_load_service.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/chromeos/offline/offline_load_service.h"
+#include "base/lazy_instance.h"
#include "base/ref_counted.h"
-#include "base/singleton.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/tab_contents.h"
@@ -24,7 +24,7 @@ class OfflineLoadServiceSingleton {
}
private:
- friend struct DefaultSingletonTraits<OfflineLoadServiceSingleton>;
+ friend struct base::DefaultLazyInstanceTraits<OfflineLoadServiceSingleton>;
OfflineLoadServiceSingleton()
: offline_load_service_(new chromeos::OfflineLoadService()) {}
virtual ~OfflineLoadServiceSingleton() {}
@@ -34,9 +34,12 @@ class OfflineLoadServiceSingleton {
DISALLOW_COPY_AND_ASSIGN(OfflineLoadServiceSingleton);
};
+static base::LazyInstance<OfflineLoadServiceSingleton>
+ g_offline_load_service_singleton(base::LINKER_INITIALIZED);
+
// static
OfflineLoadService* OfflineLoadService::Get() {
- return Singleton<OfflineLoadServiceSingleton>::get()->offline_load_service();
+ return g_offline_load_service_singleton.Get().offline_load_service();
}
void OfflineLoadService::Observe(NotificationType type,
diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc
index b521b6c..cff39c6 100644
--- a/chrome/browser/enumerate_modules_model_win.cc
+++ b/chrome/browser/enumerate_modules_model_win.cc
@@ -672,6 +672,11 @@ string16 ModuleEnumerator::GetSubjectNameFromDigitalSignature(
// ----------------------------------------------------------------------------
+// static
+EnumerateModulesModel* EnumerateModulesModel::GetSingleton() {
+ return Singleton<EnumerateModulesModel>::get();
+}
+
void EnumerateModulesModel::ScanNow() {
if (scanning_)
return; // A scan is already in progress.
diff --git a/chrome/browser/enumerate_modules_model_win.h b/chrome/browser/enumerate_modules_model_win.h
index 9000a6c..15492a5 100644
--- a/chrome/browser/enumerate_modules_model_win.h
+++ b/chrome/browser/enumerate_modules_model_win.h
@@ -218,9 +218,7 @@ class ModuleEnumerator : public base::RefCountedThreadSafe<ModuleEnumerator> {
// notification.
class EnumerateModulesModel {
public:
- static EnumerateModulesModel* GetSingleton() {
- return Singleton<EnumerateModulesModel>::get();
- }
+ static EnumerateModulesModel* GetSingleton();
// Returns the number of suspected bad modules found in the last scan.
// Returns 0 if no scan has taken place yet.
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc
index ad10e51..d3dffff 100644
--- a/chrome/browser/gtk/browser_toolbar_gtk.cc
+++ b/chrome/browser/gtk/browser_toolbar_gtk.cc
@@ -626,7 +626,7 @@ bool BrowserToolbarGtk::ShouldOnlyShowLocation() const {
gboolean BrowserToolbarGtk::OnWrenchMenuButtonExpose(GtkWidget* sender,
GdkEventExpose* expose) {
- if (!Singleton<UpgradeDetector>::get()->notify_upgrade())
+ if (!UpgradeDetector::GetInstance()->notify_upgrade())
return FALSE;
const SkBitmap& badge =
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index 7ec0303..2bc0a49 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -76,6 +76,9 @@ static const char* const kTakeMeBackCommand = "takeMeBack";
// static
SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL;
+static base::LazyInstance<SafeBrowsingBlockingPage::UnsafeResourceMap>
+ g_unsafe_resource_map(base::LINKER_INITIALIZED);
+
// The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we
// don't leak it.
class SafeBrowsingBlockingPageFactoryImpl
@@ -559,7 +562,7 @@ void SafeBrowsingBlockingPage::NotifySafeBrowsingService(
// static
SafeBrowsingBlockingPage::UnsafeResourceMap*
SafeBrowsingBlockingPage::GetUnsafeResourcesMap() {
- return Singleton<UnsafeResourceMap>::get();
+ return g_unsafe_resource_map.Pointer();
}
// static
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
index 53b21a0..cfe2358 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
@@ -44,6 +44,9 @@ class TabContents;
class SafeBrowsingBlockingPage : public InterstitialPage {
public:
+ typedef std::vector<SafeBrowsingService::UnsafeResource> UnsafeResourceList;
+ typedef std::map<TabContents*, UnsafeResourceList> UnsafeResourceMap;
+
virtual ~SafeBrowsingBlockingPage();
// Shows a blocking page warning the user about phishing/malware for a
@@ -66,8 +69,6 @@ class SafeBrowsingBlockingPage : public InterstitialPage {
virtual void Proceed();
virtual void DontProceed();
- typedef std::vector<SafeBrowsingService::UnsafeResource> UnsafeResourceList;
-
protected:
friend class SafeBrowsingBlockingPageTest;
@@ -118,7 +119,6 @@ class SafeBrowsingBlockingPage : public InterstitialPage {
// A list of SafeBrowsingService::UnsafeResource for a tab that the user
// should be warned about. They are queued when displaying more than one
// interstitial at a time.
- typedef std::map<TabContents*, UnsafeResourceList> UnsafeResourceMap;
static UnsafeResourceMap* GetUnsafeResourcesMap();
// Notifies the SafeBrowsingService on the IO thread whether to proceed or not
diff --git a/chrome/common/sqlite_utils.cc b/chrome/common/sqlite_utils.cc
index d11b925..9d16c7f 100644
--- a/chrome/common/sqlite_utils.cc
+++ b/chrome/common/sqlite_utils.cc
@@ -8,8 +8,8 @@
#include "base/file_path.h"
#include "base/lock.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
-#include "base/singleton.h"
#include "base/stl_util-inl.h"
#include "base/string16.h"
@@ -76,10 +76,13 @@ class DefaultSQLErrorHandlerFactory : public SQLErrorHandlerFactory {
Lock lock_;
};
+static base::LazyInstance<DefaultSQLErrorHandlerFactory>
+ g_default_sql_error_handler_factory(base::LINKER_INITIALIZED);
+
SQLErrorHandlerFactory* GetErrorHandlerFactory() {
// TODO(cpu): Testing needs to override the error handler.
// Destruction of DefaultSQLErrorHandlerFactory handled by at_exit manager.
- return Singleton<DefaultSQLErrorHandlerFactory>::get();
+ return g_default_sql_error_handler_factory.Pointer();
}
namespace sqlite_utils {
diff --git a/chrome/common/time_format.cc b/chrome/common/time_format.cc
index c62f4f5..9de3a402 100644
--- a/chrome/common/time_format.cc
+++ b/chrome/common/time_format.cc
@@ -7,9 +7,9 @@
#include <vector>
#include "app/l10n_util.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
-#include "base/singleton.h"
#include "base/stl_util-inl.h"
#include "base/string16.h"
#include "base/time.h"
@@ -168,8 +168,7 @@ class TimeFormatter {
STLDeleteContainerPointers(time_elapsed_formatter_.begin(),
time_elapsed_formatter_.end());
}
- friend class Singleton<TimeFormatter>;
- friend struct DefaultSingletonTraits<TimeFormatter>;
+ friend struct base::DefaultLazyInstanceTraits<TimeFormatter>;
std::vector<icu::PluralFormat*> short_formatter_;
std::vector<icu::PluralFormat*> time_left_formatter_;
@@ -182,6 +181,9 @@ class TimeFormatter {
DISALLOW_COPY_AND_ASSIGN(TimeFormatter);
};
+static base::LazyInstance<TimeFormatter> g_time_formatter(
+ base::LINKER_INITIALIZED);
+
void TimeFormatter::BuildFormats(
FormatType format_type, std::vector<icu::PluralFormat*>* time_formats) {
static const icu::UnicodeString kKeywords[] = {
@@ -253,8 +255,6 @@ icu::PluralFormat* TimeFormatter::createFallbackFormat(
return format;
}
-Singleton<TimeFormatter> time_formatter;
-
static string16 FormatTimeImpl(const TimeDelta& delta, FormatType format_type) {
if (delta.ToInternalValue() < 0) {
NOTREACHED() << "Negative duration";
@@ -264,7 +264,7 @@ static string16 FormatTimeImpl(const TimeDelta& delta, FormatType format_type) {
int number;
const std::vector<icu::PluralFormat*>& formatters =
- time_formatter->formatter(format_type);
+ g_time_formatter.Get().formatter(format_type);
UErrorCode error = U_ZERO_ERROR;
icu::UnicodeString time_string;
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 87a4772..bb77108 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -9,13 +9,13 @@
#if defined(OS_WIN)
#include "app/win_util.h"
#endif
+#include "base/lazy_instance.h"
#if defined(OS_MACOSX)
#include "base/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#endif
#include "base/scoped_handle.h"
#include "base/shared_memory.h"
-#include "base/singleton.h"
#include "build/build_config.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/plugin_messages.h"
@@ -47,9 +47,7 @@ using webkit_glue::WebPluginAcceleratedSurface;
#endif
typedef std::map<CPBrowsingContext, WebPluginProxy*> ContextMap;
-static ContextMap& GetContextMap() {
- return *Singleton<ContextMap>::get();
-}
+static base::LazyInstance<ContextMap> g_context_map(base::LINKER_INITIALIZED);
WebPluginProxy::WebPluginProxy(
PluginChannel* channel,
@@ -93,7 +91,7 @@ WebPluginProxy::WebPluginProxy(
WebPluginProxy::~WebPluginProxy() {
if (cp_browsing_context_)
- GetContextMap().erase(cp_browsing_context_);
+ g_context_map.Get().erase(cp_browsing_context_);
#if defined(USE_X11)
if (windowless_shm_pixmap_ != None)
@@ -271,14 +269,14 @@ CPBrowsingContext WebPluginProxy::GetCPBrowsingContext() {
if (cp_browsing_context_ == 0) {
Send(new PluginHostMsg_GetCPBrowsingContext(route_id_,
&cp_browsing_context_));
- GetContextMap()[cp_browsing_context_] = this;
+ g_context_map.Get()[cp_browsing_context_] = this;
}
return cp_browsing_context_;
}
WebPluginProxy* WebPluginProxy::FromCPBrowsingContext(
CPBrowsingContext context) {
- return GetContextMap()[context];
+ return g_context_map.Get()[context];
}
WebPluginResourceClient* WebPluginProxy::GetResourceClient(int id) {
diff --git a/chrome/renderer/extensions/bindings_utils.cc b/chrome/renderer/extensions/bindings_utils.cc
index 5b213c4..4776966 100644
--- a/chrome/renderer/extensions/bindings_utils.cc
+++ b/chrome/renderer/extensions/bindings_utils.cc
@@ -4,6 +4,7 @@
#include "chrome/renderer/extensions/bindings_utils.h"
+#include "base/lazy_instance.h"
#include "base/string_split.h"
#include "base/string_util.h"
#include "chrome/renderer/render_view.h"
@@ -21,11 +22,14 @@ struct SingletonData {
ContextList contexts;
PendingRequestMap pending_requests;
};
+static base::LazyInstance<SingletonData> g_singleton_data(
+ base::LINKER_INITIALIZED);
typedef std::map<int, std::string> StringMap;
+static base::LazyInstance<StringMap> g_string_map(base::LINKER_INITIALIZED);
const char* GetStringResource(int resource_id) {
- StringMap* strings = Singleton<StringMap>::get();
+ StringMap* strings = g_string_map.Pointer();
StringMap::iterator it = strings->find(resource_id);
if (it == strings->end()) {
it = strings->insert(std::make_pair(
@@ -84,7 +88,7 @@ ContextInfo::ContextInfo(v8::Persistent<v8::Context> context,
ContextInfo::~ContextInfo() {}
ContextList& GetContexts() {
- return Singleton<SingletonData>::get()->contexts;
+ return g_singleton_data.Get().contexts;
}
ContextList GetContextsForExtension(const std::string& extension_id) {
@@ -134,7 +138,7 @@ ContextList::iterator FindContext(v8::Handle<v8::Context> context) {
}
PendingRequestMap& GetPendingRequestMap() {
- return Singleton<SingletonData>::get()->pending_requests;
+ return g_singleton_data.Get().pending_requests;
}
RenderView* GetRenderViewForCurrentContext() {
diff --git a/chrome/renderer/extensions/renderer_extension_bindings.cc b/chrome/renderer/extensions/renderer_extension_bindings.cc
index 9555672..ab7a8eb 100644
--- a/chrome/renderer/extensions/renderer_extension_bindings.cc
+++ b/chrome/renderer/extensions/renderer_extension_bindings.cc
@@ -8,7 +8,7 @@
#include <string>
#include "base/basictypes.h"
-#include "base/singleton.h"
+#include "base/lazy_instance.h"
#include "base/values.h"
#include "chrome/common/extensions/extension_message_bundle.h"
#include "chrome/common/render_messages.h"
@@ -43,17 +43,20 @@ struct ExtensionData {
std::map<int, PortData> ports; // port ID -> data
};
+static base::LazyInstance<ExtensionData> g_extension_data(
+ base::LINKER_INITIALIZED);
+
static bool HasPortData(int port_id) {
- return Singleton<ExtensionData>::get()->ports.find(port_id) !=
- Singleton<ExtensionData>::get()->ports.end();
+ return g_extension_data.Get().ports.find(port_id) !=
+ g_extension_data.Get().ports.end();
}
static ExtensionData::PortData& GetPortData(int port_id) {
- return Singleton<ExtensionData>::get()->ports[port_id];
+ return g_extension_data.Get().ports[port_id];
}
static void ClearPortData(int port_id) {
- Singleton<ExtensionData>::get()->ports.erase(port_id);
+ g_extension_data.Get().ports.erase(port_id);
}
const char kPortClosedError[] = "Attempting to use a disconnected port object";
diff --git a/chrome/renderer/ggl/ggl.cc b/chrome/renderer/ggl/ggl.cc
index 577e853..c95bbb5 100644
--- a/chrome/renderer/ggl/ggl.cc
+++ b/chrome/renderer/ggl/ggl.cc
@@ -4,8 +4,8 @@
#include "build/build_config.h"
+#include "base/lazy_instance.h"
#include "base/ref_counted.h"
-#include "base/singleton.h"
#include "base/weak_ptr.h"
#include "chrome/renderer/command_buffer_proxy.h"
#include "chrome/renderer/ggl/ggl.h"
@@ -48,6 +48,10 @@ class GLES2Initializer {
private:
DISALLOW_COPY_AND_ASSIGN(GLES2Initializer);
};
+
+static base::LazyInstance<GLES2Initializer> g_gles2_initializer(
+ base::LINKER_INITIALIZED);
+
} // namespace anonymous
// Manages a GL context.
@@ -163,7 +167,7 @@ bool Context::Initialize(gfx::NativeViewId view,
return false;
// Ensure the gles2 library is initialized first in a thread safe way.
- Singleton<GLES2Initializer>::get();
+ g_gles2_initializer.Get();
// Allocate a frame buffer ID with respect to the parent.
if (parent_.get()) {
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index e29e30a..ca29c0a 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -15,10 +15,10 @@
#include "base/callback.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
+#include "base/lazy_instance.h"
#include "base/metrics/histogram.h"
#include "base/path_service.h"
#include "base/process_util.h"
-#include "base/singleton.h"
#include "base/string_piece.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
@@ -277,6 +277,7 @@ using webkit_glue::WebAccessibility;
//-----------------------------------------------------------------------------
typedef std::map<WebKit::WebView*, RenderView*> ViewMap;
+static base::LazyInstance<ViewMap> g_view_map(base::LINKER_INITIALIZED);
// define to write the time necessary for thumbnail/DOM text retrieval,
// respectively, into the system debug log
@@ -615,7 +616,7 @@ RenderView::~RenderView() {
#ifndef NDEBUG
// Make sure we are no longer referenced by the ViewMap.
- ViewMap* views = Singleton<ViewMap>::get();
+ ViewMap* views = g_view_map.Pointer();
for (ViewMap::iterator it = views->begin(); it != views->end(); ++it)
DCHECK_NE(this, it->second) << "Failed to call Close?";
#endif
@@ -623,7 +624,7 @@ RenderView::~RenderView() {
/*static*/
void RenderView::ForEach(RenderViewVisitor* visitor) {
- ViewMap* views = Singleton<ViewMap>::get();
+ ViewMap* views = g_view_map.Pointer();
for (ViewMap::iterator it = views->begin(); it != views->end(); ++it) {
if (!visitor->Visit(it->second))
return;
@@ -632,7 +633,7 @@ void RenderView::ForEach(RenderViewVisitor* visitor) {
/*static*/
RenderView* RenderView::FromWebView(WebView* webview) {
- ViewMap* views = Singleton<ViewMap>::get();
+ ViewMap* views = g_view_map.Pointer();
ViewMap::iterator it = views->find(webview);
return it == views->end() ? NULL : it->second;
}
@@ -895,7 +896,7 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd,
devtools_agent_.reset(new DevToolsAgent(routing_id, this));
webwidget_ = WebView::create(this, devtools_agent_.get());
- Singleton<ViewMap>::get()->insert(std::make_pair(webview(), this));
+ g_view_map.Get().insert(std::make_pair(webview(), this));
webkit_preferences_.Apply(webview());
webview()->initializeMainFrame(this);
if (!frame_name.empty())
@@ -5447,7 +5448,7 @@ void RenderView::Close() {
// We need to grab a pointer to the doomed WebView before we destroy it.
WebView* doomed = webview();
RenderWidget::Close();
- Singleton<ViewMap>::get()->erase(doomed);
+ g_view_map.Get().erase(doomed);
}
void RenderView::DidHandleKeyEvent() {