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

Side by Side Diff: chromecast/browser/cast_browser_main_parts.cc

Issue 2311363002: Remove calls to deprecated MessageLoop methods in chromecast. (Closed)
Patch Set: self-review Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/browser/cast_browser_main_parts.h" 5 #include "chromecast/browser/cast_browser_main_parts.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ptr_util.h" 15 #include "base/memory/ptr_util.h"
16 #include "base/message_loop/message_loop.h" 16 #include "base/message_loop/message_loop.h"
17 #include "base/path_service.h" 17 #include "base/path_service.h"
18 #include "base/run_loop.h" 18 #include "base/run_loop.h"
19 #include "base/single_thread_task_runner.h"
19 #include "base/threading/thread.h" 20 #include "base/threading/thread.h"
20 #include "base/threading/thread_task_runner_handle.h" 21 #include "base/threading/thread_task_runner_handle.h"
21 #include "build/build_config.h" 22 #include "build/build_config.h"
22 #include "cc/base/switches.h" 23 #include "cc/base/switches.h"
23 #include "chromecast/base/cast_constants.h" 24 #include "chromecast/base/cast_constants.h"
24 #include "chromecast/base/cast_paths.h" 25 #include "chromecast/base/cast_paths.h"
25 #include "chromecast/base/cast_sys_info_util.h" 26 #include "chromecast/base/cast_sys_info_util.h"
26 #include "chromecast/base/chromecast_switches.h" 27 #include "chromecast/base/chromecast_switches.h"
27 #include "chromecast/base/metrics/cast_metrics_helper.h" 28 #include "chromecast/base/metrics/cast_metrics_helper.h"
28 #include "chromecast/base/metrics/grouped_histogram.h" 29 #include "chromecast/base/metrics/grouped_histogram.h"
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 NOTREACHED(); 500 NOTREACHED();
500 return true; 501 return true;
501 #else 502 #else
502 base::RunLoop run_loop; 503 base::RunLoop run_loop;
503 base::Closure quit_closure(run_loop.QuitClosure()); 504 base::Closure quit_closure(run_loop.QuitClosure());
504 RegisterClosureOnSignal(quit_closure); 505 RegisterClosureOnSignal(quit_closure);
505 506
506 // If parameters_.ui_task is not NULL, we are running browser tests. 507 // If parameters_.ui_task is not NULL, we are running browser tests.
507 if (parameters_.ui_task) { 508 if (parameters_.ui_task) {
508 base::MessageLoop* message_loop = base::MessageLoopForUI::current(); 509 base::MessageLoop* message_loop = base::MessageLoopForUI::current();
509 message_loop->PostTask(FROM_HERE, *parameters_.ui_task); 510 message_loop->task_runner()->PostTask(FROM_HERE, *parameters_.ui_task);
510 message_loop->PostTask(FROM_HERE, quit_closure); 511 message_loop->task_runner()->PostTask(FROM_HERE, quit_closure);
511 } 512 }
512 513
513 run_loop.Run(); 514 run_loop.Run();
514 515
515 // Once the main loop has stopped running, we give the browser process a few 516 // Once the main loop has stopped running, we give the browser process a few
516 // seconds to stop cast service and finalize all resources. If a hang occurs 517 // seconds to stop cast service and finalize all resources. If a hang occurs
517 // and cast services refuse to terminate successfully, then we SIGKILL the 518 // and cast services refuse to terminate successfully, then we SIGKILL the
518 // current process to avoid indefinte hangs. 519 // current process to avoid indefinte hangs.
519 RegisterKillOnAlarm(kKillOnAlarmTimeoutSec); 520 RegisterKillOnAlarm(kKillOnAlarmTimeoutSec);
520 521
(...skipping 17 matching lines...) Expand all
538 539
539 void CastBrowserMainParts::PostDestroyThreads() { 540 void CastBrowserMainParts::PostDestroyThreads() {
540 #if !defined(OS_ANDROID) 541 #if !defined(OS_ANDROID)
541 media_resource_tracker_->FinalizeAndDestroy(); 542 media_resource_tracker_->FinalizeAndDestroy();
542 media_resource_tracker_ = nullptr; 543 media_resource_tracker_ = nullptr;
543 #endif 544 #endif
544 } 545 }
545 546
546 } // namespace shell 547 } // namespace shell
547 } // namespace chromecast 548 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/base/bind_to_task_runner_unittest.cc ('k') | chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698