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

Side by Side Diff: ppapi/cpp/dev/memory_dev.cc

Issue 7300010: Add PPB_Memory_Dev. This is the first of a few CLs needed to pull MemAlloc and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up thunk.h Created 9 years, 5 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
« no previous file with comments | « ppapi/cpp/dev/memory_dev.h ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "ppapi/cpp/dev/memory_dev.h"
6
7 #include "ppapi/c/dev/ppb_memory_dev.h"
8 #include "ppapi/cpp/module.h"
9 #include "ppapi/cpp/module_impl.h"
10
11 namespace pp {
12
13 namespace {
14
15 template <> const char* interface_name<PPB_Memory_Dev>() {
16 return PPB_MEMORY_DEV_INTERFACE;
17 }
18
19 } // namespace
20
21 void* Memory_Dev::MemAlloc(uint32_t num_bytes) {
22 if (!has_interface<PPB_Memory_Dev>())
23 return NULL;
24 return get_interface<PPB_Memory_Dev>()->MemAlloc(num_bytes);
25 }
26
27 void Memory_Dev::MemFree(void* ptr) {
28 if (!has_interface<PPB_Memory_Dev>() || !ptr)
29 return;
30 get_interface<PPB_Memory_Dev>()->MemFree(ptr);
31 }
32
33 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/memory_dev.h ('k') | ppapi/ppapi_cpp.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698