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

Side by Side Diff: chrome/utility/importer/firefox_importer_unittest_utils_mac.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/utility/importer/firefox_importer_unittest_utils.h" 5 #include "chrome/utility/importer/firefox_importer_unittest_utils.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 void SetSender(IPC::Sender* sender) { 239 void SetSender(IPC::Sender* sender) {
240 sender_ = sender; 240 sender_ = sender;
241 } 241 }
242 242
243 void OnDecryptor_Init(base::FilePath dll_path, base::FilePath db_path) { 243 void OnDecryptor_Init(base::FilePath dll_path, base::FilePath db_path) {
244 bool ret = decryptor_.Init(dll_path, db_path); 244 bool ret = decryptor_.Init(dll_path, db_path);
245 sender_->Send(new Msg_Decryptor_InitReturnCode(ret)); 245 sender_->Send(new Msg_Decryptor_InitReturnCode(ret));
246 } 246 }
247 247
248 void OnDecrypt(std::string crypt) { 248 void OnDecrypt(const std::string& crypt) {
249 base::string16 unencrypted_str = decryptor_.Decrypt(crypt); 249 base::string16 unencrypted_str = decryptor_.Decrypt(crypt);
250 sender_->Send(new Msg_Decryptor_Response(unencrypted_str)); 250 sender_->Send(new Msg_Decryptor_Response(unencrypted_str));
251 } 251 }
252 252
253 void OnParseSignons(base::FilePath signons_path) { 253 void OnParseSignons(base::FilePath signons_path) {
254 std::vector<autofill::PasswordForm> forms; 254 std::vector<autofill::PasswordForm> forms;
255 decryptor_.ReadAndParseSignons(signons_path, &forms); 255 decryptor_.ReadAndParseSignons(signons_path, &forms);
256 sender_->Send(new Msg_ParseSignons_Response(forms)); 256 sender_->Send(new Msg_ParseSignons_Response(forms));
257 } 257 }
258 258
(...skipping 28 matching lines...) Expand all
287 scoped_ptr<IPC::Channel> channel = IPC::Channel::CreateClient( 287 scoped_ptr<IPC::Channel> channel = IPC::Channel::CreateClient(
288 kTestChannelID, &listener); 288 kTestChannelID, &listener);
289 CHECK(channel->Connect()); 289 CHECK(channel->Connect());
290 listener.SetSender(channel.get()); 290 listener.SetSender(channel.get());
291 291
292 // run message loop 292 // run message loop
293 base::MessageLoop::current()->Run(); 293 base::MessageLoop::current()->Run();
294 294
295 return 0; 295 return 0;
296 } 296 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698