1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ppapi/shared_impl/scoped_pp_var.h"
7 #include "ppapi/shared_impl/ppapi_globals.h"
8 #include "ppapi/shared_impl/var_tracker.h"
14 void CallAddRef(const PP_Var
& v
) {
15 PpapiGlobals::Get()->GetVarTracker()->AddRefVar(v
);
18 void CallRelease(const PP_Var
& v
) {
19 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(v
);
24 ScopedPPVar::ScopedPPVar() : var_(PP_MakeUndefined()) {
27 ScopedPPVar::ScopedPPVar(const PP_Var
& v
) : var_(v
) {
31 ScopedPPVar::ScopedPPVar(const PassRef
&, const PP_Var
& v
) : var_(v
) {
34 ScopedPPVar::ScopedPPVar(const ScopedPPVar
& other
)
39 ScopedPPVar::~ScopedPPVar() {
43 ScopedPPVar
& ScopedPPVar::operator=(const PP_Var
& v
) {
50 PP_Var
ScopedPPVar::Release() {
52 var_
= PP_MakeUndefined();