Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/plugin/plugin_main.cc

Issue 371015: Linux: Catch plugin crashes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include "app/win_util.h" 8 #include "app/win_util.h"
9 #endif 9 #endif
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 10 matching lines...) Expand all
21 #if defined(OS_WIN) 21 #if defined(OS_WIN)
22 #include "chrome/test/injection_test_dll.h" 22 #include "chrome/test/injection_test_dll.h"
23 #include "sandbox/src/sandbox.h" 23 #include "sandbox/src/sandbox.h"
24 #elif defined(OS_LINUX) 24 #elif defined(OS_LINUX)
25 #include "base/global_descriptors_posix.h" 25 #include "base/global_descriptors_posix.h"
26 #include "ipc/ipc_descriptors.h" 26 #include "ipc/ipc_descriptors.h"
27 #elif defined(OS_MACOSX) 27 #elif defined(OS_MACOSX)
28 #include "chrome/common/plugin_carbon_interpose_constants_mac.h" 28 #include "chrome/common/plugin_carbon_interpose_constants_mac.h"
29 #endif 29 #endif
30 30
31 #if defined(USE_LINUX_BREAKPAD)
32 #include "chrome/app/breakpad_linux.h"
33 #endif
34
31 #if defined(OS_MACOSX) 35 #if defined(OS_MACOSX)
32 // Removes our Carbon library interposing from the environment so that it 36 // Removes our Carbon library interposing from the environment so that it
33 // doesn't carry into any processes that plugins might start. 37 // doesn't carry into any processes that plugins might start.
34 static void TrimInterposeEnvironment() { 38 static void TrimInterposeEnvironment() {
35 const char* interpose_list = 39 const char* interpose_list =
36 getenv(plugin_interpose_strings::kDYLDInsertLibrariesKey); 40 getenv(plugin_interpose_strings::kDYLDInsertLibrariesKey);
37 if (!interpose_list) { 41 if (!interpose_list) {
38 NOTREACHED() << "No interposing libraries set"; 42 NOTREACHED() << "No interposing libraries set";
39 return; 43 return;
40 } 44 }
(...skipping 17 matching lines...) Expand all
58 setenv(plugin_interpose_strings::kDYLDInsertLibrariesKey, 62 setenv(plugin_interpose_strings::kDYLDInsertLibrariesKey,
59 trimmed_list.c_str(), 1); 63 trimmed_list.c_str(), 1);
60 } else { 64 } else {
61 NOTREACHED() << "Missing Carbon interposing library"; 65 NOTREACHED() << "Missing Carbon interposing library";
62 } 66 }
63 } 67 }
64 #endif // OS_MACOSX 68 #endif // OS_MACOSX
65 69
66 // main() routine for running as the plugin process. 70 // main() routine for running as the plugin process.
67 int PluginMain(const MainFunctionParams& parameters) { 71 int PluginMain(const MainFunctionParams& parameters) {
72 #if defined(USE_LINUX_BREAKPAD)
73 // Needs to be called after we have chrome::DIR_USER_DATA.
74 InitCrashReporter();
75 #endif
76
68 // The main thread of the plugin services UI. 77 // The main thread of the plugin services UI.
69 #if defined(OS_MACOSX) 78 #if defined(OS_MACOSX)
70 // For Mac NPAPI plugins, we don't want a MessageLoop::TYPE_UI because 79 // For Mac NPAPI plugins, we don't want a MessageLoop::TYPE_UI because
71 // that will cause events to be dispatched via the Cocoa responder chain. 80 // that will cause events to be dispatched via the Cocoa responder chain.
72 // If the plugin creates its own windows with Carbon APIs (for example, 81 // If the plugin creates its own windows with Carbon APIs (for example,
73 // full screen mode in Flash), those windows would not receive events. 82 // full screen mode in Flash), those windows would not receive events.
74 // Instead, WebPluginDelegateImpl::OnNullEvent will dispatch any pending 83 // Instead, WebPluginDelegateImpl::OnNullEvent will dispatch any pending
75 // system events directly to the plugin. 84 // system events directly to the plugin.
76 MessageLoop main_message_loop(MessageLoop::TYPE_DEFAULT); 85 MessageLoop main_message_loop(MessageLoop::TYPE_DEFAULT);
77 #else 86 #else
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 151
143 MessageLoop::current()->Run(); 152 MessageLoop::current()->Run();
144 } 153 }
145 154
146 #if defined(OS_WIN) 155 #if defined(OS_WIN)
147 CoUninitialize(); 156 CoUninitialize();
148 #endif 157 #endif
149 158
150 return 0; 159 return 0;
151 } 160 }
OLDNEW
« chrome/browser/crash_handler_host_linux.h ('K') | « chrome/plugin/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698