1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/observer_list_threadsafe.h"
6 #include "base/compiler_specific.h"
7 #include "third_party/abseil-cpp/absl/base/attributes.h"
12 ABSL_CONST_INIT thread_local const ObserverListThreadSafeBase::
13 NotificationDataBase* current_notification = nullptr;
16 const ObserverListThreadSafeBase::NotificationDataBase*&
17 ObserverListThreadSafeBase::GetCurrentNotification() {
18 // Workaround false-positive MSAN use-of-uninitialized-value on
19 // thread_local storage for loaded libraries:
20 // https://github.com/google/sanitizers/issues/1265
22 ¤t_notification,
23 sizeof(const ObserverListThreadSafeBase::NotificationDataBase*));
25 return current_notification;
28 } // namespace internal