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

Unified Diff: content/common/mojo/embedded_application_runner.cc

Issue 2007383002: Fix invalid DCHECK in EmbeddedApplicationRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mojo/embedded_application_runner.cc
diff --git a/content/common/mojo/embedded_application_runner.cc b/content/common/mojo/embedded_application_runner.cc
index 2bbd45e5f9e19b4cb10210265e36423741bdca99..f8778d684aaaceb68ad73050e633c3224d25e08b 100644
--- a/content/common/mojo/embedded_application_runner.cc
+++ b/content/common/mojo/embedded_application_runner.cc
@@ -29,8 +29,6 @@ class EmbeddedApplicationRunner::Instance
quit_closure_(quit_closure),
quit_task_runner_(base::ThreadTaskRunnerHandle::Get()),
application_task_runner_(info.application_task_runner) {
- application_thread_checker_.DetachFromThread();
-
if (!use_own_thread_ && !application_task_runner_)
application_task_runner_ = base::ThreadTaskRunnerHandle::Get();
}
@@ -63,7 +61,7 @@ class EmbeddedApplicationRunner::Instance
private:
void BindShellClientRequestOnApplicationThread(
shell::mojom::ShellClientRequest request) {
- DCHECK(application_thread_checker_.CalledOnValidThread());
+ DCHECK(application_task_runner_->BelongsToCurrentThread());
if (!shell_client_) {
shell_client_ = factory_callback_.Run(
@@ -88,7 +86,7 @@ class EmbeddedApplicationRunner::Instance
}
void OnShellConnectionLost(shell::ShellConnection* connection) {
- DCHECK(application_thread_checker_.CalledOnValidThread());
+ DCHECK(application_task_runner_->BelongsToCurrentThread());
for (auto it = shell_connections_.begin(); it != shell_connections_.end();
++it) {
@@ -100,7 +98,7 @@ class EmbeddedApplicationRunner::Instance
}
void Quit() {
- DCHECK(application_thread_checker_.CalledOnValidThread());
+ DCHECK(application_task_runner_->BelongsToCurrentThread());
shell_connections_.clear();
shell_client_.reset();
@@ -124,10 +122,6 @@ class EmbeddedApplicationRunner::Instance
// runner's (i.e. our owner's) thread.
base::ThreadChecker runner_thread_checker_;
- // Thread checker used to ensure certain operations happen only on the
- // application task runner's thread.
- base::ThreadChecker application_thread_checker_;
-
// These fields must only be accessed from the runner's thread.
std::unique_ptr<base::Thread> thread_;
scoped_refptr<base::SingleThreadTaskRunner> application_task_runner_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698