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

Side by Side Diff: ppapi/cpp/module_impl.h

Issue 8438005: Some description changes and documentation for logging.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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/logging.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PPAPI_CPP_MODULE_IMPL_H_ 5 #ifndef PPAPI_CPP_MODULE_IMPL_H_
6 #define PPAPI_CPP_MODULE_IMPL_H_ 6 #define PPAPI_CPP_MODULE_IMPL_H_
7 7
8 /// @file
9 /// This file defines some simple function templates that help the C++ wrappers
10 /// (and are not for external developers to use).
11
8 #include "ppapi/cpp/module.h" 12 #include "ppapi/cpp/module.h"
9 13
10 namespace pp { 14 namespace pp {
11 15
12 namespace { 16 namespace {
13 17
14 // Specialize this function to return the interface string corresponding to the 18 // Specialize this function to return the interface string corresponding to the
15 // PP?_XXX structure. 19 // PP?_XXX structure.
16 template <typename T> const char* interface_name() { 20 template <typename T> const char* interface_name() {
17 return NULL; 21 return NULL;
18 } 22 }
19 23
20 template <typename T> inline T const* get_interface() { 24 template <typename T> inline T const* get_interface() {
21 static T const* funcs = reinterpret_cast<T const*>( 25 static T const* funcs = reinterpret_cast<T const*>(
22 pp::Module::Get()->GetBrowserInterface(interface_name<T>())); 26 pp::Module::Get()->GetBrowserInterface(interface_name<T>()));
23 return funcs; 27 return funcs;
24 } 28 }
25 29
26 template <typename T> inline bool has_interface() { 30 template <typename T> inline bool has_interface() {
27 return get_interface<T>() != NULL; 31 return get_interface<T>() != NULL;
28 } 32 }
29 33
30 } // namespace 34 } // namespace
31 35
32 } // namespace pp 36 } // namespace pp
33 37
34 #endif // PPAPI_CPP_MODULE_IMPL_H_ 38 #endif // PPAPI_CPP_MODULE_IMPL_H_
35 39
OLDNEW
« no previous file with comments | « ppapi/cpp/logging.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698