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

Side by Side Diff: chrome/browser/ui/webui/html_dialog_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/html_dialog_ui.h" 5 #include "chrome/browser/ui/webui/html_dialog_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/common/chrome_notification_types.h" 11 #include "chrome/common/chrome_notification_types.h"
12 #include "content/browser/renderer_host/render_view_host.h" 12 #include "content/browser/renderer_host/render_view_host.h"
13 #include "content/browser/tab_contents/tab_contents.h" 13 #include "content/browser/tab_contents/tab_contents.h"
14 #include "content/public/browser/notification_service.h" 14 #include "content/public/browser/notification_service.h"
15 #include "content/public/common/bindings_policy.h" 15 #include "content/public/common/bindings_policy.h"
16 16
17 static base::LazyInstance<PropertyAccessor<HtmlDialogUIDelegate*> > 17 static base::LazyInstance<PropertyAccessor<HtmlDialogUIDelegate*> >
18 g_html_dialog_ui_property_accessor(base::LINKER_INITIALIZED); 18 g_html_dialog_ui_property_accessor = LAZY_INSTANCE_INITIALIZER;
19 19
20 HtmlDialogUI::HtmlDialogUI(TabContents* tab_contents) 20 HtmlDialogUI::HtmlDialogUI(TabContents* tab_contents)
21 : ChromeWebUI(tab_contents) { 21 : ChromeWebUI(tab_contents) {
22 } 22 }
23 23
24 HtmlDialogUI::~HtmlDialogUI() { 24 HtmlDialogUI::~HtmlDialogUI() {
25 // Don't unregister our property. During the teardown of the TabContents, 25 // Don't unregister our property. During the teardown of the TabContents,
26 // this will be deleted, but the TabContents will already be destroyed. 26 // this will be deleted, but the TabContents will already be destroyed.
27 // 27 //
28 // This object is owned indirectly by the TabContents. WebUIs can change, so 28 // This object is owned indirectly by the TabContents. WebUIs can change, so
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // that are scoped in duration to the dialogs existence. 94 // that are scoped in duration to the dialogs existence.
95 bindings_ &= ~content::BINDINGS_POLICY_WEB_UI; 95 bindings_ &= ~content::BINDINGS_POLICY_WEB_UI;
96 } 96 }
97 97
98 ExternalHtmlDialogUI::~ExternalHtmlDialogUI() { 98 ExternalHtmlDialogUI::~ExternalHtmlDialogUI() {
99 } 99 }
100 100
101 bool HtmlDialogUIDelegate::HandleContextMenu(const ContextMenuParams& params) { 101 bool HtmlDialogUIDelegate::HandleContextMenu(const ContextMenuParams& params) {
102 return false; 102 return false;
103 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698