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

Side by Side Diff: chrome/test/chromedriver/chrome/network_conditions.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/chromedriver/chrome/network_conditions.h" 5 #include "chrome/test/chromedriver/chrome/network_conditions.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 21 matching lines...) Expand all
32 json_reader.GetErrorMessage()); 32 json_reader.GetErrorMessage());
33 33
34 base::ListValue* networks; 34 base::ListValue* networks;
35 if (!networks_value->GetAsList(&networks)) 35 if (!networks_value->GetAsList(&networks))
36 return Status(kUnknownError, "malformed networks list"); 36 return Status(kUnknownError, "malformed networks list");
37 37
38 for (base::ListValue::iterator it = networks->begin(); 38 for (base::ListValue::iterator it = networks->begin();
39 it != networks->end(); 39 it != networks->end();
40 ++it) { 40 ++it) {
41 base::DictionaryValue* network = NULL; 41 base::DictionaryValue* network = NULL;
42 if (!it->GetAsDictionary(&network)) { 42 if (!(*it)->GetAsDictionary(&network)) {
43 return Status(kUnknownError, 43 return Status(kUnknownError,
44 "malformed network in list: should be a dictionary"); 44 "malformed network in list: should be a dictionary");
45 } 45 }
46 46
47 if (network == NULL) 47 if (network == NULL)
48 continue; 48 continue;
49 49
50 std::string title; 50 std::string title;
51 if (!network->GetString("title", &title)) { 51 if (!network->GetString("title", &title)) {
52 return Status(kUnknownError, 52 return Status(kUnknownError,
(...skipping 22 matching lines...) Expand all
75 network_conditions->download_throughput *= 1024; 75 network_conditions->download_throughput *= 1024;
76 network_conditions->upload_throughput *= 1024; 76 network_conditions->upload_throughput *= 1024;
77 77
78 // |offline| is always false for now. 78 // |offline| is always false for now.
79 network_conditions->offline = false; 79 network_conditions->offline = false;
80 return Status(kOk); 80 return Status(kOk);
81 } 81 }
82 82
83 return Status(kUnknownError, "must be a valid network"); 83 return Status(kUnknownError, "must be a valid network");
84 } 84 }
OLDNEW
« no previous file with comments | « chrome/service/cloud_print/printer_job_queue_handler.cc ('k') | chrome/test/chromedriver/logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698