summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authornfullagar@chromium.org <nfullagar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-25 02:39:39 +0000
committernfullagar@chromium.org <nfullagar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-25 02:39:39 +0000
commit85df1642938825b2de23457bda0b9b717f28f309 (patch)
treed9d11be45a83baf4e2959d54c8e23481c7e570e9 /native_client_sdk
parent33be67d4ff2c1e092702d8abfc3773930cb700ca (diff)
downloadchromium_src-85df1642938825b2de23457bda0b9b717f28f309.zip
chromium_src-85df1642938825b2de23457bda0b9b717f28f309.tar.gz
chromium_src-85df1642938825b2de23457bda0b9b717f28f309.tar.bz2
Update voronoi, remove explicit pp::Var(..)
BUG=none TEST=manual R=binji@chromium.org Review URL: https://codereview.chromium.org/17620007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208350 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r--native_client_sdk/src/examples/demo/voronoi/voronoi.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/native_client_sdk/src/examples/demo/voronoi/voronoi.cc b/native_client_sdk/src/examples/demo/voronoi/voronoi.cc
index fdfd18c..870ffae 100644
--- a/native_client_sdk/src/examples/demo/voronoi/voronoi.cc
+++ b/native_client_sdk/src/examples/demo/voronoi/voronoi.cc
@@ -493,19 +493,19 @@ bool Voronoi::HandleInputEvent(const pp::InputEvent& event) {
// Handle messages sent from Javascript.
void Voronoi::HandleMessage(const pp::Var& var) {
if (var.is_dictionary()) {
- pp::VarDictionary dictionary = pp::VarDictionary(var);
+ pp::VarDictionary dictionary(var);
std::string message = dictionary.Get("message").AsString();
if (message == "run_benchmark" && !benchmarking_)
StartBenchmark();
else if (message == "draw_points")
- draw_points_ = dictionary.Get(pp::Var("value")).AsBool();
+ draw_points_ = dictionary.Get("value").AsBool();
else if (message == "draw_interiors")
- draw_interiors_ = dictionary.Get(pp::Var("value")).AsBool();
+ draw_interiors_ = dictionary.Get("value").AsBool();
else if (message == "set_points") {
- int num_points = dictionary.Get(pp::Var("value")).AsInt();
+ int num_points = dictionary.Get("value").AsInt();
point_count_ = std::min(kMaxPointCount, std::max(0, num_points));
} else if (message == "set_threads") {
- int thread_count = dictionary.Get(pp::Var("value")).AsInt();
+ int thread_count = dictionary.Get("value").AsInt();
delete workers_;
workers_ = new ThreadPool(thread_count);
}
@@ -515,8 +515,8 @@ void Voronoi::HandleMessage(const pp::Var& var) {
// PostUpdateMessage() helper function for sendimg small messages to JS.
void Voronoi::PostUpdateMessage(const char* message_name, double value) {
pp::VarDictionary message;
- message.Set(pp::Var("message"), pp::Var(message_name));
- message.Set(pp::Var("value"), pp::Var(value));
+ message.Set("message", message_name);
+ message.Set("value", value);
PostMessage(message);
}