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

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

Issue 9375017: Support sharing of ContentMain and BrowserMain code with embedded use cases (try #3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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/app/chrome_main.cc ('k') | chrome/browser/chrome_browser_main.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/app/chrome_main_delegate.h" 5 #include "chrome/app/chrome_main_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 11 matching lines...) Expand all
22 #include "chrome/common/chrome_paths.h" 22 #include "chrome/common/chrome_paths.h"
23 #include "chrome/common/chrome_paths_internal.h" 23 #include "chrome/common/chrome_paths_internal.h"
24 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
25 #include "chrome/common/chrome_version_info.h" 25 #include "chrome/common/chrome_version_info.h"
26 #include "chrome/common/logging_chrome.h" 26 #include "chrome/common/logging_chrome.h"
27 #include "chrome/common/profiling.h" 27 #include "chrome/common/profiling.h"
28 #include "chrome/common/url_constants.h" 28 #include "chrome/common/url_constants.h"
29 #include "chrome/plugin/chrome_content_plugin_client.h" 29 #include "chrome/plugin/chrome_content_plugin_client.h"
30 #include "chrome/renderer/chrome_content_renderer_client.h" 30 #include "chrome/renderer/chrome_content_renderer_client.h"
31 #include "chrome/utility/chrome_content_utility_client.h" 31 #include "chrome/utility/chrome_content_utility_client.h"
32 #include "content/app/content_main.h"
33 #include "content/common/content_counters.h" 32 #include "content/common/content_counters.h"
34 #include "content/public/app/content_main_delegate.h"
35 #include "content/public/browser/render_process_host.h" 33 #include "content/public/browser/render_process_host.h"
36 #include "content/public/common/content_client.h" 34 #include "content/public/common/content_client.h"
37 #include "content/public/common/content_paths.h" 35 #include "content/public/common/content_paths.h"
38 #include "content/public/common/content_switches.h" 36 #include "content/public/common/content_switches.h"
39 #include "media/base/media.h" 37 #include "media/base/media.h"
40 #include "ui/base/resource/resource_bundle.h" 38 #include "ui/base/resource/resource_bundle.h"
41 #include "ui/base/ui_base_switches.h" 39 #include "ui/base/ui_base_switches.h"
42 40
43 #if defined(OS_WIN) 41 #if defined(OS_WIN)
44 #include <algorithm> 42 #include <algorithm>
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 #if !defined(DISABLE_NACL) 690 #if !defined(DISABLE_NACL)
693 { switches::kNaClLoaderProcess, NaClMain }, 691 { switches::kNaClLoaderProcess, NaClMain },
694 #endif // DISABLE_NACL 692 #endif // DISABLE_NACL
695 }; 693 };
696 694
697 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { 695 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) {
698 if (process_type == kMainFunctions[i].name) 696 if (process_type == kMainFunctions[i].name)
699 return kMainFunctions[i].function(main_function_params); 697 return kMainFunctions[i].function(main_function_params);
700 } 698 }
701 699
702 NOTREACHED() << "Unknown process type: " << process_type; 700 return -1;
703 return 1;
704 } 701 }
705 702
706 void ChromeMainDelegate::ProcessExiting(const std::string& process_type) { 703 void ChromeMainDelegate::ProcessExiting(const std::string& process_type) {
707 if (SubprocessNeedsResourceBundle(process_type)) 704 if (SubprocessNeedsResourceBundle(process_type))
708 ResourceBundle::CleanupSharedInstance(); 705 ResourceBundle::CleanupSharedInstance();
709 706
710 logging::CleanupChromeLogging(); 707 logging::CleanupChromeLogging();
711 } 708 }
712 709
713 #if defined(OS_MACOSX) 710 #if defined(OS_MACOSX)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 753
757 #if defined(USE_LINUX_BREAKPAD) 754 #if defined(USE_LINUX_BREAKPAD)
758 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets 755 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets
759 // this up for the browser process in a different manner. 756 // this up for the browser process in a different manner.
760 InitCrashReporter(); 757 InitCrashReporter();
761 #endif 758 #endif
762 759
763 InitializeChromeContentClient(process_type); 760 InitializeChromeContentClient(process_type);
764 } 761 }
765 #endif // OS_MACOSX 762 #endif // OS_MACOSX
OLDNEW
« no previous file with comments | « chrome/app/chrome_main.cc ('k') | chrome/browser/chrome_browser_main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698