| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |