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

Side by Side Diff: chrome/browser/chromeos/cros/network_library_impl_stub.cc

Issue 11367048: This is the first pass at making GetIPConfigs asynchronous. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
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/chromeos/cros/network_library_impl_stub.h" 5 #include "chrome/browser/chromeos/cros/network_library_impl_stub.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 9
10 using content::BrowserThread; 10 using content::BrowserThread;
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 } 684 }
685 685
686 void NetworkLibraryImplStub::EnableOfflineMode(bool enable) { 686 void NetworkLibraryImplStub::EnableOfflineMode(bool enable) {
687 if (enable != offline_mode_) { 687 if (enable != offline_mode_) {
688 offline_mode_ = enable; 688 offline_mode_ = enable;
689 CallEnableNetworkDeviceType(TYPE_WIFI, !enable); 689 CallEnableNetworkDeviceType(TYPE_WIFI, !enable);
690 CallEnableNetworkDeviceType(TYPE_CELLULAR, !enable); 690 CallEnableNetworkDeviceType(TYPE_CELLULAR, !enable);
691 } 691 }
692 } 692 }
693 693
694 NetworkIPConfigVector NetworkLibraryImplStub::GetIPConfigs( 694 void NetworkLibraryImplStub::GetIPConfigs(
695 const std::string& device_path,
696 HardwareAddressFormat format,
697 const NetworkGetIPConfigsCallback& callback) {
698 callback.Run(ip_configs_, hardware_address_);
699 }
700
701 NetworkIPConfigVector NetworkLibraryImplStub::GetIPConfigsAndBlock(
695 const std::string& device_path, 702 const std::string& device_path,
696 std::string* hardware_address, 703 std::string* hardware_address,
697 HardwareAddressFormat format) { 704 HardwareAddressFormat format) {
698 *hardware_address = hardware_address_; 705 *hardware_address = hardware_address_;
699 return ip_configs_; 706 return ip_configs_;
700 } 707 }
701 708
702 void NetworkLibraryImplStub::SetIPParameters(const std::string& service_path, 709 void NetworkLibraryImplStub::SetIPParameters(const std::string& service_path,
703 const std::string& address, 710 const std::string& address,
704 const std::string& netmask, 711 const std::string& netmask,
(...skipping 18 matching lines...) Expand all
723 if (network) 730 if (network)
724 ip_configs_.push_back(NetworkIPConfig(network->device_path(), 731 ip_configs_.push_back(NetworkIPConfig(network->device_path(),
725 IPCONFIG_TYPE_IPV4, 732 IPCONFIG_TYPE_IPV4,
726 address, 733 address,
727 netmask, 734 netmask,
728 gateway, 735 gateway,
729 name_servers)); 736 name_servers));
730 } 737 }
731 738
732 } // namespace chromeos 739 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698