1 // Copyright 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 #ifndef TESTS_NACL_IO_TEST_FAKE_CORE_INTERFACE_H_ 6 #define TESTS_NACL_IO_TEST_FAKE_CORE_INTERFACE_H_ 7 8 #include "fake_ppapi/fake_resource_manager.h" 9 #include "nacl_io/pepper_interface.h" 10 #include "sdk_util/macros.h" 11 12 class FakeCoreInterface : public nacl_io::CoreInterface { 13 public: 14 explicit FakeCoreInterface(FakeResourceManager* manager); 15 16 virtual void AddRefResource(PP_Resource handle); 17 virtual void ReleaseResource(PP_Resource handle); 18 virtual PP_Bool IsMainThread() { return PP_FALSE; } 19 20 FakeResourceManager* resource_manager() { return resource_manager_; } 21 22 private: 23 FakeResourceManager* resource_manager_; // Weak reference 24 25 DISALLOW_COPY_AND_ASSIGN(FakeCoreInterface); 26 }; 27 28 #endif // TESTS_NACL_IO_TEST_FAKE_CORE_INTERFACE_H_ 29