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

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

Issue 7629017: Add a unified resource tracker shared between the proxy and the impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments 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 cb95b1191d4ec969055a175bf3c8e4522b19fb77..f7588731b21bbb768617fc9a475537417acfd0e8 100644
--- a/webkit/plugins/ppapi/ppb_directory_reader_impl.cc
+++ b/webkit/plugins/ppapi/ppb_directory_reader_impl.cc
@@ -67,10 +67,8 @@ PP_Resource PPB_DirectoryReader_Impl::Create(PP_Resource directory_ref) {
EnterResourceNoLock<PPB_FileRef_API> enter(directory_ref, true);
if (enter.failed())
return 0;
-
- PPB_DirectoryReader_Impl* reader = new PPB_DirectoryReader_Impl(
- static_cast<PPB_FileRef_Impl*>(enter.object()));
- return reader->GetReference();
+ return (new PPB_DirectoryReader_Impl(
+ static_cast<PPB_FileRef_Impl*>(enter.object())))->GetReference();
}
PPB_DirectoryReader_API* PPB_DirectoryReader_Impl::AsPPB_DirectoryReader_API() {
@@ -90,13 +88,10 @@ int32_t PPB_DirectoryReader_Impl::GetNextEntry(
}
PluginInstance* instance = directory_ref_->instance();
- PP_Resource resource_id = GetReferenceNoAddRef();
- DCHECK(resource_id != 0);
if (!instance->delegate()->ReadDirectory(
directory_ref_->GetFileSystemURL(),
new FileCallbacks(instance->module()->AsWeakPtr(),
- resource_id,
- callback, NULL, NULL, this)))
+ pp_resource(), callback, NULL, NULL, this)))
return PP_ERROR_FAILED;
return PP_OK_COMPLETIONPENDING;
@@ -128,7 +123,7 @@ bool PPB_DirectoryReader_Impl::FillUpEntry() {
base::FileUtilProxy::Entry dir_entry = entries_.front();
entries_.pop();
if (entry_->file_ref)
- ResourceTracker::Get()->UnrefResource(entry_->file_ref);
+ ResourceTracker::Get()->ReleaseResource(entry_->file_ref);
PPB_FileRef_Impl* file_ref =
new PPB_FileRef_Impl(instance(), directory_ref_->file_system(),
FilePathStringToUTF8String(dir_entry.name));

Powered by Google App Engine
This is Rietveld 408576698