summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 01:48:27 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-06 01:48:27 +0000
commit7f874dec33a8b047c65c1527fd8205e5d4ab63b1 (patch)
tree6428dddebd550c180fb8d4e81ab04531d4137a13 /chrome
parentdeb5740cb62d64c2e0b3746956fef66494fe49de (diff)
downloadchromium_src-7f874dec33a8b047c65c1527fd8205e5d4ab63b1.zip
chromium_src-7f874dec33a8b047c65c1527fd8205e5d4ab63b1.tar.gz
chromium_src-7f874dec33a8b047c65c1527fd8205e5d4ab63b1.tar.bz2
Prevent renderer from crashing on startup.
With pinkerton and jeremy. Review URL: http://codereview.chromium.org/20120 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_dll_main.cc17
-rw-r--r--chrome/renderer/render_thread.cc8
2 files changed, 11 insertions, 14 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index c15f2fc..ebde279 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -4,8 +4,8 @@
// TODO(port): the ifdefs in here are a first step towards trying to determine
// the correct abstraction for all the OS functionality required at this
-// stage of process initialization. It should not be taken as a final
-// abstraction.
+// stage of process initialization. It should not be taken as a final
+// abstraction.
#include "build/build_config.h"
@@ -200,7 +200,7 @@ int ChromeMain(int argc, const char** argv) {
// The exit manager is in charge of calling the dtors of singleton objects.
base::AtExitManager exit_manager;
- // TODO(pinkerton): We need this pool here for all the objects created
+ // TODO(pinkerton): We need this pool here for all the objects created
// before we get to the UI event loop, but we don't want to leave them
// hanging around until the app quits. We should add a "flush" to the class
// which just cycles the pool under the covers and then call that just
@@ -224,7 +224,7 @@ int ChromeMain(int argc, const char** argv) {
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
SetupCRT(parsed_command_line);
-
+
// Initialize the Chrome path provider.
chrome::RegisterPathProvider();
@@ -254,7 +254,7 @@ int ChromeMain(int argc, const char** argv) {
std::wstring process_type =
parsed_command_line.GetSwitchValue(switches::kProcessType);
-
+
// Checks if the sandbox is enabled in this process and initializes it if this
// is the case. The crash handler depends on this so it has to be done before
// its initialization.
@@ -263,7 +263,7 @@ int ChromeMain(int argc, const char** argv) {
sandbox_wrapper.SetServices(sandbox_info);
#endif
sandbox_wrapper.InitializeSandbox(parsed_command_line, process_type);
-
+
#if defined(OS_WIN)
_Module.Init(NULL, instance);
#endif
@@ -308,11 +308,12 @@ int ChromeMain(int argc, const char** argv) {
startup_timer.Stop(); // End of Startup Time Measurement.
MainFunctionParams main_params(parsed_command_line, sandbox_wrapper);
-
+
// TODO(port): turn on these main() functions as they've been de-winified.
int rv = -1;
if (process_type == switches::kRendererProcess) {
-#if defined(OS_WIN)
+ // TODO(port) turn this on and follow the link chain...
+#if !defined(OS_LINUX)
rv = RendererMain(main_params);
#endif
} else if (process_type == switches::kPluginProcess) {
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 434f9e2..d2d293b 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -185,9 +185,7 @@ void RenderThread::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID)
// TODO(port): removed from render_messages_internal.h;
// is there a new non-windows message I should add here?
-#if defined(OS_WIN)
IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView)
-#endif
IPC_MESSAGE_HANDLER(ViewMsg_SetCacheCapacities, OnSetCacheCapacities)
IPC_MESSAGE_HANDLER(ViewMsg_GetCacheResourceStats,
OnGetCacheResourceStats)
@@ -225,12 +223,11 @@ void RenderThread::OnSetNextPageID(int32 next_page_id) {
#endif
}
-#if defined(OS_WIN)
-
void RenderThread::OnCreateNewView(gfx::NativeViewId parent_hwnd,
ModalDialogEvent modal_dialog_event,
const WebPreferences& webkit_prefs,
int32 view_id) {
+#if defined(OS_WIN)
base::WaitableEvent* waitable_event = new base::WaitableEvent(
#if defined(OS_WIN)
modal_dialog_event.event);
@@ -243,9 +240,8 @@ void RenderThread::OnCreateNewView(gfx::NativeViewId parent_hwnd,
RenderView::Create(
this, parent_hwnd, waitable_event, MSG_ROUTING_NONE, webkit_prefs,
new SharedRenderViewCounter(0), view_id);
-}
-
#endif
+}
void RenderThread::OnSetCacheCapacities(size_t min_dead_capacity,
size_t max_dead_capacity,