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

Side by Side Diff: mojo/public/cpp/bindings/lib/sync_handle_registry.cc

Issue 2033243003: Use Mojo pipes to signal sync IPC events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gyp Created 4 years, 6 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 | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/sync_handle_watcher.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "mojo/public/cpp/bindings/lib/sync_handle_registry.h" 5 #include "mojo/public/cpp/bindings/sync_handle_registry.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
11 #include "mojo/public/c/system/core.h" 11 #include "mojo/public/c/system/core.h"
12 12
13 namespace mojo { 13 namespace mojo {
14 namespace internal {
15 namespace { 14 namespace {
16 15
17 base::LazyInstance<base::ThreadLocalPointer<SyncHandleRegistry>> 16 base::LazyInstance<base::ThreadLocalPointer<SyncHandleRegistry>>
18 g_current_sync_handle_watcher = LAZY_INSTANCE_INITIALIZER; 17 g_current_sync_handle_watcher = LAZY_INSTANCE_INITIALIZER;
19 18
20 } // namespace 19 } // namespace
21 20
22 // static 21 // static
23 scoped_refptr<SyncHandleRegistry> SyncHandleRegistry::current() { 22 scoped_refptr<SyncHandleRegistry> SyncHandleRegistry::current() {
24 scoped_refptr<SyncHandleRegistry> result( 23 scoped_refptr<SyncHandleRegistry> result(
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 103
105 DCHECK(!g_current_sync_handle_watcher.Pointer()->Get()); 104 DCHECK(!g_current_sync_handle_watcher.Pointer()->Get());
106 g_current_sync_handle_watcher.Pointer()->Set(this); 105 g_current_sync_handle_watcher.Pointer()->Set(this);
107 } 106 }
108 107
109 SyncHandleRegistry::~SyncHandleRegistry() { 108 SyncHandleRegistry::~SyncHandleRegistry() {
110 DCHECK(thread_checker_.CalledOnValidThread()); 109 DCHECK(thread_checker_.CalledOnValidThread());
111 g_current_sync_handle_watcher.Pointer()->Set(nullptr); 110 g_current_sync_handle_watcher.Pointer()->Set(nullptr);
112 } 111 }
113 112
114 } // namespace internal
115 } // namespace mojo 113 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/lib/sync_handle_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698