OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/plugin_process_host.h" | 5 #include "chrome/browser/plugin_process_host.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 CloseHandle(target.hThread); | 426 CloseHandle(target.hThread); |
427 process_.set_handle(target.hProcess); | 427 process_.set_handle(target.hProcess); |
428 | 428 |
429 // Help the process a little. It can't start the debugger by itself if | 429 // Help the process a little. It can't start the debugger by itself if |
430 // the process is in a sandbox. | 430 // the process is in a sandbox. |
431 if (child_needs_help) | 431 if (child_needs_help) |
432 DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId); | 432 DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId); |
433 } else { | 433 } else { |
434 // spawn child process | 434 // spawn child process |
435 HANDLE process; | 435 HANDLE process; |
436 if (!process_util::LaunchApp(cmd_line, false, false, &process)) | 436 if (!base::LaunchApp(cmd_line, false, false, &process)) |
437 return false; | 437 return false; |
438 process_.set_handle(process); | 438 process_.set_handle(process); |
439 } | 439 } |
440 | 440 |
441 watcher_.StartWatching(process_.handle(), this); | 441 watcher_.StartWatching(process_.handle(), this); |
442 | 442 |
443 std::wstring gears_path; | 443 std::wstring gears_path; |
444 std::wstring dll_lc = dll; | 444 std::wstring dll_lc = dll; |
445 if (PathService::Get(chrome::FILE_GEARS_PLUGIN, &gears_path)) { | 445 if (PathService::Get(chrome::FILE_GEARS_PLUGIN, &gears_path)) { |
446 StringToLowerASCII(&gears_path); | 446 StringToLowerASCII(&gears_path); |
(...skipping 16 matching lines...) Expand all Loading... |
463 return false; | 463 return false; |
464 } | 464 } |
465 return channel_->Send(msg); | 465 return channel_->Send(msg); |
466 } | 466 } |
467 | 467 |
468 // indicates the plugin process has exited | 468 // indicates the plugin process has exited |
469 void PluginProcessHost::OnObjectSignaled(HANDLE object) { | 469 void PluginProcessHost::OnObjectSignaled(HANDLE object) { |
470 DCHECK(process_.handle()); | 470 DCHECK(process_.handle()); |
471 DCHECK_EQ(object, process_.handle()); | 471 DCHECK_EQ(object, process_.handle()); |
472 | 472 |
473 bool did_crash = process_util::DidProcessCrash(object); | 473 bool did_crash = base::DidProcessCrash(object); |
474 | 474 |
475 if (did_crash) { | 475 if (did_crash) { |
476 // Report that this plugin crashed. | 476 // Report that this plugin crashed. |
477 plugin_service_->main_message_loop()->PostTask(FROM_HERE, | 477 plugin_service_->main_message_loop()->PostTask(FROM_HERE, |
478 new PluginNotificationTask(NOTIFY_PLUGIN_PROCESS_CRASHED, | 478 new PluginNotificationTask(NOTIFY_PLUGIN_PROCESS_CRASHED, |
479 dll_path(), object)); | 479 dll_path(), object)); |
480 } | 480 } |
481 // Notify in the main loop of the disconnection. | 481 // Notify in the main loop of the disconnection. |
482 plugin_service_->main_message_loop()->PostTask(FROM_HERE, | 482 plugin_service_->main_message_loop()->PostTask(FROM_HERE, |
483 new PluginNotificationTask(NOTIFY_PLUGIN_PROCESS_HOST_DISCONNECTED, | 483 new PluginNotificationTask(NOTIFY_PLUGIN_PROCESS_HOST_DISCONNECTED, |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 | 770 |
771 void PluginProcessHost::OnGetPluginDataDir(std::wstring* retval) { | 771 void PluginProcessHost::OnGetPluginDataDir(std::wstring* retval) { |
772 *retval = plugin_service_->GetChromePluginDataDir(); | 772 *retval = plugin_service_->GetChromePluginDataDir(); |
773 } | 773 } |
774 | 774 |
775 void PluginProcessHost::Shutdown() { | 775 void PluginProcessHost::Shutdown() { |
776 | 776 |
777 Send(new PluginProcessMsg_BrowserShutdown); | 777 Send(new PluginProcessMsg_BrowserShutdown); |
778 } | 778 } |
779 | 779 |
OLD | NEW |