Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: ppapi/cpp/dev/directory_entry_dev.cc

Issue 14784002: Move DirectoryReader::ReadEntries to FileRef::ReadDirectoryEntries (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address dmichael's comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "ppapi/cpp/dev/directory_entry_dev.h"
6
7 #include <string.h>
8
9 #include "ppapi/cpp/module.h"
10
11 namespace pp {
12
13 DirectoryEntry_Dev::DirectoryEntry_Dev() {
14 memset(&data_, 0, sizeof(data_));
15 }
16
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;
21 }
22
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;
26 if (data_.file_ref)
27 Module::Get()->core()->AddRefResource(data_.file_ref);
28 }
29
30 DirectoryEntry_Dev::~DirectoryEntry_Dev() {
31 if (data_.file_ref)
32 Module::Get()->core()->ReleaseResource(data_.file_ref);
33 }
34
35 DirectoryEntry_Dev& DirectoryEntry_Dev::operator=(
36 const DirectoryEntry_Dev& other) {
37 if (data_.file_ref)
38 Module::Get()->core()->ReleaseResource(data_.file_ref);
39 data_ = other.data_;
40 if (data_.file_ref)
41 Module::Get()->core()->AddRefResource(data_.file_ref);
42 return *this;
43 }
44
45 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698