Index: native_client_sdk/src/tests/nacl_io_test/fake_messaging_interface.cc |
diff --git a/native_client_sdk/src/tests/nacl_io_test/fake_messaging_interface.cc b/native_client_sdk/src/tests/nacl_io_test/fake_messaging_interface.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b949af8d584c0ae121a973b9b7b314b19d011ad0 |
--- /dev/null |
+++ b/native_client_sdk/src/tests/nacl_io_test/fake_messaging_interface.cc |
@@ -0,0 +1,25 @@ |
+// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "fake_messaging_interface.h" |
+ |
+#include "fake_var_manager.h" |
+ |
+FakeMessagingInterface::FakeMessagingInterface( |
+ FakeVarManager* manager, nacl_io::VarInterface* var_interface) |
+ : manager_(manager), var_interface_(var_interface) {} |
+ |
+FakeMessagingInterface::~FakeMessagingInterface() { |
+ for (std::vector<PP_Var>::iterator it = messages.begin(); |
+ it != messages.end(); ++it) { |
+ manager_->Release(*it); |
+ } |
+ messages.clear(); |
+} |
+ |
+void FakeMessagingInterface::PostMessage(PP_Instance instance, |
+ PP_Var message) { |
+ manager_->AddRef(message); |
+ messages.push_back(message); |
+} |