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

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

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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 (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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 Status IgnoreCapability(const base::Value& option, Capabilities* capabilities) { 90 Status IgnoreCapability(const base::Value& option, Capabilities* capabilities) {
91 return Status(kOk); 91 return Status(kOk);
92 } 92 }
93 93
94 Status ParseLogPath(const base::Value& option, Capabilities* capabilities) { 94 Status ParseLogPath(const base::Value& option, Capabilities* capabilities) {
95 if (!option.GetAsString(&capabilities->log_path)) 95 if (!option.GetAsString(&capabilities->log_path))
96 return Status(kUnknownError, "must be a string"); 96 return Status(kUnknownError, "must be a string");
97 return Status(kOk); 97 return Status(kOk);
98 } 98 }
99 99
100 Status ParseDeviceName(std::string device_name, Capabilities* capabilities) { 100 Status ParseDeviceName(const std::string& device_name,
101 Capabilities* capabilities) {
101 scoped_ptr<MobileDevice> device; 102 scoped_ptr<MobileDevice> device;
102 Status status = FindMobileDevice(device_name, &device); 103 Status status = FindMobileDevice(device_name, &device);
103 104
104 if (status.IsError()) { 105 if (status.IsError()) {
105 return Status(kUnknownError, 106 return Status(kUnknownError,
106 "'" + device_name + "' must be a valid device", 107 "'" + device_name + "' must be a valid device",
107 status); 108 status);
108 } 109 }
109 110
110 capabilities->device_metrics.reset(device->device_metrics.release()); 111 capabilities->device_metrics.reset(device->device_metrics.release());
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 if (iter == logging_prefs.end() || iter->second == Log::kOff) { 594 if (iter == logging_prefs.end() || iter->second == Log::kOff) {
594 const base::DictionaryValue* chrome_options = NULL; 595 const base::DictionaryValue* chrome_options = NULL;
595 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) && 596 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) &&
596 chrome_options->HasKey("perfLoggingPrefs")) { 597 chrome_options->HasKey("perfLoggingPrefs")) {
597 return Status(kUnknownError, "perfLoggingPrefs specified, " 598 return Status(kUnknownError, "perfLoggingPrefs specified, "
598 "but performance logging was not enabled"); 599 "but performance logging was not enabled");
599 } 600 }
600 } 601 }
601 return Status(kOk); 602 return Status(kOk);
602 } 603 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698