commit | 6de0fd1d935e8c6c9257f1082dbd227acb1a06b1 | [log] [tgz] |
---|---|---|
author | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Tue Nov 15 13:31:49 2011 |
committer | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Tue Nov 15 13:31:49 2011 |
tree | 0ed5bc4ef9c2da0b498c30e562218f4528eaac9e | |
parent | 0f86c358fdb5e47aa9cd4a99b12da5e66507d080 [diff] [blame] |
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. [email protected],[email protected],[email protected],[email protected],[email protected],[email protected] Review URL: http://codereview.chromium.org/8491043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110076 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index ea8f8ff..a47ea0c 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -108,8 +108,8 @@ // Keep the global RenderThreadImpl in a TLS slot so it is impossible to access // incorrectly from the wrong thread. -static base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > lazy_tls( - base::LINKER_INITIALIZED); +static base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > + lazy_tls = LAZY_INSTANCE_INITIALIZER; class RenderViewZoomer : public content::RenderViewVisitor { public: