Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Unified Diff: native_client_sdk/src/tests/nacl_io_test/fake_messaging_interface.cc

Issue 137853023: [NaCl SDK] nacl_io: Add new fakes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+}

Powered by Google App Engine
This is Rietveld 408576698