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

Unified Diff: webkit/plugins/ppapi/ppb_directory_reader_impl.cc

Issue 7706021: Convert FileRefImpl and URLRequestInfo to shared_impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests fixed Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: webkit/plugins/ppapi/ppb_directory_reader_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_directory_reader_impl.cc b/webkit/plugins/ppapi/ppb_directory_reader_impl.cc
index 38e2179121286e7f521324606bdc6916c341b42a..36428d82a947926b94f1354e9575d862165bb587 100644
--- a/webkit/plugins/ppapi/ppb_directory_reader_impl.cc
+++ b/webkit/plugins/ppapi/ppb_directory_reader_impl.cc
@@ -104,7 +104,8 @@ void PPB_DirectoryReader_Impl::AddNewEntries(
const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) {
DCHECK(!entries.empty() || !has_more);
has_more_ = has_more;
- std::string dir_path = directory_ref_->virtual_path();
+
+ std::string dir_path = directory_ref_->GetCreateInfo().path;
if (dir_path[dir_path.size() - 1] != '/')
dir_path += '/';
FilePath::StringType dir_file_path = UTF8StringToFilePathString(dir_path);
@@ -127,9 +128,12 @@ bool PPB_DirectoryReader_Impl::FillUpEntry() {
entries_.pop();
if (entry_->file_ref)
ResourceTracker::Get()->ReleaseResource(entry_->file_ref);
- PPB_FileRef_Impl* file_ref =
- new PPB_FileRef_Impl(pp_instance(), directory_ref_->file_system(),
- FilePathStringToUTF8String(dir_entry.name));
+
+ PPB_FileRef_Impl* file_ref = PPB_FileRef_Impl::CreateInternal(
+ directory_ref_->file_system()->pp_resource(),
+ FilePathStringToUTF8String(dir_entry.name));
+ if (!file_ref)
+ return false;
entry_->file_ref = file_ref->GetReference();
entry_->file_type =
(dir_entry.is_directory ? PP_FILETYPE_DIRECTORY : PP_FILETYPE_REGULAR);

Powered by Google App Engine
This is Rietveld 408576698