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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1900513003: Try to diagnose blink reinitialisation in WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow InProcessRendererThread to die if BrowserMainLoop is dying, to avoid breaking tests Created 4 years, 7 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
« no previous file with comments | « no previous file | content/renderer/in_process_renderer_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 // In absence of valid switches use the automatic defaults. 394 // In absence of valid switches use the automatic defaults.
395 return new base::win::MemoryPressureMonitor(); 395 return new base::win::MemoryPressureMonitor();
396 } 396 }
397 #endif // defined(OS_WIN) 397 #endif // defined(OS_WIN)
398 398
399 } // namespace 399 } // namespace
400 400
401 // The currently-running BrowserMainLoop. There can be one or zero. 401 // The currently-running BrowserMainLoop. There can be one or zero.
402 BrowserMainLoop* g_current_browser_main_loop = NULL; 402 BrowserMainLoop* g_current_browser_main_loop = NULL;
403 403
404 #if defined(OS_ANDROID)
405 bool g_browser_main_loop_shutting_down = false;
406 #endif
407
404 // For measuring memory usage after each task. Behind a command line flag. 408 // For measuring memory usage after each task. Behind a command line flag.
405 class BrowserMainLoop::MemoryObserver : public base::MessageLoop::TaskObserver { 409 class BrowserMainLoop::MemoryObserver : public base::MessageLoop::TaskObserver {
406 public: 410 public:
407 MemoryObserver() {} 411 MemoryObserver() {}
408 ~MemoryObserver() override {} 412 ~MemoryObserver() override {}
409 413
410 void WillProcessTask(const base::PendingTask& pending_task) override {} 414 void WillProcessTask(const base::PendingTask& pending_task) override {}
411 415
412 void DidProcessTask(const base::PendingTask& pending_task) override { 416 void DidProcessTask(const base::PendingTask& pending_task) override {
413 std::unique_ptr<base::ProcessMetrics> process_metrics( 417 std::unique_ptr<base::ProcessMetrics> process_metrics(
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp"); 985 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp");
982 986
983 // Teardown may start in PostMainMessageLoopRun, and during teardown we 987 // Teardown may start in PostMainMessageLoopRun, and during teardown we
984 // need to be able to perform IO. 988 // need to be able to perform IO.
985 base::ThreadRestrictions::SetIOAllowed(true); 989 base::ThreadRestrictions::SetIOAllowed(true);
986 BrowserThread::PostTask( 990 BrowserThread::PostTask(
987 BrowserThread::IO, FROM_HERE, 991 BrowserThread::IO, FROM_HERE,
988 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), 992 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed),
989 true)); 993 true));
990 994
995 #if defined(OS_ANDROID)
996 g_browser_main_loop_shutting_down = true;
997 #endif
998
991 if (RenderProcessHost::run_renderer_in_process()) 999 if (RenderProcessHost::run_renderer_in_process())
992 RenderProcessHostImpl::ShutDownInProcessRenderer(); 1000 RenderProcessHostImpl::ShutDownInProcessRenderer();
993 1001
994 if (parts_) { 1002 if (parts_) {
995 TRACE_EVENT0("shutdown", 1003 TRACE_EVENT0("shutdown",
996 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); 1004 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun");
997 parts_->PostMainMessageLoopRun(); 1005 parts_->PostMainMessageLoopRun();
998 } 1006 }
999 1007
1000 if (IsRunningInMojoShell()) 1008 if (IsRunningInMojoShell())
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 std::move(worker_task_runner), 1540 std::move(worker_task_runner),
1533 MediaInternals::GetInstance()); 1541 MediaInternals::GetInstance());
1534 } 1542 }
1535 CHECK(audio_manager_); 1543 CHECK(audio_manager_);
1536 1544
1537 if (use_hang_monitor) 1545 if (use_hang_monitor)
1538 media::AudioManager::StartHangMonitor(io_thread_->task_runner()); 1546 media::AudioManager::StartHangMonitor(io_thread_->task_runner());
1539 } 1547 }
1540 1548
1541 } // namespace content 1549 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/in_process_renderer_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698