1 // Copyright (c) 2010 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/cpp/dev/directory_entry_dev.h"
9 #include "ppapi/cpp/module.h"
13 DirectoryEntry_Dev::DirectoryEntry_Dev() {
14 memset(&data_
, 0, sizeof(data_
));
17 DirectoryEntry_Dev::DirectoryEntry_Dev(
18 PassRef
, const PP_DirectoryEntry_Dev
& data
) {
19 data_
.file_ref
= data
.file_ref
;
20 data_
.file_type
= data
.file_type
;
23 DirectoryEntry_Dev::DirectoryEntry_Dev(const DirectoryEntry_Dev
& other
) {
24 data_
.file_ref
= other
.data_
.file_ref
;
25 data_
.file_type
= other
.data_
.file_type
;
27 Module::Get()->core()->AddRefResource(data_
.file_ref
);
30 DirectoryEntry_Dev::~DirectoryEntry_Dev() {
32 Module::Get()->core()->ReleaseResource(data_
.file_ref
);
35 DirectoryEntry_Dev
& DirectoryEntry_Dev::operator=(
36 const DirectoryEntry_Dev
& other
) {
38 Module::Get()->core()->ReleaseResource(data_
.file_ref
);
41 Module::Get()->core()->AddRefResource(data_
.file_ref
);