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 #ifndef CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ |
6 #define CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ | 6 #define CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 bool Setup(const std::wstring& nss_path); | 37 bool Setup(const std::wstring& nss_path); |
38 | 38 |
39 // This match the parallel functions in NSSDecryptor. | 39 // This match the parallel functions in NSSDecryptor. |
40 bool DecryptorInit(const std::wstring& dll_path, const std::wstring& db_path); | 40 bool DecryptorInit(const std::wstring& dll_path, const std::wstring& db_path); |
41 string16 Decrypt(const std::string& crypt); | 41 string16 Decrypt(const std::string& crypt); |
42 | 42 |
43 private: | 43 private: |
44 #if defined(OS_MACOSX) | 44 #if defined(OS_MACOSX) |
45 // Blocks until either a timeout is reached, or until the client process | 45 // Blocks until either a timeout is reached, or until the client process |
46 // responds to an IPC message. | 46 // responds to an IPC message. |
47 // Returns true if a reply was recieved successfully and false if the | 47 // Returns true if a reply was received successfully and false if the |
48 // the operation timed out. | 48 // the operation timed out. |
49 bool WaitForClientResponse(); | 49 bool WaitForClientResponse(); |
50 | 50 |
51 base::ProcessHandle child_process_; | 51 base::ProcessHandle child_process_; |
52 scoped_ptr<IPC::Channel> channel_; | 52 scoped_ptr<IPC::Channel> channel_; |
53 scoped_ptr<FFDecryptorServerChannelListener> listener_; | 53 scoped_ptr<FFDecryptorServerChannelListener> listener_; |
54 scoped_ptr<MessageLoopForIO> message_loop_; | 54 scoped_ptr<MessageLoopForIO> message_loop_; |
55 #else | 55 #else |
56 NSSDecryptor decryptor_; | 56 NSSDecryptor decryptor_; |
57 #endif // !OS_MACOSX | 57 #endif // !OS_MACOSX |
(...skipping 17 matching lines...) Expand all Loading... |
75 const std::wstring& db_path) { | 75 const std::wstring& db_path) { |
76 return decryptor_.Init(dll_path, db_path); | 76 return decryptor_.Init(dll_path, db_path); |
77 } | 77 } |
78 | 78 |
79 string16 FFUnitTestDecryptorProxy::Decrypt(const std::string& crypt) { | 79 string16 FFUnitTestDecryptorProxy::Decrypt(const std::string& crypt) { |
80 return decryptor_.Decrypt(crypt); | 80 return decryptor_.Decrypt(crypt); |
81 } | 81 } |
82 #endif // !OS_MACOSX | 82 #endif // !OS_MACOSX |
83 | 83 |
84 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ | 84 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ |
OLD | NEW |