OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 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 #include "fake_messaging_interface.h" |
| 6 |
| 7 #include "fake_var_manager.h" |
| 8 |
| 9 FakeMessagingInterface::FakeMessagingInterface( |
| 10 FakeVarManager* manager, nacl_io::VarInterface* var_interface) |
| 11 : manager_(manager), var_interface_(var_interface) {} |
| 12 |
| 13 FakeMessagingInterface::~FakeMessagingInterface() { |
| 14 for (std::vector<PP_Var>::iterator it = messages.begin(); |
| 15 it != messages.end(); ++it) { |
| 16 manager_->Release(*it); |
| 17 } |
| 18 messages.clear(); |
| 19 } |
| 20 |
| 21 void FakeMessagingInterface::PostMessage(PP_Instance instance, |
| 22 PP_Var message) { |
| 23 manager_->AddRef(message); |
| 24 messages.push_back(message); |
| 25 } |
OLD | NEW |