summaryrefslogtreecommitdiffstats
path: root/ppapi/shared_impl/host_resource.cc
blob: ef15270de38c8a39b23a4d71c204053495b8a736 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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.

#include "ppapi/shared_impl/host_resource.h"

namespace ppapi {

HostResource::HostResource() : instance_(0), host_resource_(0) {}

// static
HostResource HostResource::MakeInstanceOnly(PP_Instance instance) {
  HostResource resource;
  resource.SetHostResource(instance, 0);
  return resource;
}

void HostResource::SetHostResource(PP_Instance instance, PP_Resource resource) {
  instance_ = instance;
  host_resource_ = resource;
}

}  // namespace ppapi