summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 13:31:49 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 13:31:49 +0000
commit6de0fd1d935e8c6c9257f1082dbd227acb1a06b1 (patch)
tree0ed5bc4ef9c2da0b498c30e562218f4528eaac9e /chrome_frame
parent0f86c358fdb5e47aa9cd4a99b12da5e66507d080 (diff)
downloadchromium_src-6de0fd1d935e8c6c9257f1082dbd227acb1a06b1.zip
chromium_src-6de0fd1d935e8c6c9257f1082dbd227acb1a06b1.tar.gz
chromium_src-6de0fd1d935e8c6c9257f1082dbd227acb1a06b1.tar.bz2
Allow linker initialization of lazy instance
Using the initializer list construct = {0} allows the object to be linker initialized. Modify the LazyInstance class design to make it a pod aggregate type that can be linker initialized this way. Also combines the instance and state members, in line with the Singleton<> class design. Introduces a new LAZY_INSTANCE_INITIALIZER macro specifically for using to init all lazy instances + modify all existing callsites to use it. (Old code would no longer compile) BUG=94925 TEST=existing tests pass. http://build.chromium.org/f/chromium/perf/linux-release/sizes/report.html?history=150&header=chrome-si&graph=chrome-si&rev=-1 should step downward. TBR=jam@chromium.org,rvargas@chromium.org,darin@chromium.org,ben@chromium.org,apatrick@chromium.org,akalin@chromium.org Review URL: http://codereview.chromium.org/8491043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_frame_automation.cc2
-rw-r--r--chrome_frame/com_type_info_holder.cc2
-rw-r--r--chrome_frame/crash_reporting/crash_metrics.cc2
-rw-r--r--chrome_frame/external_tab.cc4
-rw-r--r--chrome_frame/metrics_service.cc4
-rw-r--r--chrome_frame/test/net/fake_external_tab.cc6
-rw-r--r--chrome_frame/urlmon_moniker.cc2
-rw-r--r--chrome_frame/utils.cc2
8 files changed, 12 insertions, 12 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc
index 4f6c57c..fcc2e50 100644
--- a/chrome_frame/chrome_frame_automation.cc
+++ b/chrome_frame/chrome_frame_automation.cc
@@ -505,7 +505,7 @@ bool ProxyFactory::ReleaseAutomationServer(void* server_id,
static base::LazyInstance<ProxyFactory,
base::LeakyLazyInstanceTraits<ProxyFactory> >
- g_proxy_factory(base::LINKER_INITIALIZED);
+ g_proxy_factory = LAZY_INSTANCE_INITIALIZER;
template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> {
static void RetainCallee(ChromeFrameAutomationClient* obj) {}
diff --git a/chrome_frame/com_type_info_holder.cc b/chrome_frame/com_type_info_holder.cc
index aa9b13b..dd71ec0 100644
--- a/chrome_frame/com_type_info_holder.cc
+++ b/chrome_frame/com_type_info_holder.cc
@@ -11,7 +11,7 @@ extern "C" IMAGE_DOS_HEADER __ImageBase;
namespace com_util {
-base::LazyInstance<TypeInfoCache> type_info_cache(base::LINKER_INITIALIZED);
+base::LazyInstance<TypeInfoCache> type_info_cache = LAZY_INSTANCE_INITIALIZER;
// TypeInfoCache
diff --git a/chrome_frame/crash_reporting/crash_metrics.cc b/chrome_frame/crash_reporting/crash_metrics.cc
index 8a103f1..fb59aa8 100644
--- a/chrome_frame/crash_reporting/crash_metrics.cc
+++ b/chrome_frame/crash_reporting/crash_metrics.cc
@@ -12,7 +12,7 @@ static const wchar_t kChromeFrameMetricsKey[] =
L"Software\\Google\\ChromeFrameMetrics";
base::LazyInstance<CrashMetricsReporter>
- g_crash_metrics_instance_(base::LINKER_INITIALIZED);
+ g_crash_metrics_instance_ = LAZY_INSTANCE_INITIALIZER;
wchar_t* CrashMetricsReporter::g_metric_names[LAST_METRIC] = {
L"navigationcount",
diff --git a/chrome_frame/external_tab.cc b/chrome_frame/external_tab.cc
index 0e5b044..797a2ab 100644
--- a/chrome_frame/external_tab.cc
+++ b/chrome_frame/external_tab.cc
@@ -15,8 +15,8 @@ DISABLE_RUNNABLE_METHOD_REFCOUNT(ExternalTabProxy);
DISABLE_RUNNABLE_METHOD_REFCOUNT(UIDelegate);
namespace {
- static base::LazyInstance<ChromeProxyFactory> g_proxy_factory(
- base::LINKER_INITIALIZED);
+ static base::LazyInstance<ChromeProxyFactory> g_proxy_factory =
+ LAZY_INSTANCE_INITIALIZER;
struct UserDataHolder : public SyncMessageContext {
explicit UserDataHolder(void* p) : data(p) {}
diff --git a/chrome_frame/metrics_service.cc b/chrome_frame/metrics_service.cc
index 9af220b..27d453e 100644
--- a/chrome_frame/metrics_service.cc
+++ b/chrome_frame/metrics_service.cc
@@ -78,13 +78,13 @@ static const int kInitialUMAUploadTimeoutMilliSeconds = 30000;
static const int kMinMilliSecondsPerUMAUpload = 600000;
base::LazyInstance<base::ThreadLocalPointer<MetricsService> >
- MetricsService::g_metrics_instance_(base::LINKER_INITIALIZED);
+ MetricsService::g_metrics_instance_ = LAZY_INSTANCE_INITIALIZER;
base::Lock MetricsService::metrics_service_lock_;
// Initialize histogram statistics gathering system.
base::LazyInstance<base::StatisticsRecorder>
- g_statistics_recorder_(base::LINKER_INITIALIZED);
+ g_statistics_recorder_ = LAZY_INSTANCE_INITIALIZER;
// This class provides functionality to upload the ChromeFrame UMA data to the
// server. An instance of this class is created whenever we have data to be
diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc
index b597289..bce7023 100644
--- a/chrome_frame/test/net/fake_external_tab.cc
+++ b/chrome_frame/test/net/fake_external_tab.cc
@@ -136,15 +136,15 @@ class FakeBrowserProcessImpl : public BrowserProcessImpl {
};
base::LazyInstance<chrome::ChromeContentClient>
- g_chrome_content_client(base::LINKER_INITIALIZED);
+ g_chrome_content_client = LAZY_INSTANCE_INITIALIZER;
// Override the default ContentBrowserClient to let Chrome participate in
// content logic. Must be done before any tabs are created.
base::LazyInstance<chrome::ChromeContentBrowserClient>
- g_browser_client(base::LINKER_INITIALIZED);
+ g_browser_client = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<chrome::ChromeContentRendererClient>
- g_renderer_client(base::LINKER_INITIALIZED);
+ g_renderer_client = LAZY_INSTANCE_INITIALIZER;
} // namespace
diff --git a/chrome_frame/urlmon_moniker.cc b/chrome_frame/urlmon_moniker.cc
index 0f5ea5a..753d265 100644
--- a/chrome_frame/urlmon_moniker.cc
+++ b/chrome_frame/urlmon_moniker.cc
@@ -23,7 +23,7 @@ static const int kMonikerBindToObject = 8;
static const int kMonikerBindToStorage = kMonikerBindToObject + 1;
base::LazyInstance<base::ThreadLocalPointer<NavigationManager> >
- NavigationManager::thread_singleton_(base::LINKER_INITIALIZED);
+ NavigationManager::thread_singleton_ = LAZY_INSTANCE_INITIALIZER;
BEGIN_VTABLE_PATCHES(IMoniker)
VTABLE_PATCH_ENTRY(kMonikerBindToObject, MonikerPatch::BindToObject)
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index 7cb2b14..f6a74b7 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -110,7 +110,7 @@ namespace {
// pointer so it should not be dereferenced and used for comparison against a
// living instance only.
base::LazyInstance<base::ThreadLocalPointer<IBrowserService> >
- g_tls_browser_for_cf_navigation(base::LINKER_INITIALIZED);
+ g_tls_browser_for_cf_navigation = LAZY_INSTANCE_INITIALIZER;
} // end anonymous namespace