Commit b1394741 authored by rnk's avatar rnk Committed by Commit bot

Fix order or evaluation bug in wifi services code

R=thakis@chromium.org
BUG=409318,82385

Review URL: https://codereview.chromium.org/525703002

Cr-Commit-Position: refs/heads/master@{#292760}
parent 892f21f9
...@@ -174,12 +174,13 @@ void NetworkingPrivateServiceClient::GetProperties( ...@@ -174,12 +174,13 @@ void NetworkingPrivateServiceClient::GetProperties(
scoped_ptr<base::DictionaryValue> properties(new base::DictionaryValue); scoped_ptr<base::DictionaryValue> properties(new base::DictionaryValue);
std::string* error = new std::string; std::string* error = new std::string;
base::DictionaryValue* properties_ptr = properties.get();
task_runner_->PostTaskAndReply( task_runner_->PostTaskAndReply(
FROM_HERE, FROM_HERE,
base::Bind(&WiFiService::GetProperties, base::Bind(&WiFiService::GetProperties,
base::Unretained(wifi_service_.get()), base::Unretained(wifi_service_.get()),
guid, guid,
properties.get(), properties_ptr,
error), error),
base::Bind(&NetworkingPrivateServiceClient::AfterGetProperties, base::Bind(&NetworkingPrivateServiceClient::AfterGetProperties,
weak_factory_.GetWeakPtr(), weak_factory_.GetWeakPtr(),
...@@ -200,12 +201,13 @@ void NetworkingPrivateServiceClient::GetManagedProperties( ...@@ -200,12 +201,13 @@ void NetworkingPrivateServiceClient::GetManagedProperties(
scoped_ptr<base::DictionaryValue> properties(new base::DictionaryValue); scoped_ptr<base::DictionaryValue> properties(new base::DictionaryValue);
std::string* error = new std::string; std::string* error = new std::string;
base::DictionaryValue* properties_ptr = properties.get();
task_runner_->PostTaskAndReply( task_runner_->PostTaskAndReply(
FROM_HERE, FROM_HERE,
base::Bind(&WiFiService::GetManagedProperties, base::Bind(&WiFiService::GetManagedProperties,
base::Unretained(wifi_service_.get()), base::Unretained(wifi_service_.get()),
guid, guid,
properties.get(), properties_ptr,
error), error),
base::Bind(&NetworkingPrivateServiceClient::AfterGetProperties, base::Bind(&NetworkingPrivateServiceClient::AfterGetProperties,
weak_factory_.GetWeakPtr(), weak_factory_.GetWeakPtr(),
...@@ -226,12 +228,13 @@ void NetworkingPrivateServiceClient::GetState( ...@@ -226,12 +228,13 @@ void NetworkingPrivateServiceClient::GetState(
scoped_ptr<base::DictionaryValue> properties(new base::DictionaryValue); scoped_ptr<base::DictionaryValue> properties(new base::DictionaryValue);
std::string* error = new std::string; std::string* error = new std::string;
base::DictionaryValue* properties_ptr = properties.get();
task_runner_->PostTaskAndReply( task_runner_->PostTaskAndReply(
FROM_HERE, FROM_HERE,
base::Bind(&WiFiService::GetState, base::Bind(&WiFiService::GetState,
base::Unretained(wifi_service_.get()), base::Unretained(wifi_service_.get()),
guid, guid,
properties.get(), properties_ptr,
error), error),
base::Bind(&NetworkingPrivateServiceClient::AfterGetProperties, base::Bind(&NetworkingPrivateServiceClient::AfterGetProperties,
weak_factory_.GetWeakPtr(), weak_factory_.GetWeakPtr(),
...@@ -307,12 +310,13 @@ void NetworkingPrivateServiceClient::GetNetworks( ...@@ -307,12 +310,13 @@ void NetworkingPrivateServiceClient::GetNetworks(
// TODO(stevenjb/mef): Apply filters (configured, visible, limit). // TODO(stevenjb/mef): Apply filters (configured, visible, limit).
base::ListValue* networks_ptr = networks.get();
task_runner_->PostTaskAndReply( task_runner_->PostTaskAndReply(
FROM_HERE, FROM_HERE,
base::Bind(&WiFiService::GetVisibleNetworks, base::Bind(&WiFiService::GetVisibleNetworks,
base::Unretained(wifi_service_.get()), base::Unretained(wifi_service_.get()),
network_type, network_type,
networks.get(), networks_ptr,
false), false),
base::Bind(&NetworkingPrivateServiceClient::AfterGetVisibleNetworks, base::Bind(&NetworkingPrivateServiceClient::AfterGetVisibleNetworks,
weak_factory_.GetWeakPtr(), weak_factory_.GetWeakPtr(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment