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

Side by Side Diff: ipc/mojo/scoped_ipc_support.cc

Issue 1714693002: Add more CHECKs to help investigate the Mojo bootstrap crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | mojo/edk/embedder/embedder.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ipc/mojo/scoped_ipc_support.h" 5 #include "ipc/mojo/scoped_ipc_support.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // IO thread. 78 // IO thread.
79 MessageLoopObserver* observer_; 79 MessageLoopObserver* observer_;
80 80
81 scoped_refptr<base::TaskRunner> io_thread_task_runner_; 81 scoped_refptr<base::TaskRunner> io_thread_task_runner_;
82 82
83 DISALLOW_COPY_AND_ASSIGN(IPCSupportInitializer); 83 DISALLOW_COPY_AND_ASSIGN(IPCSupportInitializer);
84 }; 84 };
85 85
86 void IPCSupportInitializer::Init( 86 void IPCSupportInitializer::Init(
87 scoped_refptr<base::TaskRunner> io_thread_task_runner) { 87 scoped_refptr<base::TaskRunner> io_thread_task_runner) {
88 CHECK(io_thread_task_runner);
88 base::AutoLock locker(lock_); 89 base::AutoLock locker(lock_);
89 DCHECK((init_count_ == 0 && !io_thread_task_runner_) || 90 DCHECK((init_count_ == 0 && !io_thread_task_runner_) ||
90 io_thread_task_runner_ == io_thread_task_runner); 91 io_thread_task_runner_ == io_thread_task_runner);
91 92
92 if (shutting_down_) { 93 if (shutting_down_) {
93 // If reinitialized before a pending shutdown task is executed, we 94 // If reinitialized before a pending shutdown task is executed, we
94 // effectively cancel the shutdown task. 95 // effectively cancel the shutdown task.
95 DCHECK(init_count_ == 1); 96 DCHECK(init_count_ == 1);
96 shutting_down_ = false; 97 shutting_down_ = false;
97 return; 98 return;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 ScopedIPCSupport::ScopedIPCSupport( 159 ScopedIPCSupport::ScopedIPCSupport(
159 scoped_refptr<base::TaskRunner> io_thread_task_runner) { 160 scoped_refptr<base::TaskRunner> io_thread_task_runner) {
160 ipc_support_initializer.Get().Init(io_thread_task_runner); 161 ipc_support_initializer.Get().Init(io_thread_task_runner);
161 } 162 }
162 163
163 ScopedIPCSupport::~ScopedIPCSupport() { 164 ScopedIPCSupport::~ScopedIPCSupport() {
164 ipc_support_initializer.Get().ShutDown(false); 165 ipc_support_initializer.Get().ShutDown(false);
165 } 166 }
166 167
167 } // namespace IPC 168 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/embedder/embedder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698