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

Side by Side Diff: chrome/browser/browser_shutdown.cc

Issue 2793443003: Removed NOTIFICATION_BROWSER_CLOSING notification (Closed)
Patch Set: Reset g_shutdown_type on close cancel Created 3 years, 8 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
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/browser/browser_shutdown.h" 5 #include "chrome/browser/browser_shutdown.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 BrowserThread::FILE, FROM_HERE, 345 BrowserThread::FILE, FROM_HERE,
346 base::Bind(&ReadLastShutdownFile, type, num_procs, num_procs_slow)); 346 base::Bind(&ReadLastShutdownFile, type, num_procs, num_procs_slow));
347 } 347 }
348 348
349 void SetTryingToQuit(bool quitting) { 349 void SetTryingToQuit(bool quitting) {
350 g_trying_to_quit = quitting; 350 g_trying_to_quit = quitting;
351 351
352 if (quitting) 352 if (quitting)
353 return; 353 return;
354 354
355 g_shutdown_type = NOT_VALID;
Alexey Seren 2017/04/09 17:51:37 reset shutdown state on browser close cancel
hashimoto 2017/04/14 08:54:37 I'm not sure if it's safe to allow cancelling shut
Alexey Seren 2017/04/22 19:52:54 You are right. It is not safe. This CL https://cod
356
355 // Reset the restart-related preferences. They get set unconditionally through 357 // Reset the restart-related preferences. They get set unconditionally through
356 // calls such as chrome::AttemptRestart(), and need to be reset if the restart 358 // calls such as chrome::AttemptRestart(), and need to be reset if the restart
357 // attempt is cancelled. 359 // attempt is cancelled.
358 PrefService* pref_service = g_browser_process->local_state(); 360 PrefService* pref_service = g_browser_process->local_state();
359 if (pref_service) { 361 if (pref_service) {
360 #if !defined(OS_ANDROID) 362 #if !defined(OS_ANDROID)
361 pref_service->ClearPref(prefs::kWasRestarted); 363 pref_service->ClearPref(prefs::kWasRestarted);
362 #endif // !defined(OS_ANDROID) 364 #endif // !defined(OS_ANDROID)
363 pref_service->ClearPref(prefs::kRestartLastSessionOnShutdown); 365 pref_service->ClearPref(prefs::kRestartLastSessionOnShutdown);
364 } 366 }
(...skipping 14 matching lines...) Expand all
379 base::trace_event::TraceConfig trace_config( 381 base::trace_event::TraceConfig trace_config(
380 command_line.GetSwitchValueASCII(switches::kTraceShutdown), ""); 382 command_line.GetSwitchValueASCII(switches::kTraceShutdown), "");
381 content::TracingController::GetInstance()->StartTracing( 383 content::TracingController::GetInstance()->StartTracing(
382 trace_config, 384 trace_config,
383 content::TracingController::StartTracingDoneCallback()); 385 content::TracingController::StartTracingDoneCallback());
384 } 386 }
385 TRACE_EVENT0("shutdown", "StartShutdownTracing"); 387 TRACE_EVENT0("shutdown", "StartShutdownTracing");
386 } 388 }
387 389
388 } // namespace browser_shutdown 390 } // namespace browser_shutdown
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_shutdown_browsertest.cc » ('j') | chrome/browser/ui/browser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698