OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ | 5 #ifndef CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ |
6 #define CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ | 6 #define CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/process/process.h" | 12 #include "base/process/process.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "chrome/utility/importer/nss_decryptor.h" | 14 #include "chrome/utility/importer/nss_decryptor.h" |
14 #include "components/autofill/core/common/password_form.h" | 15 #include "components/autofill/core/common/password_form.h" |
15 | 16 |
16 class FFDecryptorServerChannelListener; | 17 class FFDecryptorServerChannelListener; |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class MessageLoopForIO; | 20 class MessageLoopForIO; |
20 } | 21 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 53 |
53 private: | 54 private: |
54 #if defined(OS_MACOSX) | 55 #if defined(OS_MACOSX) |
55 // Blocks until either a timeout is reached, or until the client process | 56 // Blocks until either a timeout is reached, or until the client process |
56 // responds to an IPC message. | 57 // responds to an IPC message. |
57 // Returns true if a reply was received successfully and false if the | 58 // Returns true if a reply was received successfully and false if the |
58 // the operation timed out. | 59 // the operation timed out. |
59 bool WaitForClientResponse(); | 60 bool WaitForClientResponse(); |
60 | 61 |
61 base::Process child_process_; | 62 base::Process child_process_; |
62 scoped_ptr<IPC::Channel> channel_; | 63 std::unique_ptr<IPC::Channel> channel_; |
63 scoped_ptr<FFDecryptorServerChannelListener> listener_; | 64 std::unique_ptr<FFDecryptorServerChannelListener> listener_; |
64 scoped_ptr<base::MessageLoopForIO> message_loop_; | 65 std::unique_ptr<base::MessageLoopForIO> message_loop_; |
65 #else | 66 #else |
66 NSSDecryptor decryptor_; | 67 NSSDecryptor decryptor_; |
67 #endif // !OS_MACOSX | 68 #endif // !OS_MACOSX |
68 DISALLOW_COPY_AND_ASSIGN(FFUnitTestDecryptorProxy); | 69 DISALLOW_COPY_AND_ASSIGN(FFUnitTestDecryptorProxy); |
69 }; | 70 }; |
70 | 71 |
71 // On Non-OSX platforms FFUnitTestDecryptorProxy simply calls through to | 72 // On Non-OSX platforms FFUnitTestDecryptorProxy simply calls through to |
72 // NSSDecryptor. | 73 // NSSDecryptor. |
73 #if !defined(OS_MACOSX) | 74 #if !defined(OS_MACOSX) |
74 FFUnitTestDecryptorProxy::FFUnitTestDecryptorProxy() { | 75 FFUnitTestDecryptorProxy::FFUnitTestDecryptorProxy() { |
(...skipping 20 matching lines...) Expand all Loading... |
95 std::vector<autofill::PasswordForm> signons; | 96 std::vector<autofill::PasswordForm> signons; |
96 if (decryptor_.ReadAndParseSignons(signons_path, &signons)) | 97 if (decryptor_.ReadAndParseSignons(signons_path, &signons)) |
97 return signons; | 98 return signons; |
98 | 99 |
99 return std::vector<autofill::PasswordForm>(); | 100 return std::vector<autofill::PasswordForm>(); |
100 } | 101 } |
101 | 102 |
102 #endif // !OS_MACOSX | 103 #endif // !OS_MACOSX |
103 | 104 |
104 #endif // CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ | 105 #endif // CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ |
OLD | NEW |