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

Unified Diff: content/app/content_main_runner.cc

Issue 9348087: Do not call ContentMainDelegate::ProcessExiting if BasicStartupComplete return true. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
===================================================================
--- content/app/content_main_runner.cc (revision 121456)
+++ content/app/content_main_runner.cc (working copy)
@@ -291,7 +291,8 @@
public:
ContentMainRunnerImpl()
: is_initialized_(false),
- is_shutdown_(false) {
+ is_shutdown_(false),
+ completed_basic_startup_(false) {
}
~ContentMainRunnerImpl() {
@@ -371,6 +372,8 @@
if (delegate && delegate->BasicStartupComplete(&exit_code))
return exit_code;
+ completed_basic_startup_ = true;
+
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
@@ -500,12 +503,14 @@
virtual void Shutdown() OVERRIDE {
DCHECK(is_initialized_);
DCHECK(!is_shutdown_);
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- std::string process_type =
+
+ if (completed_basic_startup_ && delegate_) {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
- if (delegate_)
delegate_->ProcessExiting(process_type);
+ }
#if defined(OS_WIN)
#ifdef _CRTDBG_MAP_ALLOC
@@ -532,6 +537,9 @@
// True if the runner has been shut down.
bool is_shutdown_;
+ // True if basic startup was completed.
+ bool completed_basic_startup_;
+
// The delegate will outlive this object.
content::ContentMainDelegate* delegate_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698