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

Side by Side Diff: chrome/browser/metrics/variations/variations_service.cc

Issue 739173002: Remove dependencies of ResourceRequestAllowedNotifier on chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and cleanup Created 6 years, 1 month 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 | « no previous file | chrome/browser/metrics/variations/variations_service_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) 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/metrics/variations/variations_service.h" 5 #include "chrome/browser/metrics/variations/variations_service.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/build_time.h" 9 #include "base/build_time.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 #if !defined(GOOGLE_CHROME_BUILD) 482 #if !defined(GOOGLE_CHROME_BUILD)
483 // Unless the URL was provided, unsupported builds should return NULL to 483 // Unless the URL was provided, unsupported builds should return NULL to
484 // indicate that the service should not be used. 484 // indicate that the service should not be used.
485 if (!CommandLine::ForCurrentProcess()->HasSwitch( 485 if (!CommandLine::ForCurrentProcess()->HasSwitch(
486 switches::kVariationsServerURL)) { 486 switches::kVariationsServerURL)) {
487 DVLOG(1) << "Not creating VariationsService in unofficial build without --" 487 DVLOG(1) << "Not creating VariationsService in unofficial build without --"
488 << switches::kVariationsServerURL << " specified."; 488 << switches::kVariationsServerURL << " specified.";
489 return result.Pass(); 489 return result.Pass();
490 } 490 }
491 #endif 491 #endif
492 result.reset(new VariationsService( 492 result.reset(
493 new ResourceRequestAllowedNotifier, local_state, state_manager)); 493 new VariationsService(new ResourceRequestAllowedNotifier(local_state),
494 local_state, state_manager));
494 return result.Pass(); 495 return result.Pass();
495 } 496 }
496 497
497 void VariationsService::DoActualFetch() { 498 void VariationsService::DoActualFetch() {
498 pending_seed_request_.reset(net::URLFetcher::Create( 499 pending_seed_request_.reset(net::URLFetcher::Create(
499 0, variations_server_url_, net::URLFetcher::GET, this)); 500 0, variations_server_url_, net::URLFetcher::GET, this));
500 pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | 501 pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
501 net::LOAD_DO_NOT_SAVE_COOKIES); 502 net::LOAD_DO_NOT_SAVE_COOKIES);
502 pending_seed_request_->SetRequestContext( 503 pending_seed_request_->SetRequestContext(
503 g_browser_process->system_request_context()); 504 g_browser_process->system_request_context());
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 689
689 void VariationsService::RecordLastFetchTime() { 690 void VariationsService::RecordLastFetchTime() {
690 // local_state_ is NULL in tests, so check it first. 691 // local_state_ is NULL in tests, so check it first.
691 if (local_state_) { 692 if (local_state_) {
692 local_state_->SetInt64(prefs::kVariationsLastFetchTime, 693 local_state_->SetInt64(prefs::kVariationsLastFetchTime,
693 base::Time::Now().ToInternalValue()); 694 base::Time::Now().ToInternalValue());
694 } 695 }
695 } 696 }
696 697
697 } // namespace chrome_variations 698 } // namespace chrome_variations
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/variations_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698