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

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

Issue 8745015: Store the "browser autorestarted, last session must be restored" information in a preference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chrome_browser_main_posix.h" 5 #include "chrome/browser/chrome_browser_main_posix.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <limits.h> 8 #include <limits.h>
9 #include <signal.h> 9 #include <signal.h>
10 #include <sys/resource.h> 10 #include <sys/resource.h>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 ShutdownFDClosedError(); 133 ShutdownFDClosedError();
134 break; 134 break;
135 } 135 }
136 bytes_read += ret; 136 bytes_read += ret;
137 } while (bytes_read < sizeof(signal)); 137 } while (bytes_read < sizeof(signal));
138 VLOG(1) << "Handling shutdown for signal " << signal << "."; 138 VLOG(1) << "Handling shutdown for signal " << signal << ".";
139 #if defined(OS_CHROMEOS) 139 #if defined(OS_CHROMEOS)
140 // On ChromeOS, exiting on signal should be always clean. 140 // On ChromeOS, exiting on signal should be always clean.
141 base::Closure task = base::Bind(&BrowserList::ExitCleanly); 141 base::Closure task = base::Bind(&BrowserList::ExitCleanly);
142 #else 142 #else
143 base::Closure task = base::Bind(&BrowserList::AttemptExit); 143 base::Closure task = base::Bind(&BrowserList::AttemptExit, false);
144 #endif 144 #endif
145 145
146 if (!BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, task)) { 146 if (!BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, task)) {
147 // Without a UI thread to post the exit task to, there aren't many 147 // Without a UI thread to post the exit task to, there aren't many
148 // options. Raise the signal again. The default handler will pick it up 148 // options. Raise the signal again. The default handler will pick it up
149 // and cause an ungraceful exit. 149 // and cause an ungraceful exit.
150 RAW_LOG(WARNING, "No UI thread, exiting ungracefully."); 150 RAW_LOG(WARNING, "No UI thread, exiting ungracefully.");
151 kill(getpid(), signal); 151 kill(getpid(), signal);
152 152
153 // The signal may be handled on another thread. Give that a chance to 153 // The signal may be handled on another thread. Give that a chance to
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // And SIGHUP, for when the terminal disappears. On shutdown, many Linux 260 // And SIGHUP, for when the terminal disappears. On shutdown, many Linux
261 // distros send SIGHUP, SIGTERM, and then SIGKILL. 261 // distros send SIGHUP, SIGTERM, and then SIGKILL.
262 action.sa_handler = SIGHUPHandler; 262 action.sa_handler = SIGHUPHandler;
263 CHECK(sigaction(SIGHUP, &action, NULL) == 0); 263 CHECK(sigaction(SIGHUP, &action, NULL) == 0);
264 264
265 #if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) 265 #if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS)
266 printing::PrintingContextGtk::SetCreatePrintDialogFunction( 266 printing::PrintingContextGtk::SetCreatePrintDialogFunction(
267 &PrintDialogGtk::CreatePrintDialog); 267 &PrintDialogGtk::CreatePrintDialog);
268 #endif 268 #endif
269 } 269 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698