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

Side by Side Diff: ppapi/cpp/directory_entry.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
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/cpp/dev/directory_entry_dev.h" 5 #include "ppapi/cpp/directory_entry.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "ppapi/cpp/module.h" 9 #include "ppapi/cpp/module.h"
10 10
11 namespace pp { 11 namespace pp {
12 12
13 DirectoryEntry_Dev::DirectoryEntry_Dev() { 13 DirectoryEntry::DirectoryEntry() {
14 memset(&data_, 0, sizeof(data_)); 14 memset(&data_, 0, sizeof(data_));
15 } 15 }
16 16
17 DirectoryEntry_Dev::DirectoryEntry_Dev( 17 DirectoryEntry::DirectoryEntry(
18 PassRef, const PP_DirectoryEntry_Dev& data) { 18 PassRef, const PP_DirectoryEntry& data) {
19 data_.file_ref = data.file_ref; 19 data_.file_ref = data.file_ref;
20 data_.file_type = data.file_type; 20 data_.file_type = data.file_type;
21 } 21 }
22 22
23 DirectoryEntry_Dev::DirectoryEntry_Dev(const DirectoryEntry_Dev& other) { 23 DirectoryEntry::DirectoryEntry(const DirectoryEntry& other) {
24 data_.file_ref = other.data_.file_ref; 24 data_.file_ref = other.data_.file_ref;
25 data_.file_type = other.data_.file_type; 25 data_.file_type = other.data_.file_type;
26 if (data_.file_ref) 26 if (data_.file_ref)
27 Module::Get()->core()->AddRefResource(data_.file_ref); 27 Module::Get()->core()->AddRefResource(data_.file_ref);
28 } 28 }
29 29
30 DirectoryEntry_Dev::~DirectoryEntry_Dev() { 30 DirectoryEntry::~DirectoryEntry() {
31 if (data_.file_ref) 31 if (data_.file_ref)
32 Module::Get()->core()->ReleaseResource(data_.file_ref); 32 Module::Get()->core()->ReleaseResource(data_.file_ref);
33 } 33 }
34 34
35 DirectoryEntry_Dev& DirectoryEntry_Dev::operator=( 35 DirectoryEntry& DirectoryEntry::operator=(
36 const DirectoryEntry_Dev& other) { 36 const DirectoryEntry& other) {
37 if (data_.file_ref) 37 if (data_.file_ref)
38 Module::Get()->core()->ReleaseResource(data_.file_ref); 38 Module::Get()->core()->ReleaseResource(data_.file_ref);
39 data_ = other.data_; 39 data_ = other.data_;
40 if (data_.file_ref) 40 if (data_.file_ref)
41 Module::Get()->core()->AddRefResource(data_.file_ref); 41 Module::Get()->core()->AddRefResource(data_.file_ref);
42 return *this; 42 return *this;
43 } 43 }
44 44
45 } // namespace pp 45 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698