OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/router.h" | 5 #include "mojo/public/cpp/bindings/lib/router.h" |
6 | 6 |
7 #include "mojo/public/cpp/environment/logging.h" | 7 #include "mojo/public/cpp/environment/logging.h" |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 namespace internal { | 10 namespace internal { |
11 | 11 |
12 // ---------------------------------------------------------------------------- | 12 // ---------------------------------------------------------------------------- |
13 | 13 |
14 class ResponderThunk : public MessageReceiver { | 14 class ResponderThunk : public MessageReceiver { |
15 public: | 15 public: |
16 explicit ResponderThunk(const SharedData<Router*>& router) | 16 explicit ResponderThunk(const SharedData<Router*>& router) |
17 : router_(router) {} | 17 : router_(router) {} |
18 virtual ~ResponderThunk() {} | 18 ~ResponderThunk() override {} |
19 | 19 |
20 // MessageReceiver implementation: | 20 // MessageReceiver implementation: |
21 virtual bool Accept(Message* message) override { | 21 bool Accept(Message* message) override { |
22 MOJO_DCHECK(message->has_flag(kMessageIsResponse)); | 22 MOJO_DCHECK(message->has_flag(kMessageIsResponse)); |
23 | 23 |
24 bool result = false; | 24 bool result = false; |
25 | 25 |
26 Router* router = router_.value(); | 26 Router* router = router_.value(); |
27 if (router) | 27 if (router) |
28 result = router->Accept(message); | 28 result = router->Accept(message); |
29 | 29 |
30 return result; | 30 return result; |
31 } | 31 } |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // OK to drop message on the floor. | 131 // OK to drop message on the floor. |
132 } | 132 } |
133 | 133 |
134 return false; | 134 return false; |
135 } | 135 } |
136 | 136 |
137 // ---------------------------------------------------------------------------- | 137 // ---------------------------------------------------------------------------- |
138 | 138 |
139 } // namespace internal | 139 } // namespace internal |
140 } // namespace mojo | 140 } // namespace mojo |
OLD | NEW |