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

Side by Side Diff: chrome/browser/spellchecker/spellcheck_profile.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/spellchecker/spellcheck_profile.h" 5 #include "chrome/browser/spellchecker/spellcheck_profile.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/spellchecker/spellcheck_host.h" 13 #include "chrome/browser/spellchecker/spellcheck_host.h"
14 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" 14 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h"
15 #include "chrome/common/chrome_constants.h" 15 #include "chrome/common/chrome_constants.h"
16 #include "chrome/common/pref_names.h" 16 #include "chrome/common/pref_names.h"
17 17
18 using content::BrowserThread; 18 using content::BrowserThread;
19 19
20 namespace { 20 namespace {
21 base::LazyInstance<SpellCheckProfile::CustomWordList> g_empty_list( 21 base::LazyInstance<SpellCheckProfile::CustomWordList> g_empty_list =
22 base::LINKER_INITIALIZED); 22 LAZY_INSTANCE_INITIALIZER;
23 } // namespace 23 } // namespace
24 24
25 SpellCheckProfile::SpellCheckProfile(const FilePath& profile_dir) 25 SpellCheckProfile::SpellCheckProfile(const FilePath& profile_dir)
26 : host_ready_(false), 26 : host_ready_(false),
27 profile_dir_(profile_dir) { 27 profile_dir_(profile_dir) {
28 } 28 }
29 29
30 SpellCheckProfile::~SpellCheckProfile() { 30 SpellCheckProfile::~SpellCheckProfile() {
31 if (host_.get()) 31 if (host_.get())
32 host_->UnsetProfile(); 32 host_->UnsetProfile();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 const FilePath& SpellCheckProfile::GetCustomDictionaryPath() { 142 const FilePath& SpellCheckProfile::GetCustomDictionaryPath() {
143 if (!custom_dictionary_path_.get()) { 143 if (!custom_dictionary_path_.get()) {
144 custom_dictionary_path_.reset( 144 custom_dictionary_path_.reset(
145 new FilePath(profile_dir_.Append(chrome::kCustomDictionaryFileName))); 145 new FilePath(profile_dir_.Append(chrome::kCustomDictionaryFileName)));
146 } 146 }
147 147
148 return *custom_dictionary_path_; 148 return *custom_dictionary_path_;
149 } 149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698