OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); | 213 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); |
214 if (!locale.empty()) { | 214 if (!locale.empty()) { |
215 // Pass on the locale so the null plugin will use the right language in the | 215 // Pass on the locale so the null plugin will use the right language in the |
216 // prompt to install the desired plugin. | 216 // prompt to install the desired plugin. |
217 cmd_line->AppendSwitchASCII(switches::kLang, locale); | 217 cmd_line->AppendSwitchASCII(switches::kLang, locale); |
218 } | 218 } |
219 | 219 |
220 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); | 220 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
221 | 221 |
222 #if defined(OS_POSIX) | 222 #if defined(OS_POSIX) |
223 base::EnvironmentVector env; | 223 base::EnvironmentMap env; |
224 #if defined(OS_MACOSX) && !defined(__LP64__) | 224 #if defined(OS_MACOSX) && !defined(__LP64__) |
225 if (!browser_command_line.HasSwitch(switches::kDisableCarbonInterposing)) { | 225 if (!browser_command_line.HasSwitch(switches::kDisableCarbonInterposing)) { |
226 std::string interpose_list = GetContentClient()->GetCarbonInterposePath(); | 226 std::string interpose_list = GetContentClient()->GetCarbonInterposePath(); |
227 if (!interpose_list.empty()) { | 227 if (!interpose_list.empty()) { |
228 // Add our interposing library for Carbon. This is stripped back out in | 228 // Add our interposing library for Carbon. This is stripped back out in |
229 // plugin_main.cc, so changes here should be reflected there. | 229 // plugin_main.cc, so changes here should be reflected there. |
230 const char* existing_list = getenv(kDYLDInsertLibrariesKey); | 230 const char* existing_list = getenv(kDYLDInsertLibrariesKey); |
231 if (existing_list) { | 231 if (existing_list) { |
232 interpose_list.insert(0, ":"); | 232 interpose_list.insert(0, ":"); |
233 interpose_list.insert(0, existing_list); | 233 interpose_list.insert(0, existing_list); |
234 } | 234 } |
235 } | 235 } |
236 env.push_back(std::pair<std::string, std::string>( | 236 env[kDYLDInsertLibrariesKey] = interpose_list; |
237 kDYLDInsertLibrariesKey, interpose_list)); | |
238 } | 237 } |
239 #endif | 238 #endif |
240 #endif | 239 #endif |
241 | 240 |
242 process_->Launch( | 241 process_->Launch( |
243 #if defined(OS_WIN) | 242 #if defined(OS_WIN) |
244 new PluginSandboxedProcessLauncherDelegate, | 243 new PluginSandboxedProcessLauncherDelegate, |
245 #elif defined(OS_POSIX) | 244 #elif defined(OS_POSIX) |
246 false, | 245 false, |
247 env, | 246 env, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 void PluginProcessHost::OnChannelCreated( | 407 void PluginProcessHost::OnChannelCreated( |
409 const IPC::ChannelHandle& channel_handle) { | 408 const IPC::ChannelHandle& channel_handle) { |
410 Client* client = sent_requests_.front(); | 409 Client* client = sent_requests_.front(); |
411 | 410 |
412 if (client) | 411 if (client) |
413 client->OnChannelOpened(channel_handle); | 412 client->OnChannelOpened(channel_handle); |
414 sent_requests_.pop_front(); | 413 sent_requests_.pop_front(); |
415 } | 414 } |
416 | 415 |
417 } // namespace content | 416 } // namespace content |
OLD | NEW |