| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/message.h" | 5 #include "mojo/public/cpp/bindings/message.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 | 10 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 #include <utility> | 12 #include <utility> |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/threading/thread_local.h" | 18 #include "base/threading/thread_local.h" |
| 19 #include "mojo/public/cpp/bindings/associated_group_controller.h" | 19 #include "mojo/public/cpp/bindings/associated_group_controller.h" |
| 20 #include "mojo/public/cpp/bindings/lib/array_internal.h" | 20 #include "mojo/public/cpp/bindings/lib/array_internal.h" |
| 21 | 21 |
| 22 namespace mojo { | 22 namespace mojo { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 base::LazyInstance<base::ThreadLocalPointer<internal::MessageDispatchContext>> | 26 base::LazyInstance<base::ThreadLocalPointer<internal::MessageDispatchContext>>:: |
| 27 g_tls_message_dispatch_context = LAZY_INSTANCE_INITIALIZER; | 27 DestructorAtExit g_tls_message_dispatch_context = LAZY_INSTANCE_INITIALIZER; |
| 28 | 28 |
| 29 base::LazyInstance<base::ThreadLocalPointer<SyncMessageResponseContext>> | 29 base::LazyInstance<base::ThreadLocalPointer<SyncMessageResponseContext>>:: |
| 30 g_tls_sync_response_context = LAZY_INSTANCE_INITIALIZER; | 30 DestructorAtExit g_tls_sync_response_context = LAZY_INSTANCE_INITIALIZER; |
| 31 | 31 |
| 32 void DoNotifyBadMessage(Message message, const std::string& error) { | 32 void DoNotifyBadMessage(Message message, const std::string& error) { |
| 33 message.NotifyBadMessage(error); | 33 message.NotifyBadMessage(error); |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 Message::Message() { | 38 Message::Message() { |
| 39 } | 39 } |
| 40 | 40 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // static | 323 // static |
| 324 void SyncMessageResponseSetup::SetCurrentSyncResponseMessage(Message* message) { | 324 void SyncMessageResponseSetup::SetCurrentSyncResponseMessage(Message* message) { |
| 325 SyncMessageResponseContext* context = SyncMessageResponseContext::current(); | 325 SyncMessageResponseContext* context = SyncMessageResponseContext::current(); |
| 326 if (context) | 326 if (context) |
| 327 context->response_ = std::move(*message); | 327 context->response_ = std::move(*message); |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace internal | 330 } // namespace internal |
| 331 | 331 |
| 332 } // namespace mojo | 332 } // namespace mojo |
| OLD | NEW |