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 } | 18 } |
19 virtual ~ResponderThunk() { | 19 virtual ~ResponderThunk() { |
20 } | 20 } |
21 | 21 |
22 // MessageReceiver implementation: | 22 // MessageReceiver implementation: |
23 virtual bool Accept(Message* message) MOJO_OVERRIDE { | 23 virtual bool Accept(Message* message) override { |
24 MOJO_DCHECK(message->has_flag(kMessageIsResponse)); | 24 MOJO_DCHECK(message->has_flag(kMessageIsResponse)); |
25 | 25 |
26 bool result = false; | 26 bool result = false; |
27 | 27 |
28 Router* router = router_.value(); | 28 Router* router = router_.value(); |
29 if (router) | 29 if (router) |
30 result = router->Accept(message); | 30 result = router->Accept(message); |
31 | 31 |
32 return result; | 32 return result; |
33 } | 33 } |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // OK to drop message on the floor. | 133 // OK to drop message on the floor. |
134 } | 134 } |
135 | 135 |
136 return false; | 136 return false; |
137 } | 137 } |
138 | 138 |
139 // ---------------------------------------------------------------------------- | 139 // ---------------------------------------------------------------------------- |
140 | 140 |
141 } // namespace internal | 141 } // namespace internal |
142 } // namespace mojo | 142 } // namespace mojo |
OLD | NEW |