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

Side by Side Diff: chromecast/common/chromecast_config.cc

Issue 546243002: Fix the uses of T* conversion operator from scoped_refptr<T> which is now removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review comments Created 6 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
« no previous file with comments | « no previous file | chromecast/shell/browser/url_request_context_factory.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/common/chromecast_config.h" 5 #include "chromecast/common/chromecast_config.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 DCHECK(thread_checker_.CalledOnValidThread()); 74 DCHECK(thread_checker_.CalledOnValidThread());
75 VLOG(1) << "Loading config from " << config_path_.value(); 75 VLOG(1) << "Loading config from " << config_path_.value();
76 registry->RegisterIntegerPref(prefs::kRemoteDebuggingPort, 0); 76 registry->RegisterIntegerPref(prefs::kRemoteDebuggingPort, 0);
77 77
78 metrics::RegisterPrefs(registry); 78 metrics::RegisterPrefs(registry);
79 RegisterPlatformPrefs(registry); 79 RegisterPlatformPrefs(registry);
80 80
81 PersistentPrefStore::PrefReadError prefs_read_error = 81 PersistentPrefStore::PrefReadError prefs_read_error =
82 PersistentPrefStore::PREF_READ_ERROR_NONE; 82 PersistentPrefStore::PREF_READ_ERROR_NONE;
83 base::PrefServiceFactory prefServiceFactory; 83 base::PrefServiceFactory prefServiceFactory;
84 prefServiceFactory.SetUserPrefsFile(config_path_, 84 scoped_refptr<base::SequencedTaskRunner> task_runner =
85 JsonPrefStore::GetTaskRunnerForFile(config_path_, worker_pool_)); 85 JsonPrefStore::GetTaskRunnerForFile(config_path_, worker_pool_.get());
86 prefServiceFactory.SetUserPrefsFile(config_path_, task_runner.get());
86 prefServiceFactory.set_async(false); 87 prefServiceFactory.set_async(false);
87 prefServiceFactory.set_read_error_callback( 88 prefServiceFactory.set_read_error_callback(
88 base::Bind(&UserPrefsLoadError, &prefs_read_error)); 89 base::Bind(&UserPrefsLoadError, &prefs_read_error));
89 pref_service_ = prefServiceFactory.Create(registry); 90 pref_service_ = prefServiceFactory.Create(registry);
90 91
91 if (prefs_read_error == PersistentPrefStore::PREF_READ_ERROR_NONE) { 92 if (prefs_read_error == PersistentPrefStore::PREF_READ_ERROR_NONE) {
92 return true; 93 return true;
93 } else { 94 } else {
94 LOG(ERROR) << "Cannot initialize chromecast config: " 95 LOG(ERROR) << "Cannot initialize chromecast config: "
95 << config_path_.value() 96 << config_path_.value()
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (pref_service_->IsUserModifiablePreference(key.c_str())) { 132 if (pref_service_->IsUserModifiablePreference(key.c_str())) {
132 VLOG(1) << "Set config: key=" << key << ", value=" << value; 133 VLOG(1) << "Set config: key=" << key << ", value=" << value;
133 pref_service_->SetInteger(key.c_str(), value); 134 pref_service_->SetInteger(key.c_str(), value);
134 } else { 135 } else {
135 LOG(ERROR) << "Cannot set read-only config: key=" << key 136 LOG(ERROR) << "Cannot set read-only config: key=" << key
136 << ", value=" << value; 137 << ", value=" << value;
137 } 138 }
138 } 139 }
139 140
140 } // namespace chromecast 141 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | chromecast/shell/browser/url_request_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698