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

Unified Diff: chrome/browser/chromeos/options/cellular_config_view.cc

Issue 4169001: Rewritten parts of NetworkLibrary to work around memory corruption that prev... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/options/cellular_config_view.cc
===================================================================
--- chrome/browser/chromeos/options/cellular_config_view.cc (revision 64441)
+++ chrome/browser/chromeos/options/cellular_config_view.cc (working copy)
@@ -40,7 +40,7 @@
// TODO(xiyuan): Get real data from libcros when it's ready.
// Get plan details at the time being called.
-void GetPlanDetails(const chromeos::CellularNetwork& cellular,
+void GetPlanDetails(const chromeos::CellularNetwork* cellular,
PlanDetails* details) {
// Free 5M 30day plan.
details->last_purchase_type = UNKNOWN;
@@ -56,9 +56,9 @@
namespace chromeos {
CellularConfigView::CellularConfigView(NetworkConfigView* parent,
- const CellularNetwork& cellular)
+ const CellularNetwork* cellular)
: parent_(parent),
- cellular_(cellular),
+ cellular_(new CellularNetwork(*cellular)),
purchase_info_(NULL),
purchase_more_button_(NULL),
remaining_data_info_(NULL),
@@ -69,6 +69,9 @@
Init();
}
+CellularConfigView::~CellularConfigView() {
+}
+
void CellularConfigView::ButtonPressed(views::Button* button,
const views::Event& event) {
if (button == purchase_more_button_) {
@@ -85,9 +88,10 @@
bool CellularConfigView::Save() {
// Save auto-connect here.
bool auto_connect = autoconnect_checkbox_->checked();
- if (auto_connect != cellular_.auto_connect()) {
- cellular_.set_auto_connect(auto_connect);
- CrosLibrary::Get()->GetNetworkLibrary()->SaveCellularNetwork(cellular_);
+ if (auto_connect != cellular_->auto_connect()) {
+ cellular_->set_auto_connect(auto_connect);
+ CrosLibrary::Get()->GetNetworkLibrary()->SaveCellularNetwork(
+ cellular_.get());
}
return true;
}
@@ -157,10 +161,10 @@
}
void CellularConfigView::Update() {
- autoconnect_checkbox_->SetChecked(cellular_.auto_connect());
+ autoconnect_checkbox_->SetChecked(cellular_->auto_connect());
PlanDetails details;
- GetPlanDetails(cellular_, &details);
+ GetPlanDetails(cellular_.get(), &details);
switch (details.last_purchase_type) {
case NO_PURCHASE:
« no previous file with comments | « chrome/browser/chromeos/options/cellular_config_view.h ('k') | chrome/browser/chromeos/options/internet_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698