Index: ppapi/cpp/dev/resize_client_dev.cc |
=================================================================== |
--- ppapi/cpp/dev/resize_client_dev.cc (revision 0) |
+++ ppapi/cpp/dev/resize_client_dev.cc (revision 0) |
@@ -0,0 +1,53 @@ |
+// Copyright (c) 2011 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. |
+ |
+#include "ppapi/cpp/dev/resize_client_dev.h" |
+ |
+#include "ppapi/c/dev/ppp_resize_dev.h" |
+#include "ppapi/cpp/instance.h" |
+#include "ppapi/cpp/module.h" |
+#include "ppapi/cpp/module_impl.h" |
+ |
+namespace pp { |
+ |
+namespace { |
+ |
+// PPP_Resize_Dev -------------------------------------------------------------- |
+ |
+const char kPPPResizeInterface[] = PPP_RESIZE_DEV_INTERFACE; |
+ |
+void WillStartLiveResize(PP_Instance instance) { |
+ void* object = |
+ pp::Instance::GetPerInstanceObject(instance, kPPPResizeInterface); |
+ if (!object) |
+ return; |
+ return static_cast<ResizeClient_Dev*>(object)->WillStartLiveResize(); |
+} |
+ |
+void WillEndLiveResize(PP_Instance instance) { |
+ void* object = |
+ pp::Instance::GetPerInstanceObject(instance, kPPPResizeInterface); |
+ if (!object) |
+ return; |
+ return static_cast<ResizeClient_Dev*>(object)->WillEndLiveResize(); |
+} |
+ |
+static PPP_Resize_Dev resize_interface = { |
+ &WillStartLiveResize, |
+ &WillEndLiveResize |
+}; |
+ |
+} // namespace |
+ |
+ResizeClient_Dev::ResizeClient_Dev(Instance* instance) |
+ : associated_instance_(instance) { |
+ pp::Module::Get()->AddPluginInterface(kPPPResizeInterface, &resize_interface); |
+ associated_instance_->AddPerInstanceObject(kPPPResizeInterface, this); |
+} |
+ |
+ResizeClient_Dev::~ResizeClient_Dev() { |
+ associated_instance_->RemovePerInstanceObject(kPPPResizeInterface, this); |
+} |
+ |
+} // namespace pp |
Property changes on: ppapi\cpp\dev\resize_client_dev.cc |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |