summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/instance.cc
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-22 00:58:28 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-22 00:58:28 +0000
commit1c7e5c9fa3505d66c7e5f1831a214b037bbec2b2 (patch)
tree17c1b6c9c9625b31fea56945fcab75cc5497d497 /ppapi/cpp/instance.cc
parentedb6e773afb3a46322ea64eaf4bb0f0f4eb7e726 (diff)
downloadchromium_src-1c7e5c9fa3505d66c7e5f1831a214b037bbec2b2.zip
chromium_src-1c7e5c9fa3505d66c7e5f1831a214b037bbec2b2.tar.gz
chromium_src-1c7e5c9fa3505d66c7e5f1831a214b037bbec2b2.tar.bz2
Check for specific PPB interface versions in the C++ wrappers for Graphics2D, *InputEvent, Instance, ImageData, Module, Rect, URLLoader, URLRequestInfo and URLResponseInfo.
BUG=107398 Review URL: https://chromiumcodereview.appspot.com/9700088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128125 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/instance.cc')
-rw-r--r--ppapi/cpp/instance.cc45
1 files changed, 23 insertions, 22 deletions
diff --git a/ppapi/cpp/instance.cc b/ppapi/cpp/instance.cc
index f2a181a..e000f9c 100644
--- a/ppapi/cpp/instance.cc
+++ b/ppapi/cpp/instance.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -24,16 +24,16 @@ namespace pp {
namespace {
-template <> const char* interface_name<PPB_InputEvent>() {
- return PPB_INPUT_EVENT_INTERFACE;
+template <> const char* interface_name<PPB_InputEvent_1_0>() {
+ return PPB_INPUT_EVENT_INTERFACE_1_0;
}
-template <> const char* interface_name<PPB_Instance>() {
- return PPB_INSTANCE_INTERFACE;
+template <> const char* interface_name<PPB_Instance_1_0>() {
+ return PPB_INSTANCE_INTERFACE_1_0;
}
-template <> const char* interface_name<PPB_Messaging>() {
- return PPB_MESSAGING_INTERFACE;
+template <> const char* interface_name<PPB_Messaging_1_0>() {
+ return PPB_MESSAGING_INTERFACE_1_0;
}
} // namespace
@@ -75,50 +75,51 @@ void Instance::HandleMessage(const Var& /*message*/) {
}
bool Instance::BindGraphics(const Graphics2D& graphics) {
- if (!has_interface<PPB_Instance>())
+ if (!has_interface<PPB_Instance_1_0>())
return false;
- return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics(
+ return PP_ToBool(get_interface<PPB_Instance_1_0>()->BindGraphics(
pp_instance(), graphics.pp_resource()));
}
bool Instance::BindGraphics(const Graphics3D& graphics) {
- if (!has_interface<PPB_Instance>())
+ if (!has_interface<PPB_Instance_1_0>())
return false;
- return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics(
+ return PP_ToBool(get_interface<PPB_Instance_1_0>()->BindGraphics(
pp_instance(), graphics.pp_resource()));
}
bool Instance::IsFullFrame() {
- if (!has_interface<PPB_Instance>())
+ if (!has_interface<PPB_Instance_1_0>())
return false;
- return PP_ToBool(get_interface<PPB_Instance>()->IsFullFrame(pp_instance()));
+ return PP_ToBool(get_interface<PPB_Instance_1_0>()->IsFullFrame(
+ pp_instance()));
}
int32_t Instance::RequestInputEvents(uint32_t event_classes) {
- if (!has_interface<PPB_InputEvent>())
+ if (!has_interface<PPB_InputEvent_1_0>())
return PP_ERROR_NOINTERFACE;
- return get_interface<PPB_InputEvent>()->RequestInputEvents(pp_instance(),
- event_classes);
+ return get_interface<PPB_InputEvent_1_0>()->RequestInputEvents(pp_instance(),
+ event_classes);
}
int32_t Instance::RequestFilteringInputEvents(uint32_t event_classes) {
- if (!has_interface<PPB_InputEvent>())
+ if (!has_interface<PPB_InputEvent_1_0>())
return PP_ERROR_NOINTERFACE;
- return get_interface<PPB_InputEvent>()->RequestFilteringInputEvents(
+ return get_interface<PPB_InputEvent_1_0>()->RequestFilteringInputEvents(
pp_instance(), event_classes);
}
void Instance::ClearInputEventRequest(uint32_t event_classes) {
- if (!has_interface<PPB_InputEvent>())
+ if (!has_interface<PPB_InputEvent_1_0>())
return;
- get_interface<PPB_InputEvent>()->ClearInputEventRequest(pp_instance(),
+ get_interface<PPB_InputEvent_1_0>()->ClearInputEventRequest(pp_instance(),
event_classes);
}
void Instance::PostMessage(const Var& message) {
- if (!has_interface<PPB_Messaging>())
+ if (!has_interface<PPB_Messaging_1_0>())
return;
- get_interface<PPB_Messaging>()->PostMessage(pp_instance(),
+ get_interface<PPB_Messaging_1_0>()->PostMessage(pp_instance(),
message.pp_var());
}