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

Side by Side Diff: chrome/browser/sync/test_profile_sync_service.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: fixes for bustes tests Created 7 years, 3 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/sync/test_profile_sync_service.h" 5 #include "chrome/browser/sync/test_profile_sync_service.h"
6 6
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/signin/signin_manager.h" 8 #include "chrome/browser/signin/signin_manager.h"
9 #include "chrome/browser/signin/signin_manager_factory.h" 9 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "chrome/browser/sync/glue/data_type_controller.h" 10 #include "chrome/browser/sync/glue/data_type_controller.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 synchronous_backend_initialization_, 312 synchronous_backend_initialization_,
313 fail_initial_download_, 313 fail_initial_download_,
314 storage_option_)); 314 storage_option_));
315 } 315 }
316 316
317 scoped_ptr<OAuth2TokenService::Request> FakeOAuth2TokenService::StartRequest( 317 scoped_ptr<OAuth2TokenService::Request> FakeOAuth2TokenService::StartRequest(
318 const OAuth2TokenService::ScopeSet& scopes, 318 const OAuth2TokenService::ScopeSet& scopes,
319 OAuth2TokenService::Consumer* consumer) { 319 OAuth2TokenService::Consumer* consumer) {
320 // Ensure token in question is cached and never expires. Request will succeed 320 // Ensure token in question is cached and never expires. Request will succeed
321 // without network IO. 321 // without network IO.
322 RegisterCacheEntry(GetRefreshToken(), scopes, "access_token", 322 RegisterCacheEntry("test_client_id",
323 base::Time::Max()); 323 GetRefreshToken(),
324 scopes,
325 "access_token",
326 base::Time::Max());
324 return ProfileOAuth2TokenService::StartRequest(scopes, consumer); 327 return ProfileOAuth2TokenService::StartRequest(scopes, consumer);
325 } 328 }
326 329
327 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService( 330 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService(
328 content::BrowserContext* context) { 331 content::BrowserContext* context) {
329 Profile* profile = static_cast<Profile*>(context); 332 Profile* profile = static_cast<Profile*>(context);
330 333
331 FakeOAuth2TokenService* service = new FakeOAuth2TokenService(); 334 FakeOAuth2TokenService* service = new FakeOAuth2TokenService();
332 service->Initialize(profile); 335 service->Initialize(profile);
333 return service; 336 return service;
334 } 337 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/profile_oauth2_token_service.cc ('k') | google_apis/gaia/oauth2_token_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698