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

Side by Side Diff: extensions/browser/api/runtime/runtime_api.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/runtime/runtime_api.h" 5 #include "extensions/browser/api/runtime/runtime_api.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 const std::string& extension_id) { 163 const std::string& extension_id) {
164 std::string url_string; 164 std::string url_string;
165 prefs->ReadPrefAsString(extension_id, kUninstallUrl, &url_string); 165 prefs->ReadPrefAsString(extension_id, kUninstallUrl, &url_string);
166 return url_string; 166 return url_string;
167 } 167 }
168 168
169 } // namespace 169 } // namespace
170 170
171 /////////////////////////////////////////////////////////////////////////////// 171 ///////////////////////////////////////////////////////////////////////////////
172 172
173 static base::LazyInstance<BrowserContextKeyedAPIFactory<RuntimeAPI> > 173 static base::LazyInstance<
174 g_factory = LAZY_INSTANCE_INITIALIZER; 174 BrowserContextKeyedAPIFactory<RuntimeAPI>>::DestructorAtExit g_factory =
175 LAZY_INSTANCE_INITIALIZER;
175 176
176 // static 177 // static
177 BrowserContextKeyedAPIFactory<RuntimeAPI>* RuntimeAPI::GetFactoryInstance() { 178 BrowserContextKeyedAPIFactory<RuntimeAPI>* RuntimeAPI::GetFactoryInstance() {
178 return g_factory.Pointer(); 179 return g_factory.Pointer();
179 } 180 }
180 181
181 // static 182 // static
182 void RuntimeAPI::RegisterPrefs(PrefRegistrySimple* registry) { 183 void RuntimeAPI::RegisterPrefs(PrefRegistrySimple* registry) {
183 registry->RegisterBooleanPref(kPrefLastRestartWasDueToDelayedRestartApi, 184 registry->RegisterBooleanPref(kPrefLastRestartWasDueToDelayedRestartApi,
184 false); 185 false);
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 content::ChildProcessSecurityPolicy* policy = 782 content::ChildProcessSecurityPolicy* policy =
782 content::ChildProcessSecurityPolicy::GetInstance(); 783 content::ChildProcessSecurityPolicy::GetInstance();
783 policy->GrantReadFileSystem(renderer_id, filesystem_id); 784 policy->GrantReadFileSystem(renderer_id, filesystem_id);
784 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 785 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
785 dict->SetString("fileSystemId", filesystem_id); 786 dict->SetString("fileSystemId", filesystem_id);
786 dict->SetString("baseName", relative_path); 787 dict->SetString("baseName", relative_path);
787 return RespondNow(OneArgument(std::move(dict))); 788 return RespondNow(OneArgument(std::move(dict)));
788 } 789 }
789 790
790 } // namespace extensions 791 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698