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

Side by Side Diff: chrome/browser/ui/webui/constrained_html_ui.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER 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
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 #include "chrome/browser/ui/webui/constrained_html_ui.h" 5 #include "chrome/browser/ui/webui/constrained_html_ui.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/ui/webui/html_dialog_ui.h" 14 #include "chrome/browser/ui/webui/html_dialog_ui.h"
15 #include "chrome/common/chrome_notification_types.h" 15 #include "chrome/common/chrome_notification_types.h"
16 #include "content/browser/renderer_host/render_view_host.h" 16 #include "content/browser/renderer_host/render_view_host.h"
17 #include "content/browser/tab_contents/tab_contents.h" 17 #include "content/browser/tab_contents/tab_contents.h"
18 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
19 19
20 static base::LazyInstance<PropertyAccessor<ConstrainedHtmlUIDelegate*> > 20 static base::LazyInstance<PropertyAccessor<ConstrainedHtmlUIDelegate*> >
21 g_constrained_html_ui_property_accessor(base::LINKER_INITIALIZED); 21 g_constrained_html_ui_property_accessor = LAZY_INSTANCE_INITIALIZER;
22 22
23 ConstrainedHtmlUI::ConstrainedHtmlUI(TabContents* contents) 23 ConstrainedHtmlUI::ConstrainedHtmlUI(TabContents* contents)
24 : ChromeWebUI(contents) { 24 : ChromeWebUI(contents) {
25 } 25 }
26 26
27 ConstrainedHtmlUI::~ConstrainedHtmlUI() { 27 ConstrainedHtmlUI::~ConstrainedHtmlUI() {
28 } 28 }
29 29
30 void ConstrainedHtmlUI::RenderViewCreated(RenderViewHost* render_view_host) { 30 void ConstrainedHtmlUI::RenderViewCreated(RenderViewHost* render_view_host) {
31 ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate(); 31 ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 ConstrainedHtmlUIDelegate** property = 70 ConstrainedHtmlUIDelegate** property =
71 GetPropertyAccessor().GetProperty(tab_contents()->property_bag()); 71 GetPropertyAccessor().GetProperty(tab_contents()->property_bag());
72 return property ? *property : NULL; 72 return property ? *property : NULL;
73 } 73 }
74 74
75 // static 75 // static
76 PropertyAccessor<ConstrainedHtmlUIDelegate*>& 76 PropertyAccessor<ConstrainedHtmlUIDelegate*>&
77 ConstrainedHtmlUI::GetPropertyAccessor() { 77 ConstrainedHtmlUI::GetPropertyAccessor() {
78 return g_constrained_html_ui_property_accessor.Get(); 78 return g_constrained_html_ui_property_accessor.Get();
79 } 79 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698