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

Side by Side Diff: google_apis/google_api_keys.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
« no previous file with comments | « gin/public/v8_platform.h ('k') | gpu/command_buffer/service/mailbox_manager_sync.h » ('j') | 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 "google_apis/google_api_keys.h" 5 #include "google_apis/google_api_keys.h"
6 6
7 // If you add more includes to this list, you also need to add them to 7 // If you add more includes to this list, you also need to add them to
8 // google_api_keys_unittest.cc. 8 // google_api_keys_unittest.cc.
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 return key_value; 282 return key_value;
283 } 283 }
284 284
285 std::string api_key_; 285 std::string api_key_;
286 std::string api_key_non_stable_; 286 std::string api_key_non_stable_;
287 std::string api_key_remoting_; 287 std::string api_key_remoting_;
288 std::string client_ids_[CLIENT_NUM_ITEMS]; 288 std::string client_ids_[CLIENT_NUM_ITEMS];
289 std::string client_secrets_[CLIENT_NUM_ITEMS]; 289 std::string client_secrets_[CLIENT_NUM_ITEMS];
290 }; 290 };
291 291
292 static base::LazyInstance<APIKeyCache> g_api_key_cache = 292 static base::LazyInstance<APIKeyCache>::DestructorAtExit g_api_key_cache =
293 LAZY_INSTANCE_INITIALIZER; 293 LAZY_INSTANCE_INITIALIZER;
294 294
295 bool HasKeysConfigured() { 295 bool HasKeysConfigured() {
296 if (GetAPIKey() == DUMMY_API_TOKEN) 296 if (GetAPIKey() == DUMMY_API_TOKEN)
297 return false; 297 return false;
298 298
299 for (size_t client_id = 0; client_id < CLIENT_NUM_ITEMS; ++client_id) { 299 for (size_t client_id = 0; client_id < CLIENT_NUM_ITEMS; ++client_id) {
300 OAuth2Client client = static_cast<OAuth2Client>(client_id); 300 OAuth2Client client = static_cast<OAuth2Client>(client_id);
301 if (GetOAuth2ClientID(client) == DUMMY_API_TOKEN || 301 if (GetOAuth2ClientID(client) == DUMMY_API_TOKEN ||
302 GetOAuth2ClientSecret(client) == DUMMY_API_TOKEN) { 302 GetOAuth2ClientSecret(client) == DUMMY_API_TOKEN) {
(...skipping 30 matching lines...) Expand all
333 333
334 bool IsGoogleChromeAPIKeyUsed() { 334 bool IsGoogleChromeAPIKeyUsed() {
335 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_OFFICIAL_GOOGLE_API_KEYS) 335 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_OFFICIAL_GOOGLE_API_KEYS)
336 return true; 336 return true;
337 #else 337 #else
338 return false; 338 return false;
339 #endif 339 #endif
340 } 340 }
341 341
342 } // namespace google_apis 342 } // namespace google_apis
OLDNEW
« no previous file with comments | « gin/public/v8_platform.h ('k') | gpu/command_buffer/service/mailbox_manager_sync.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698