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

Side by Side Diff: chrome/browser/internal_auth.cc

Issue 7825026: Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/net/predictor_unittest.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/internal_auth.h" 5 #include "chrome/browser/internal_auth.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 class InternalAuthGenerationService : public base::ThreadChecker { 337 class InternalAuthGenerationService : public base::ThreadChecker {
338 public: 338 public:
339 InternalAuthGenerationService() : key_regeneration_tick_(0) { 339 InternalAuthGenerationService() : key_regeneration_tick_(0) {
340 GenerateNewKey(); 340 GenerateNewKey();
341 } 341 }
342 342
343 void GenerateNewKey() { 343 void GenerateNewKey() {
344 DCHECK(CalledOnValidThread()); 344 DCHECK(CalledOnValidThread());
345 if (!timer_.IsRunning()) { 345 if (!timer_.IsRunning()) {
346 timer_.Start(FROM_HERE, 346 timer_.Start(
347 base::TimeDelta::FromMicroseconds( 347 base::TimeDelta::FromMicroseconds(
348 kKeyRegenerationSoftTicks * kTickUs), 348 kKeyRegenerationSoftTicks * kTickUs),
349 this, 349 this,
350 &InternalAuthGenerationService::GenerateNewKey); 350 &InternalAuthGenerationService::GenerateNewKey);
351 } 351 }
352 352
353 scoped_ptr<crypto::HMAC> new_engine( 353 scoped_ptr<crypto::HMAC> new_engine(
354 new crypto::HMAC(crypto::HMAC::SHA256)); 354 new crypto::HMAC(crypto::HMAC::SHA256));
355 std::string key = base::RandBytesAsString(kKeySizeInBytes); 355 std::string key = base::RandBytesAsString(kKeySizeInBytes);
356 if (!new_engine->Init(key)) 356 if (!new_engine->Init(key))
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 return g_generation_service.Get().GeneratePassport(domain, var_value_map, 0); 477 return g_generation_service.Get().GeneratePassport(domain, var_value_map, 0);
478 } 478 }
479 479
480 // static 480 // static
481 void InternalAuthGeneration::GenerateNewKey() { 481 void InternalAuthGeneration::GenerateNewKey() {
482 g_generation_service.Get().GenerateNewKey(); 482 g_generation_service.Get().GenerateNewKey();
483 } 483 }
484 484
485 } // namespace browser 485 } // namespace browser
486 486
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/net/predictor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698