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

Side by Side Diff: extensions/common/manifest_handlers/oauth2_manifest_handler.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/common/manifest_handlers/oauth2_manifest_handler.h" 5 #include "extensions/common/manifest_handlers/oauth2_manifest_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 13 matching lines...) Expand all
24 } // namespace 24 } // namespace
25 25
26 namespace extensions { 26 namespace extensions {
27 27
28 namespace keys = manifest_keys; 28 namespace keys = manifest_keys;
29 namespace errors = manifest_errors; 29 namespace errors = manifest_errors;
30 30
31 OAuth2Info::OAuth2Info() : auto_approve(false) {} 31 OAuth2Info::OAuth2Info() : auto_approve(false) {}
32 OAuth2Info::~OAuth2Info() {} 32 OAuth2Info::~OAuth2Info() {}
33 33
34 static base::LazyInstance<OAuth2Info> g_empty_oauth2_info = 34 static base::LazyInstance<OAuth2Info>::DestructorAtExit g_empty_oauth2_info =
35 LAZY_INSTANCE_INITIALIZER; 35 LAZY_INSTANCE_INITIALIZER;
36 36
37 // static 37 // static
38 const OAuth2Info& OAuth2Info::GetOAuth2Info(const Extension* extension) { 38 const OAuth2Info& OAuth2Info::GetOAuth2Info(const Extension* extension) {
39 OAuth2Info* info = static_cast<OAuth2Info*>( 39 OAuth2Info* info = static_cast<OAuth2Info*>(
40 extension->GetManifestData(keys::kOAuth2)); 40 extension->GetManifestData(keys::kOAuth2));
41 return info ? *info : g_empty_oauth2_info.Get(); 41 return info ? *info : g_empty_oauth2_info.Get();
42 } 42 }
43 43
44 OAuth2ManifestHandler::OAuth2ManifestHandler() { 44 OAuth2ManifestHandler::OAuth2ManifestHandler() {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 extension->SetManifestData(keys::kOAuth2, std::move(info)); 93 extension->SetManifestData(keys::kOAuth2, std::move(info));
94 return true; 94 return true;
95 } 95 }
96 96
97 const std::vector<std::string> OAuth2ManifestHandler::Keys() const { 97 const std::vector<std::string> OAuth2ManifestHandler::Keys() const {
98 return SingleKey(keys::kOAuth2); 98 return SingleKey(keys::kOAuth2);
99 } 99 }
100 100
101 } // namespace extensions 101 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/manifest_handlers/icons_handler.cc ('k') | extensions/common/manifest_handlers/sandboxed_page_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698