| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser/importer/firefox_importer_unittest_utils.h" | 5 #include "chrome/browser/importer/firefox_importer_unittest_utils.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug_on_start.h" | 8 #include "base/debug_on_start.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const char kTestChannelID[] = "T1"; | 27 const char kTestChannelID[] = "T1"; |
| 28 | 28 |
| 29 // Launch the child process: | 29 // Launch the child process: |
| 30 // |nss_path| - path to the NSS directory holding the decryption libraries. | 30 // |nss_path| - path to the NSS directory holding the decryption libraries. |
| 31 // |channel| - IPC Channel to use for communication. | 31 // |channel| - IPC Channel to use for communication. |
| 32 // |handle| - On return, the process handle to use to communicate with the | 32 // |handle| - On return, the process handle to use to communicate with the |
| 33 // child. | 33 // child. |
| 34 bool LaunchNSSDecrypterChildProcess(const std::wstring& nss_path, | 34 bool LaunchNSSDecrypterChildProcess(const std::wstring& nss_path, |
| 35 const IPC::Channel& channel, base::ProcessHandle* handle) { | 35 const IPC::Channel& channel, base::ProcessHandle* handle) { |
| 36 CommandLine cl(*CommandLine::ForCurrentProcess()); | 36 CommandLine cl(*CommandLine::ForCurrentProcess()); |
| 37 cl.AppendSwitchWithValue(L"client", L"NSSDecrypterChildProcess"); | 37 cl.AppendSwitchWithValue("client", "NSSDecrypterChildProcess"); |
| 38 | 38 |
| 39 FilePath ff_dylib_dir = FilePath::FromWStringHack(nss_path); | 39 FilePath ff_dylib_dir = FilePath::FromWStringHack(nss_path); |
| 40 // Set env variable needed for FF encryption libs to load. | 40 // Set env variable needed for FF encryption libs to load. |
| 41 // See "chrome/browser/importer/nss_decryptor_mac.mm" for an explanation of | 41 // See "chrome/browser/importer/nss_decryptor_mac.mm" for an explanation of |
| 42 // why we need this. | 42 // why we need this. |
| 43 base::environment_vector env; | 43 base::environment_vector env; |
| 44 std::pair<const char*,const char*> dyld_override; | 44 std::pair<const char*,const char*> dyld_override; |
| 45 dyld_override.first = "DYLD_FALLBACK_LIBRARY_PATH"; | 45 dyld_override.first = "DYLD_FALLBACK_LIBRARY_PATH"; |
| 46 dyld_override.second = ff_dylib_dir.value().c_str(); | 46 dyld_override.second = ff_dylib_dir.value().c_str(); |
| 47 env.push_back(dyld_override); | 47 env.push_back(dyld_override); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 IPC::Channel channel(kTestChannelID, IPC::Channel::MODE_CLIENT, &listener); | 258 IPC::Channel channel(kTestChannelID, IPC::Channel::MODE_CLIENT, &listener); |
| 259 channel.Connect(); | 259 channel.Connect(); |
| 260 listener.SetSender(&channel); | 260 listener.SetSender(&channel); |
| 261 | 261 |
| 262 // run message loop | 262 // run message loop |
| 263 MessageLoop::current()->Run(); | 263 MessageLoop::current()->Run(); |
| 264 | 264 |
| 265 return 0; | 265 return 0; |
| 266 } | 266 } |
| OLD | NEW |