OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/chrome_application_mac.h" | 5 #include "base/chrome_application_mac.h" |
6 #include "base/environment.h" | 6 #include "base/environment.h" |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/common/plugin_carbon_interpose_constants_mac.h" | 9 #include "chrome/common/plugin_carbon_interpose_constants_mac.h" |
10 #include "chrome/plugin/plugin_interpose_util_mac.h" | 10 #include "chrome/plugin/plugin_interpose_util_mac.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 strlen(plugin_interpose_strings::kInterposeLibraryPath); | 29 strlen(plugin_interpose_strings::kInterposeLibraryPath); |
30 | 30 |
31 if (suffix_offset == 0 && | 31 if (suffix_offset == 0 && |
32 strcmp(interpose_list.c_str(), | 32 strcmp(interpose_list.c_str(), |
33 plugin_interpose_strings::kInterposeLibraryPath) == 0) { | 33 plugin_interpose_strings::kInterposeLibraryPath) == 0) { |
34 env->UnSetVar(plugin_interpose_strings::kDYLDInsertLibrariesKey); | 34 env->UnSetVar(plugin_interpose_strings::kDYLDInsertLibrariesKey); |
35 } else if (suffix_offset > 0 && interpose_list[suffix_offset - 1] == ':' && | 35 } else if (suffix_offset > 0 && interpose_list[suffix_offset - 1] == ':' && |
36 strcmp(interpose_list.c_str() + suffix_offset, | 36 strcmp(interpose_list.c_str() + suffix_offset, |
37 plugin_interpose_strings::kInterposeLibraryPath) == 0) { | 37 plugin_interpose_strings::kInterposeLibraryPath) == 0) { |
38 std::string trimmed_list = interpose_list.substr(0, suffix_offset - 1); | 38 std::string trimmed_list = interpose_list.substr(0, suffix_offset - 1); |
39 env->SetEnv(plugin_interpose_strings::kDYLDInsertLibrariesKey, | 39 env->SetVar(plugin_interpose_strings::kDYLDInsertLibrariesKey, |
40 trimmed_list.c_str()); | 40 trimmed_list.c_str()); |
41 } else { | 41 } else { |
42 NOTREACHED() << "Missing Carbon interposing library"; | 42 NOTREACHED() << "Missing Carbon interposing library"; |
43 } | 43 } |
44 } | 44 } |
45 #endif | 45 #endif |
46 | 46 |
47 void InitializeChromeApplication() { | 47 void InitializeChromeApplication() { |
48 [CrApplication sharedApplication]; | 48 [CrApplication sharedApplication]; |
49 | 49 |
50 mac_plugin_interposing::SetUpCocoaInterposing(); | 50 mac_plugin_interposing::SetUpCocoaInterposing(); |
51 } | 51 } |
OLD | NEW |