OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PPAPI_PROXY_RESOURCE_MESSAGE_TEST_SINK_H_ |
| 6 #define PPAPI_PROXY_RESOURCE_MESSAGE_TEST_SINK_H_ |
| 7 |
| 8 #include "ipc/ipc_test_sink.h" |
| 9 |
| 10 namespace ppapi { |
| 11 namespace proxy { |
| 12 |
| 13 class ResourceMessageCallParams; |
| 14 class ResourceMessageReplyParams; |
| 15 |
| 16 // Extends IPC::TestSink to add extra capabilities for searching for and |
| 17 // decoding resource messages. |
| 18 class ResourceMessageTestSink : public IPC::TestSink { |
| 19 public: |
| 20 ResourceMessageTestSink(); |
| 21 virtual ~ResourceMessageTestSink(); |
| 22 |
| 23 // Searches the queue for the first resource call message with a nested |
| 24 // message matching the given ID. On success, returns true and populates the |
| 25 // givem params and nested message. |
| 26 bool GetFirstResourceCallMatching( |
| 27 uint32 id, |
| 28 ResourceMessageCallParams* params, |
| 29 IPC::Message* nested_msg) const; |
| 30 |
| 31 // Like GetFirstResourceCallMatching except for replies. |
| 32 bool GetFirstResourceReplyMatching( |
| 33 uint32 id, |
| 34 ResourceMessageReplyParams* params, |
| 35 IPC::Message* nested_msg); |
| 36 }; |
| 37 |
| 38 } // namespace proxy |
| 39 } // namespace ppapi |
| 40 |
| 41 #endif // PPAPI_PROXY_RESOURCE_MESSAGE_TEST_SINK_H_ |
OLD | NEW |