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

Side by Side Diff: ui/message_center/message_center.cc

Issue 444463007: Initialize the global message center instance to NULL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months 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
« no previous file with comments | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/message_center/message_center.h" 5 #include "ui/message_center/message_center.h"
6 6
7 #include "base/observer_list.h" 7 #include "base/observer_list.h"
8 #include "ui/message_center/message_center_impl.h" 8 #include "ui/message_center/message_center_impl.h"
9 9
10 namespace message_center { 10 namespace message_center {
11 11
12 //------------------------------------------------------------------------------ 12 //------------------------------------------------------------------------------
13 13
14 namespace { 14 namespace {
15 static MessageCenter* g_message_center; 15 static MessageCenter* g_message_center = NULL;
16 } 16 }
17 17
18 // static 18 // static
19 void MessageCenter::Initialize() { 19 void MessageCenter::Initialize() {
20 DCHECK(g_message_center == NULL); 20 DCHECK(g_message_center == NULL);
21 g_message_center = new MessageCenterImpl(); 21 g_message_center = new MessageCenterImpl();
22 } 22 }
23 23
24 // static 24 // static
25 MessageCenter* MessageCenter::Get() { 25 MessageCenter* MessageCenter::Get() {
26 DCHECK(g_message_center); 26 DCHECK(g_message_center);
27 return g_message_center; 27 return g_message_center;
28 } 28 }
29 29
30 // static 30 // static
31 void MessageCenter::Shutdown() { 31 void MessageCenter::Shutdown() {
32 DCHECK(g_message_center); 32 DCHECK(g_message_center);
33 delete g_message_center; 33 delete g_message_center;
34 g_message_center = NULL; 34 g_message_center = NULL;
35 } 35 }
36 36
37 MessageCenter::MessageCenter() { 37 MessageCenter::MessageCenter() {
38 } 38 }
39 39
40 MessageCenter::~MessageCenter() { 40 MessageCenter::~MessageCenter() {
41 } 41 }
42 42
43 } // namespace message_center 43 } // namespace message_center
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698