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

Side by Side Diff: chrome/browser/chromeos/login/chrome_restart_request.cc

Issue 1036723003: favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/login/chrome_restart_request.h" 5 #include "chrome/browser/chromeos/login/chrome_restart_request.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 JsonPrefStore::GetTaskRunnerForFile( 319 JsonPrefStore::GetTaskRunnerForFile(
320 base::FilePath(chrome::kLocalStorePoolName), 320 base::FilePath(chrome::kLocalStorePoolName),
321 BrowserThread::GetBlockingPool()); 321 BrowserThread::GetBlockingPool());
322 local_state_task_runner->PostTaskAndReply( 322 local_state_task_runner->PostTaskAndReply(
323 FROM_HERE, 323 FROM_HERE,
324 base::Bind(&EnsureLocalStateIsWritten), 324 base::Bind(&EnsureLocalStateIsWritten),
325 base::Bind(&ChromeRestartRequest::RestartJob, AsWeakPtr())); 325 base::Bind(&ChromeRestartRequest::RestartJob, AsWeakPtr()));
326 } 326 }
327 327
328 void ChromeRestartRequest::RestartJob() { 328 void ChromeRestartRequest::RestartJob() {
329 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 329 DCHECK_CURRENTLY_ON(BrowserThread::UI);
330 330
331 DBusThreadManager::Get()->GetSessionManagerClient()->RestartJob( 331 DBusThreadManager::Get()->GetSessionManagerClient()->RestartJob(
332 pid_, command_line_); 332 pid_, command_line_);
333 333
334 delete this; 334 delete this;
335 } 335 }
336 336
337 } // namespace 337 } // namespace
338 338
339 std::string GetOffTheRecordCommandLine( 339 std::string GetOffTheRecordCommandLine(
(...skipping 17 matching lines...) Expand all
357 if (!is_oobe_completed) 357 if (!is_oobe_completed)
358 otr_switches.SetString(switches::kOobeGuestSession, std::string()); 358 otr_switches.SetString(switches::kOobeGuestSession, std::string());
359 359
360 return DeriveCommandLine(start_url, 360 return DeriveCommandLine(start_url,
361 base_command_line, 361 base_command_line,
362 otr_switches, 362 otr_switches,
363 command_line); 363 command_line);
364 } 364 }
365 365
366 void RestartChrome(const std::string& command_line) { 366 void RestartChrome(const std::string& command_line) {
367 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 367 DCHECK_CURRENTLY_ON(BrowserThread::UI);
368 BootTimesRecorder::Get()->set_restart_requested(); 368 BootTimesRecorder::Get()->set_restart_requested();
369 369
370 static bool restart_requested = false; 370 static bool restart_requested = false;
371 if (restart_requested) { 371 if (restart_requested) {
372 NOTREACHED() << "Request chrome restart for more than once."; 372 NOTREACHED() << "Request chrome restart for more than once.";
373 } 373 }
374 restart_requested = true; 374 restart_requested = true;
375 375
376 if (!base::SysInfo::IsRunningOnChromeOS()) { 376 if (!base::SysInfo::IsRunningOnChromeOS()) {
377 // Relaunch chrome without session manager on dev box. 377 // Relaunch chrome without session manager on dev box.
378 ReLaunch(command_line); 378 ReLaunch(command_line);
379 return; 379 return;
380 } 380 }
381 381
382 // ChromeRestartRequest deletes itself after request sent to session manager. 382 // ChromeRestartRequest deletes itself after request sent to session manager.
383 (new ChromeRestartRequest(command_line))->Start(); 383 (new ChromeRestartRequest(command_line))->Start();
384 } 384 }
385 385
386 } // namespace chromeos 386 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/fileapi/external_file_url_request_job.cc ('k') | chrome/browser/chromeos/login/help_app_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698