Pepper_47_C++_interfaces
device_control_samsung.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Samsung Electronics, Visual Display Division.
3  * All Rights Reserved.
4  *
5  * @author Michal Majczak <m.majczak@samsung.com>
6  *
7  * Use of this source code is governed by a BSD-style license that can be
8  * found in the Chromium-LICENSE file.
9  */
10 
12 
13 #include "ppapi/cpp/module_impl.h"
14 
15 namespace pp {
16 
17 namespace {
18 
19 template <> const char* interface_name<PPB_DeviceControl_Samsung_0_1>() {
20  return PPB_DEVICECONTROL_SAMSUNG_INTERFACE_0_1;
21 }
22 
23 } // namespace
24 
26 }
27 
29  : Resource(resource) {
30 }
31 
33  : Resource(PASS_REF, resource) {
34 }
35 
37 : Resource(other) {
38 }
39 
41  if (has_interface<PPB_DeviceControl_Samsung_0_1>()) {
43  get_interface<PPB_DeviceControl_Samsung_0_1>()->Create(
44  instance.pp_instance()));
45  }
46 }
47 
49  const CompletionCallback& callback) {
50  if (has_interface<PPB_DeviceControl_Samsung_0_1>()) {
51  return get_interface<PPB_DeviceControl_Samsung_0_1>()->ChangeSource(
52  pp_resource(), sourceID,callback.pp_completion_callback());
53  }
54  return PP_ERROR_NOINTERFACE;
55 }
56 
57 } // namespace pp
void PassRefFromConstructor(PP_Resource resource)
Definition: resource.cc:50
const PP_CompletionCallback & pp_completion_callback() const
PassRef
Definition: pass_ref.h:17
PP_Resource pp_resource() const
Definition: resource.h:47
PP_Instance pp_instance() const
A reference counted module resource.
Definition: resource.h:20
int32_t ChangeSource(uint32_t sourceID, const CompletionCallback &callback)