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

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

Issue 100823007: Stop doing unnecessary UTF-8 to UTF-16 conversions in JSONWriter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromeOS page encodings Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/capabilities.h" 5 #include "chrome/test/chromedriver/capabilities.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 388 }
389 389
390 std::string Switches::ToString() const { 390 std::string Switches::ToString() const {
391 std::string str; 391 std::string str;
392 SwitchMap::const_iterator iter = switch_map_.begin(); 392 SwitchMap::const_iterator iter = switch_map_.begin();
393 while (iter != switch_map_.end()) { 393 while (iter != switch_map_.end()) {
394 str += "--" + iter->first; 394 str += "--" + iter->first;
395 std::string value = GetSwitchValue(iter->first); 395 std::string value = GetSwitchValue(iter->first);
396 if (value.length()) { 396 if (value.length()) {
397 if (value.find(' ') != std::string::npos) 397 if (value.find(' ') != std::string::npos)
398 value = base::GetDoubleQuotedJson(value); 398 value = base::GetQuotedJSONString(value);
399 str += "=" + value; 399 str += "=" + value;
400 } 400 }
401 ++iter; 401 ++iter;
402 if (iter == switch_map_.end()) 402 if (iter == switch_map_.end())
403 break; 403 break;
404 str += " "; 404 str += " ";
405 } 405 }
406 return str; 406 return str;
407 } 407 }
408 408
(...skipping 23 matching lines...) Expand all
432 if (desired_caps.Get(it->first, &capability)) { 432 if (desired_caps.Get(it->first, &capability)) {
433 Status status = it->second.Run(*capability, this); 433 Status status = it->second.Run(*capability, this);
434 if (status.IsError()) { 434 if (status.IsError()) {
435 return Status( 435 return Status(
436 kUnknownError, "cannot parse capability: " + it->first, status); 436 kUnknownError, "cannot parse capability: " + it->first, status);
437 } 437 }
438 } 438 }
439 } 439 }
440 return Status(kOk); 440 return Status(kOk);
441 } 441 }
OLDNEW
« no previous file with comments | « chrome/renderer/searchbox/searchbox_extension.cc ('k') | chrome/test/chromedriver/chrome/adb_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698