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

Side by Side Diff: extensions/browser/api/networking_config/networking_config_service.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Transform hex_ssid to uppercase. 71 // Transform hex_ssid to uppercase.
72 transform(hex_ssid.begin(), hex_ssid.end(), hex_ssid.begin(), toupper); 72 transform(hex_ssid.begin(), hex_ssid.end(), hex_ssid.begin(), toupper);
73 73
74 const auto it = hex_ssid_to_extension_id_.find(hex_ssid); 74 const auto it = hex_ssid_to_extension_id_.find(hex_ssid);
75 if (it == hex_ssid_to_extension_id_.end()) 75 if (it == hex_ssid_to_extension_id_.end())
76 return std::string(); 76 return std::string();
77 return it->second; 77 return it->second;
78 } 78 }
79 79
80 bool NetworkingConfigService::IsRegisteredForCaptivePortalEvent( 80 bool NetworkingConfigService::IsRegisteredForCaptivePortalEvent(
81 std::string extension_id) const { 81 const std::string& extension_id) const {
82 return event_delegate_->HasExtensionRegisteredForEvent(extension_id); 82 return event_delegate_->HasExtensionRegisteredForEvent(extension_id);
83 } 83 }
84 84
85 bool NetworkingConfigService::RegisterHexSsid(std::string hex_ssid, 85 bool NetworkingConfigService::RegisterHexSsid(std::string hex_ssid,
86 const std::string& extension_id) { 86 const std::string& extension_id) {
87 if (!IsValidNonEmptyHexString(hex_ssid)) { 87 if (!IsValidNonEmptyHexString(hex_ssid)) {
88 LOG(ERROR) << "\'" << hex_ssid << "\' is not a valid hex encoded string."; 88 LOG(ERROR) << "\'" << hex_ssid << "\' is not a valid hex encoded string.";
89 return false; 89 return false;
90 } 90 }
91 91
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 network_handler->managed_network_configuration_handler()->GetProperties( 222 network_handler->managed_network_configuration_handler()->GetProperties(
223 "" /* empty userhash */, service_path, 223 "" /* empty userhash */, service_path,
224 base::Bind(&NetworkingConfigService::OnGotProperties, 224 base::Bind(&NetworkingConfigService::OnGotProperties,
225 weak_factory_.GetWeakPtr(), extension_id, guid, 225 weak_factory_.GetWeakPtr(), extension_id, guid,
226 authentication_callback), 226 authentication_callback),
227 base::Bind(&NetworkingConfigService::OnGetPropertiesFailed, 227 base::Bind(&NetworkingConfigService::OnGetPropertiesFailed,
228 weak_factory_.GetWeakPtr(), extension_id, guid)); 228 weak_factory_.GetWeakPtr(), extension_id, guid));
229 } 229 }
230 230
231 } // namespace extensions 231 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698