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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698