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

Side by Side Diff: chrome/app/chrome_dll_main.cc

Issue 27157: Initial checkin of the out of process worker implementation.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months 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
« no previous file with comments | « chrome/SConscript ('k') | chrome/browser/browser.scons » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "sandbox/src/sandbox.h" 48 #include "sandbox/src/sandbox.h"
49 #include "tools/memory_watcher/memory_watcher.h" 49 #include "tools/memory_watcher/memory_watcher.h"
50 #endif 50 #endif
51 #if defined(OS_MACOSX) 51 #if defined(OS_MACOSX)
52 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" 52 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h"
53 #endif 53 #endif
54 54
55 extern int BrowserMain(const MainFunctionParams&); 55 extern int BrowserMain(const MainFunctionParams&);
56 extern int RendererMain(const MainFunctionParams&); 56 extern int RendererMain(const MainFunctionParams&);
57 extern int PluginMain(const MainFunctionParams&); 57 extern int PluginMain(const MainFunctionParams&);
58 extern int WorkerMain(const MainFunctionParams&);
58 59
59 #if defined(OS_WIN) 60 #if defined(OS_WIN)
60 // TODO(erikkay): isn't this already defined somewhere? 61 // TODO(erikkay): isn't this already defined somewhere?
61 #define DLLEXPORT __declspec(dllexport) 62 #define DLLEXPORT __declspec(dllexport)
62 63
63 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. 64 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
64 extern "C" { 65 extern "C" {
65 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, 66 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance,
66 sandbox::SandboxInterfaceInfo* sandbox_info, 67 sandbox::SandboxInterfaceInfo* sandbox_info,
67 TCHAR* command_line); 68 TCHAR* command_line);
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 &autorelease_pool); 364 &autorelease_pool);
364 365
365 // TODO(port): turn on these main() functions as they've been de-winified. 366 // TODO(port): turn on these main() functions as they've been de-winified.
366 int rv = -1; 367 int rv = -1;
367 if (process_type == switches::kRendererProcess) { 368 if (process_type == switches::kRendererProcess) {
368 rv = RendererMain(main_params); 369 rv = RendererMain(main_params);
369 } else if (process_type == switches::kPluginProcess) { 370 } else if (process_type == switches::kPluginProcess) {
370 #if defined(OS_WIN) 371 #if defined(OS_WIN)
371 rv = PluginMain(main_params); 372 rv = PluginMain(main_params);
372 #endif 373 #endif
374 } else if (process_type == switches::kWorkerProcess) {
375 #if defined(OS_WIN)
376 rv = WorkerMain(main_params);
377 #endif
373 } else if (process_type.empty()) { 378 } else if (process_type.empty()) {
374 ScopedOleInitializer ole_initializer; 379 ScopedOleInitializer ole_initializer;
375 rv = BrowserMain(main_params); 380 rv = BrowserMain(main_params);
376 } else { 381 } else {
377 NOTREACHED() << "Unknown process type"; 382 NOTREACHED() << "Unknown process type";
378 } 383 }
379 384
380 if (!process_type.empty()) { 385 if (!process_type.empty()) {
381 ResourceBundle::CleanupSharedInstance(); 386 ResourceBundle::CleanupSharedInstance();
382 } 387 }
383 388
384 #if defined(OS_WIN) 389 #if defined(OS_WIN)
385 #ifdef _CRTDBG_MAP_ALLOC 390 #ifdef _CRTDBG_MAP_ALLOC
386 _CrtDumpMemoryLeaks(); 391 _CrtDumpMemoryLeaks();
387 #endif // _CRTDBG_MAP_ALLOC 392 #endif // _CRTDBG_MAP_ALLOC
388 393
389 _Module.Term(); 394 _Module.Term();
390 #endif 395 #endif
391 396
392 logging::CleanupChromeLogging(); 397 logging::CleanupChromeLogging();
393 398
394 return rv; 399 return rv;
395 } 400 }
396 401
397 402
OLDNEW
« no previous file with comments | « chrome/SConscript ('k') | chrome/browser/browser.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698