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

Side by Side Diff: chrome/browser/chromeos/proxy_config_service_impl.cc

Issue 8091002: PART2: Make SignedSettings use proper Value types instead of string all around the place. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT and made clang happy. Created 9 years, 2 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) 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/chromeos/proxy_config_service_impl.h" 5 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 CheckCurrentlyOnIOThread(); 649 CheckCurrentlyOnIOThread();
650 if (config_availability_ == net::ProxyConfigService::CONFIG_VALID) { 650 if (config_availability_ == net::ProxyConfigService::CONFIG_VALID) {
651 VLOG(1) << "returning proxy mode=" << cached_config_.mode; 651 VLOG(1) << "returning proxy mode=" << cached_config_.mode;
652 cached_config_.ToNetProxyConfig(net_config); 652 cached_config_.ToNetProxyConfig(net_config);
653 } 653 }
654 return config_availability_; 654 return config_availability_;
655 } 655 }
656 656
657 void ProxyConfigServiceImpl::OnSettingsOpCompleted( 657 void ProxyConfigServiceImpl::OnSettingsOpCompleted(
658 SignedSettings::ReturnCode code, 658 SignedSettings::ReturnCode code,
659 std::string value) { 659 const base::Value& value) {
660 retrieve_property_op_ = NULL; 660 retrieve_property_op_ = NULL;
661 if (code != SignedSettings::SUCCESS) { 661 if (code != SignedSettings::SUCCESS) {
662 LOG(WARNING) << "Error retrieving proxy setting from device"; 662 LOG(WARNING) << "Error retrieving proxy setting from device";
663 device_config_.clear(); 663 device_config_.clear();
664 return; 664 return;
665 } 665 }
666 VLOG(1) << "Retrieved proxy setting from device, value=[" << value << "]"; 666 std::string policy_value;
667 value.GetAsString(&policy_value);
668 VLOG(1) << "Retrieved proxy setting from device, value=["
669 << policy_value << "]";
667 ProxyConfig device_config; 670 ProxyConfig device_config;
668 if (!device_config.DeserializeForDevice(value) || 671 if (!device_config.DeserializeForDevice(policy_value) ||
669 !device_config.SerializeForNetwork(&device_config_)) { 672 !device_config.SerializeForNetwork(&device_config_)) {
670 LOG(WARNING) << "Can't deserialize device setting or serialize for network"; 673 LOG(WARNING) << "Can't deserialize device setting or serialize for network";
671 device_config_.clear(); 674 device_config_.clear();
672 return; 675 return;
673 } 676 }
674 if (!active_network_.empty()) { 677 if (!active_network_.empty()) {
675 VLOG(1) << "try migrating device config to " << active_network_; 678 VLOG(1) << "try migrating device config to " << active_network_;
676 SetProxyConfigForNetwork(active_network_, device_config_, true); 679 SetProxyConfigForNetwork(active_network_, device_config_, true);
677 } 680 }
678 } 681 }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 852
850 void ProxyConfigServiceImpl::CheckCurrentlyOnIOThread() { 853 void ProxyConfigServiceImpl::CheckCurrentlyOnIOThread() {
851 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 854 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
852 } 855 }
853 856
854 void ProxyConfigServiceImpl::CheckCurrentlyOnUIThread() { 857 void ProxyConfigServiceImpl::CheckCurrentlyOnUIThread() {
855 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 858 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
856 } 859 }
857 860
858 } // namespace chromeos 861 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698