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

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

Issue 2363503002: Mojo C++ bindings: Add a SINGLE_INTERFACE_WITH_SYNC_REQUESTS mode for MultiplexRouter. (Closed)
Patch Set: .. 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/multiplex_router.cc ('k') | no next file » | 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/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"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 CHECK_EQ(MOJO_RESULT_OK, result); 100 CHECK_EQ(MOJO_RESULT_OK, result);
101 wait_set_handle_.reset(Handle(handle)); 101 wait_set_handle_.reset(Handle(handle));
102 CHECK(wait_set_handle_.is_valid()); 102 CHECK(wait_set_handle_.is_valid());
103 103
104 DCHECK(!g_current_sync_handle_watcher.Pointer()->Get()); 104 DCHECK(!g_current_sync_handle_watcher.Pointer()->Get());
105 g_current_sync_handle_watcher.Pointer()->Set(this); 105 g_current_sync_handle_watcher.Pointer()->Set(this);
106 } 106 }
107 107
108 SyncHandleRegistry::~SyncHandleRegistry() { 108 SyncHandleRegistry::~SyncHandleRegistry() {
109 DCHECK(thread_checker_.CalledOnValidThread()); 109 DCHECK(thread_checker_.CalledOnValidThread());
110
111 // If this breaks, it is likely that the global variable is bulit into and
112 // accessed from multiple modules.
113 CHECK_EQ(this, g_current_sync_handle_watcher.Pointer()->Get());
114
110 g_current_sync_handle_watcher.Pointer()->Set(nullptr); 115 g_current_sync_handle_watcher.Pointer()->Set(nullptr);
111 } 116 }
112 117
113 } // namespace mojo 118 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/multiplex_router.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698