android_webview
apps
ash
base
build
build_overrides
buildtools
cc
chrome
chromecast
chromeos
clank
codelabs
components
content
crypto
dbus
device
docs
extensions
fuchsia_web
gin
google_apis
google_update
gpu
headless
infra
internal
ios
ios_internal
ipc
media
mojo
native_client
native_client_sdk
net
pdf
ppapi
api
buildflags
c
cpp
dev
documentation
private
trusted
BUILD.gn
DEPS
array_output.cc
array_output.h
audio.cc
audio.h
audio_buffer.cc
audio_buffer.h
audio_config.cc
audio_config.h
completion_callback.h
core.cc
core.h
directory_entry.cc
directory_entry.h
file_io.cc
file_io.h
file_ref.cc
file_ref.h
file_system.cc
file_system.h
fullscreen.cc
fullscreen.h
graphics_2d.cc
graphics_2d.h
graphics_3d.cc
graphics_3d.h
graphics_3d_client.cc
graphics_3d_client.h
host_resolver.cc
host_resolver.h
image_data.cc
image_data.h
input_event.cc
input_event.h
input_event_interface_name.h
instance.cc
instance.h
instance_handle.cc
instance_handle.h
logging.h
media_stream_audio_track.cc
media_stream_audio_track.h
media_stream_video_track.cc
media_stream_video_track.h
message_handler.h
message_loop.cc
message_loop.h
module.cc
module.h
module_embedder.h
module_impl.h
mouse_cursor.cc
mouse_cursor.h
mouse_lock.cc
mouse_lock.h
net_address.cc
net_address.h
network_list.cc
network_list.h
network_monitor.cc
network_monitor.h
network_proxy.cc
network_proxy.h
output_traits.h
pass_ref.h
point.h
ppp_entrypoints.cc
rect.cc
rect.h
resource.cc
resource.h
size.h
tcp_socket.cc
tcp_socket.h
text_input_controller.cc
text_input_controller.h
touch_point.h
udp_socket.cc
udp_socket.h
url_loader.cc
url_loader.h
url_request_info.cc
url_request_info.h
url_response_info.cc
url_response_info.h
var.cc
var.h
var_array.cc
var_array.h
var_array_buffer.cc
var_array_buffer.h
var_dictionary.cc
var_dictionary.h
video_decoder.cc
video_decoder.h
video_encoder.cc
video_encoder.h
video_frame.cc
video_frame.h
view.cc
view.h
vpn_provider.cc
vpn_provider.h
websocket.cc
websocket.h
examples
generators
host
lib
nacl_irt
native_client
proxy
shared_impl
tests
thunk
tools
utility
BUILD.gn
DEPS
DIR_METADATA
LICENSE
OWNERS
PRESUBMIT.py
generate_ppapi_include_tests.py
generate_ppapi_size_checks.py
printing
remoting
rlz
sandbox
services
signing_keys
skia
sql
storage
styleguide
testing
third_party
tools
ui
url
v8
webkit
.clang-format
.clang-tidy
.clangd
.eslintrc.js
.git-blame-ignore-revs
.gitallowed
.gitattributes
.gitignore
.gitmodules
.gn
.mailmap
.rustfmt.toml
.vpython3
.yapfignore
ATL_OWNERS
AUTHORS
BUILD.gn
CODE_OF_CONDUCT.md
CPPLINT.cfg
CRYPTO_OWNERS
DEPS
DIR_METADATA
LICENSE
LICENSE.chromium_os
OWNERS
PRESUBMIT.py
PRESUBMIT_test.py
PRESUBMIT_test_mocks.py
README.md
WATCHLISTS
codereview.settings

The methodology used to generate this CL is documented in https://crbug.com/1098010#c95. No-Try: true Bug: 1098010 Change-Id: I6ae92e5d7ccbf73b176588124b2f8b4067f805b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3900575 Reviewed-by: Mark Mentovai <mark@chromium.org> Owners-Override: Avi Drissman <avi@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Auto-Submit: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1047628}
39 lines
930 B
C++
39 lines
930 B
C++
// Copyright 2011 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef PPAPI_CPP_MODULE_IMPL_H_
|
|
#define PPAPI_CPP_MODULE_IMPL_H_
|
|
|
|
/// @file
|
|
/// This file defines some simple function templates that help the C++ wrappers
|
|
/// (and are not for external developers to use).
|
|
|
|
#include "ppapi/cpp/module.h"
|
|
|
|
namespace pp {
|
|
|
|
namespace {
|
|
|
|
// Specialize this function to return the interface string corresponding to the
|
|
// PP?_XXX structure.
|
|
template <typename T>
|
|
const char* interface_name();
|
|
|
|
template <typename T> inline T const* get_interface() {
|
|
static T const* funcs = reinterpret_cast<T const*>(
|
|
pp::Module::Get()->GetBrowserInterface(interface_name<T>()));
|
|
return funcs;
|
|
}
|
|
|
|
template <typename T> inline bool has_interface() {
|
|
return get_interface<T>() != NULL;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
} // namespace pp
|
|
|
|
#endif // PPAPI_CPP_MODULE_IMPL_H_
|
|
|