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

Side by Side Diff: chrome/browser/extensions/api/identity/identity_api.cc

Issue 22581003: Handling of multiple concurrent requests from different clients in OAuth2TokenService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 "chrome/browser/extensions/api/identity/identity_api.h" 5 #include "chrome/browser/extensions/api/identity/identity_api.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 void IdentityGetAuthTokenFunction::StartLoginAccessTokenRequest() { 418 void IdentityGetAuthTokenFunction::StartLoginAccessTokenRequest() {
419 ProfileOAuth2TokenService* service = 419 ProfileOAuth2TokenService* service =
420 ProfileOAuth2TokenServiceFactory::GetForProfile(profile()); 420 ProfileOAuth2TokenServiceFactory::GetForProfile(profile());
421 #if defined(OS_CHROMEOS) 421 #if defined(OS_CHROMEOS)
422 if (chrome::IsRunningInForcedAppMode()) { 422 if (chrome::IsRunningInForcedAppMode()) {
423 std::string app_client_id; 423 std::string app_client_id;
424 std::string app_client_secret; 424 std::string app_client_secret;
425 if (chromeos::UserManager::Get()->GetAppModeChromeClientOAuthInfo( 425 if (chromeos::UserManager::Get()->GetAppModeChromeClientOAuthInfo(
426 &app_client_id, &app_client_secret)) { 426 &app_client_id, &app_client_secret)) {
427 login_token_request_ = 427 login_token_request_ =
428 service->StartRequestForClient(app_client_id, 428 service->StartRequestForClient(extension_->id(),
429 app_client_id,
429 app_client_secret, 430 app_client_secret,
430 OAuth2TokenService::ScopeSet(), 431 OAuth2TokenService::ScopeSet(),
431 this); 432 this);
432 return; 433 return;
433 } 434 }
434 } 435 }
435 #endif 436 #endif
436 login_token_request_ = service->StartRequest(OAuth2TokenService::ScopeSet(), 437 login_token_request_ = service->StartRequest(OAuth2TokenService::ScopeSet(),
437 this); 438 this);
438 } 439 }
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 const IdentityAPI::TokenCacheKey& rhs) const { 770 const IdentityAPI::TokenCacheKey& rhs) const {
770 if (extension_id < rhs.extension_id) 771 if (extension_id < rhs.extension_id)
771 return true; 772 return true;
772 else if (rhs.extension_id < extension_id) 773 else if (rhs.extension_id < extension_id)
773 return false; 774 return false;
774 775
775 return scopes < rhs.scopes; 776 return scopes < rhs.scopes;
776 } 777 }
777 778
778 } // namespace extensions 779 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698