1 // Copyright (c) 2011 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.
5 #include "ppapi/cpp/dev/memory_dev.h"
7 #include "ppapi/c/dev/ppb_memory_dev.h"
8 #include "ppapi/cpp/module.h"
9 #include "ppapi/cpp/module_impl.h"
15 template <> const char* interface_name
<PPB_Memory_Dev
>() {
16 return PPB_MEMORY_DEV_INTERFACE
;
21 void* Memory_Dev::MemAlloc(uint32_t num_bytes
) {
22 if (!has_interface
<PPB_Memory_Dev
>())
24 return get_interface
<PPB_Memory_Dev
>()->MemAlloc(num_bytes
);
27 void Memory_Dev::MemFree(void* ptr
) {
28 if (!has_interface
<PPB_Memory_Dev
>() || !ptr
)
30 get_interface
<PPB_Memory_Dev
>()->MemFree(ptr
);