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 <Cocoa/Cocoa.h> | 5 #include <Cocoa/Cocoa.h> |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/strings/sys_string_conversions.h" | 11 #include "base/strings/sys_string_conversions.h" |
12 | 12 |
13 #include "chrome/browser/importer/firefox_importer_utils.h" | 13 #include "chrome/common/importer/firefox_importer_utils.h" |
14 #include "chrome/browser/importer/nss_decryptor_mac.h" | 14 #include "chrome/utility/importer/nss_decryptor_mac.h" |
15 | 15 |
16 // Important!! : On OS X the nss3 libraries are compiled with depedencies | 16 // Important!! : On OS X the nss3 libraries are compiled with depedencies |
17 // on one another, referenced using dyld's @executable_path directive. | 17 // on one another, referenced using dyld's @executable_path directive. |
18 // To make a long story short in order to get the libraries to load, dyld's | 18 // To make a long story short in order to get the libraries to load, dyld's |
19 // fallback path needs to be set to the directory containing the libraries. | 19 // fallback path needs to be set to the directory containing the libraries. |
20 // To do so, the process this function runs in must have the | 20 // To do so, the process this function runs in must have the |
21 // DYLD_FALLBACK_LIBRARY_PATH set on startup to said directory. | 21 // DYLD_FALLBACK_LIBRARY_PATH set on startup to said directory. |
22 bool NSSDecryptor::Init(const base::FilePath& dll_path, | 22 bool NSSDecryptor::Init(const base::FilePath& dll_path, |
23 const base::FilePath& db_path) { | 23 const base::FilePath& db_path) { |
24 if (getenv("DYLD_FALLBACK_LIBRARY_PATH") == NULL) { | 24 if (getenv("DYLD_FALLBACK_LIBRARY_PATH") == NULL) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 is_nss_initialized_ = true; | 62 is_nss_initialized_ = true; |
63 return true; | 63 return true; |
64 } | 64 } |
65 | 65 |
66 NSSDecryptor::~NSSDecryptor() { | 66 NSSDecryptor::~NSSDecryptor() { |
67 if (NSS_Shutdown && is_nss_initialized_) { | 67 if (NSS_Shutdown && is_nss_initialized_) { |
68 NSS_Shutdown(); | 68 NSS_Shutdown(); |
69 is_nss_initialized_ = false; | 69 is_nss_initialized_ = false; |
70 } | 70 } |
71 } | 71 } |
OLD | NEW |