Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1147)

Side by Side Diff: content/public/renderer/render_view_observer_tracker.h

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/renderer/render_thread.cc ('k') | content/public/utility/utility_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Helper class used to find the RenderViewObservers for a given RenderView. 5 // Helper class used to find the RenderViewObservers for a given RenderView.
6 // 6 //
7 // Example usage: 7 // Example usage:
8 // 8 //
9 // class MyRVO : public RenderViewObserver, 9 // class MyRVO : public RenderViewObserver,
10 // public RenderViewObserverTracker<MyRVO> { 10 // public RenderViewObserverTracker<MyRVO> {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 const RenderView* render_view_; 54 const RenderView* render_view_;
55 55
56 static base::LazyInstance<std::map<const RenderView*, T*> > 56 static base::LazyInstance<std::map<const RenderView*, T*> >
57 render_view_map_; 57 render_view_map_;
58 58
59 DISALLOW_COPY_AND_ASSIGN(RenderViewObserverTracker<T>); 59 DISALLOW_COPY_AND_ASSIGN(RenderViewObserverTracker<T>);
60 }; 60 };
61 61
62 template <class T> 62 template <class T>
63 base::LazyInstance<std::map<const RenderView*, T*> > 63 base::LazyInstance<std::map<const RenderView*, T*> >
64 RenderViewObserverTracker<T>::render_view_map_(base::LINKER_INITIALIZED); 64 RenderViewObserverTracker<T>::render_view_map_ = LAZY_INSTANCE_INITIALIZER;
65 65
66 } // namespace content 66 } // namespace content
67 67
68 #endif // CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_TRACKER_H_ 68 #endif // CONTENT_PUBLIC_RENDERER_RENDER_VIEW_OBSERVER_TRACKER_H_
OLDNEW
« no previous file with comments | « content/public/renderer/render_thread.cc ('k') | content/public/utility/utility_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698