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

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

Issue 2775913003: Replace unique_ptr.reset(other_unique_ptr.release()) with std::move() in chrome (Closed)
Patch Set: Replace unique_ptr.reset(other_unique_ptr.release()) with std::move() in chrome 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 (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 #include <utility>
8 9
9 #include "base/bind.h" 10 #include "base/bind.h"
10 #include "base/callback.h" 11 #include "base/callback.h"
11 #include "base/json/string_escape.h" 12 #include "base/json/string_escape.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_split.h" 16 #include "base/strings/string_split.h"
16 #include "base/strings/string_tokenizer.h" 17 #include "base/strings/string_tokenizer.h"
17 #include "base/strings/string_util.h" 18 #include "base/strings/string_util.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 Capabilities* capabilities) { 105 Capabilities* capabilities) {
105 std::unique_ptr<MobileDevice> device; 106 std::unique_ptr<MobileDevice> device;
106 Status status = FindMobileDevice(device_name, &device); 107 Status status = FindMobileDevice(device_name, &device);
107 108
108 if (status.IsError()) { 109 if (status.IsError()) {
109 return Status(kUnknownError, 110 return Status(kUnknownError,
110 "'" + device_name + "' must be a valid device", 111 "'" + device_name + "' must be a valid device",
111 status); 112 status);
112 } 113 }
113 114
114 capabilities->device_metrics.reset(device->device_metrics.release()); 115 capabilities->device_metrics = std::move(device->device_metrics);
115 // Don't override the user agent if blank (like for notebooks). 116 // Don't override the user agent if blank (like for notebooks).
116 if (!device->user_agent.empty()) 117 if (!device->user_agent.empty())
117 capabilities->switches.SetSwitch("user-agent", device->user_agent); 118 capabilities->switches.SetSwitch("user-agent", device->user_agent);
118 119
119 return Status(kOk); 120 return Status(kOk);
120 } 121 }
121 122
122 Status ParseMobileEmulation(const base::Value& option, 123 Status ParseMobileEmulation(const base::Value& option,
123 Capabilities* capabilities) { 124 Capabilities* capabilities) {
124 const base::DictionaryValue* mobile_emulation; 125 const base::DictionaryValue* mobile_emulation;
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 if (iter == logging_prefs.end() || iter->second == Log::kOff) { 661 if (iter == logging_prefs.end() || iter->second == Log::kOff) {
661 const base::DictionaryValue* chrome_options = NULL; 662 const base::DictionaryValue* chrome_options = NULL;
662 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) && 663 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) &&
663 chrome_options->HasKey("perfLoggingPrefs")) { 664 chrome_options->HasKey("perfLoggingPrefs")) {
664 return Status(kUnknownError, "perfLoggingPrefs specified, " 665 return Status(kUnknownError, "perfLoggingPrefs specified, "
665 "but performance logging was not enabled"); 666 "but performance logging was not enabled");
666 } 667 }
667 } 668 }
668 return Status(kOk); 669 return Status(kOk);
669 } 670 }
OLDNEW
« no previous file with comments | « chrome/installer/setup/setup_util.cc ('k') | chrome/test/chromedriver/chrome/devtools_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698