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 // TODO(port): the ifdefs in here are a first step towards trying to determine | 5 // TODO(port): the ifdefs in here are a first step towards trying to determine |
6 // the correct abstraction for all the OS functionality required at this | 6 // the correct abstraction for all the OS functionality required at this |
7 // stage of process initialization. It should not be taken as a final | 7 // stage of process initialization. It should not be taken as a final |
8 // abstraction. | 8 // abstraction. |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "base/debug_util.h" | 25 #include "base/debug_util.h" |
26 #include "base/icu_util.h" | 26 #include "base/icu_util.h" |
27 #include "base/message_loop.h" | 27 #include "base/message_loop.h" |
28 #include "base/path_service.h" | 28 #include "base/path_service.h" |
29 #include "base/process_util.h" | 29 #include "base/process_util.h" |
30 #include "base/scoped_nsautorelease_pool.h" | 30 #include "base/scoped_nsautorelease_pool.h" |
31 #include "base/stats_table.h" | 31 #include "base/stats_table.h" |
32 #include "base/string_util.h" | 32 #include "base/string_util.h" |
33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
34 #include "base/win_util.h" | 34 #include "base/win_util.h" |
35 #include "chrome/browser/renderer_host/render_process_host.h" | |
36 #endif | 35 #endif |
37 #include "chrome/app/scoped_ole_initializer.h" | 36 #include "chrome/app/scoped_ole_initializer.h" |
| 37 #include "chrome/browser/renderer_host/render_process_host.h" |
38 #include "chrome/common/chrome_constants.h" | 38 #include "chrome/common/chrome_constants.h" |
39 #include "chrome/common/chrome_counters.h" | 39 #include "chrome/common/chrome_counters.h" |
40 #include "chrome/common/chrome_paths.h" | 40 #include "chrome/common/chrome_paths.h" |
41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
42 #include "chrome/common/logging_chrome.h" | 42 #include "chrome/common/logging_chrome.h" |
43 #include "chrome/common/main_function_params.h" | 43 #include "chrome/common/main_function_params.h" |
44 #include "chrome/common/resource_bundle.h" | 44 #include "chrome/common/resource_bundle.h" |
45 #include "chrome/common/sandbox_init_wrapper.h" | 45 #include "chrome/common/sandbox_init_wrapper.h" |
46 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
47 #include "sandbox/src/sandbox.h" | 47 #include "sandbox/src/sandbox.h" |
48 #include "tools/memory_watcher/memory_watcher.h" | 48 #include "tools/memory_watcher/memory_watcher.h" |
49 #endif | 49 #endif |
| 50 #if defined(OS_MACOSX) |
| 51 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" |
| 52 #endif |
50 | 53 |
51 extern int BrowserMain(const MainFunctionParams&); | 54 extern int BrowserMain(const MainFunctionParams&); |
52 extern int RendererMain(const MainFunctionParams&); | 55 extern int RendererMain(const MainFunctionParams&); |
53 extern int PluginMain(const MainFunctionParams&); | 56 extern int PluginMain(const MainFunctionParams&); |
54 | 57 |
55 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
56 // TODO(erikkay): isn't this already defined somewhere? | 59 // TODO(erikkay): isn't this already defined somewhere? |
57 #define DLLEXPORT __declspec(dllexport) | 60 #define DLLEXPORT __declspec(dllexport) |
58 | 61 |
59 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. | 62 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 #if defined(OS_WIN) | 274 #if defined(OS_WIN) |
272 _Module.Init(NULL, instance); | 275 _Module.Init(NULL, instance); |
273 #endif | 276 #endif |
274 | 277 |
275 // Notice a user data directory override if any | 278 // Notice a user data directory override if any |
276 const std::wstring user_data_dir = | 279 const std::wstring user_data_dir = |
277 parsed_command_line.GetSwitchValue(switches::kUserDataDir); | 280 parsed_command_line.GetSwitchValue(switches::kUserDataDir); |
278 if (!user_data_dir.empty()) | 281 if (!user_data_dir.empty()) |
279 PathService::Override(chrome::DIR_USER_DATA, user_data_dir); | 282 PathService::Override(chrome::DIR_USER_DATA, user_data_dir); |
280 | 283 |
281 #if defined(OS_WIN) | |
282 // TODO(port): pull in when render_process_host.h compiles on posix. There's | |
283 // nothing win-specific about these lines. | |
284 bool single_process = | 284 bool single_process = |
285 parsed_command_line.HasSwitch(switches::kSingleProcess); | 285 parsed_command_line.HasSwitch(switches::kSingleProcess); |
286 if (single_process) | 286 if (single_process) |
287 RenderProcessHost::set_run_renderer_in_process(true); | 287 RenderProcessHost::set_run_renderer_in_process(true); |
| 288 #if defined(OS_MACOSX) |
| 289 // TODO(port-mac): This is from renderer_main_platform_delegate.cc. |
| 290 // shess tried to refactor things appropriately, but it sprawled out |
| 291 // of control because different platforms needed different styles of |
| 292 // initialization. Try again once we understand the process |
| 293 // architecture needed and where it should live. |
| 294 if (single_process) |
| 295 InitWebCoreSystemInterface(); |
288 #endif | 296 #endif |
289 | 297 |
290 bool icu_result = icu_util::Initialize(); | 298 bool icu_result = icu_util::Initialize(); |
291 CHECK(icu_result); | 299 CHECK(icu_result); |
292 | 300 |
293 logging::OldFileDeletionState file_state = | 301 logging::OldFileDeletionState file_state = |
294 logging::APPEND_TO_OLD_LOG_FILE; | 302 logging::APPEND_TO_OLD_LOG_FILE; |
295 if (process_type.empty()) { | 303 if (process_type.empty()) { |
296 file_state = logging::DELETE_OLD_LOG_FILE; | 304 file_state = logging::DELETE_OLD_LOG_FILE; |
297 } | 305 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 351 |
344 _Module.Term(); | 352 _Module.Term(); |
345 #endif | 353 #endif |
346 | 354 |
347 logging::CleanupChromeLogging(); | 355 logging::CleanupChromeLogging(); |
348 | 356 |
349 return rv; | 357 return rv; |
350 } | 358 } |
351 | 359 |
352 | 360 |
OLD | NEW |