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

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

Issue 5828003: Move the Pepper implementation from webkit/glue/plugins/pepper_* to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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
« no previous file with comments | « webkit/plugins/ppapi/ppb_directory_reader_impl.h ('k') | webkit/plugins/ppapi/ppb_file_chooser_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_directory_reader_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_directory_reader_impl.cc (revision 0)
+++ webkit/plugins/ppapi/ppb_directory_reader_impl.cc (working copy)
@@ -2,23 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/glue/plugins/pepper_directory_reader.h"
+#include "webkit/plugins/ppapi/ppb_directory_reader_impl.h"
#include "base/logging.h"
#include "base/utf_string_conversions.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/dev/ppb_directory_reader_dev.h"
-#include "webkit/glue/plugins/pepper_file_callbacks.h"
-#include "webkit/glue/plugins/pepper_common.h"
-#include "webkit/glue/plugins/pepper_file_ref.h"
-#include "webkit/glue/plugins/pepper_file_system.h"
-#include "webkit/glue/plugins/pepper_plugin_delegate.h"
-#include "webkit/glue/plugins/pepper_plugin_instance.h"
-#include "webkit/glue/plugins/pepper_plugin_module.h"
-#include "webkit/glue/plugins/pepper_resource_tracker.h"
+#include "webkit/plugins/ppapi/common.h"
+#include "webkit/plugins/ppapi/file_callbacks.h"
+#include "webkit/plugins/ppapi/plugin_delegate.h"
+#include "webkit/plugins/ppapi/plugin_instance.h"
+#include "webkit/plugins/ppapi/plugin_module.h"
+#include "webkit/plugins/ppapi/ppb_file_ref_impl.h"
+#include "webkit/plugins/ppapi/ppb_file_system_impl.h"
+#include "webkit/plugins/ppapi/resource_tracker.h"
-namespace pepper {
+namespace webkit {
+namespace ppapi {
namespace {
@@ -43,24 +44,24 @@
}
PP_Resource Create(PP_Resource directory_ref_id) {
- scoped_refptr<FileRef> directory_ref(
- Resource::GetAs<FileRef>(directory_ref_id));
+ scoped_refptr<PPB_FileRef_Impl> directory_ref(
+ Resource::GetAs<PPB_FileRef_Impl>(directory_ref_id));
if (!directory_ref)
return 0;
- DirectoryReader* reader = new DirectoryReader(directory_ref);
+ PPB_DirectoryReader_Impl* reader = new PPB_DirectoryReader_Impl(directory_ref);
return reader->GetReference();
}
PP_Bool IsDirectoryReader(PP_Resource resource) {
- return BoolToPPBool(!!Resource::GetAs<DirectoryReader>(resource));
+ return BoolToPPBool(!!Resource::GetAs<PPB_DirectoryReader_Impl>(resource));
}
int32_t GetNextEntry(PP_Resource reader_id,
PP_DirectoryEntry_Dev* entry,
PP_CompletionCallback callback) {
- scoped_refptr<DirectoryReader> reader(
- Resource::GetAs<DirectoryReader>(reader_id));
+ scoped_refptr<PPB_DirectoryReader_Impl> reader(
+ Resource::GetAs<PPB_DirectoryReader_Impl>(reader_id));
if (!reader)
return PP_ERROR_BADRESOURCE;
@@ -75,26 +76,29 @@
} // namespace
-DirectoryReader::DirectoryReader(FileRef* directory_ref)
+PPB_DirectoryReader_Impl::PPB_DirectoryReader_Impl(
+ PPB_FileRef_Impl* directory_ref)
: Resource(directory_ref->module()),
directory_ref_(directory_ref),
has_more_(true),
entry_(NULL) {
}
-DirectoryReader::~DirectoryReader() {
+PPB_DirectoryReader_Impl::~PPB_DirectoryReader_Impl() {
}
-const PPB_DirectoryReader_Dev* DirectoryReader::GetInterface() {
+const PPB_DirectoryReader_Dev* PPB_DirectoryReader_Impl::GetInterface() {
return &ppb_directoryreader;
}
-DirectoryReader* DirectoryReader::AsDirectoryReader() {
+PPB_DirectoryReader_Impl*
+PPB_DirectoryReader_Impl::AsPPB_DirectoryReader_Impl() {
return this;
}
-int32_t DirectoryReader::GetNextEntry(PP_DirectoryEntry_Dev* entry,
- PP_CompletionCallback callback) {
+int32_t PPB_DirectoryReader_Impl::GetNextEntry(
+ PP_DirectoryEntry_Dev* entry,
+ PP_CompletionCallback callback) {
if (directory_ref_->GetFileSystemType() == PP_FILESYSTEMTYPE_EXTERNAL)
return PP_ERROR_FAILED;
@@ -114,7 +118,7 @@
return PP_ERROR_WOULDBLOCK;
}
-void DirectoryReader::AddNewEntries(
+void PPB_DirectoryReader_Impl::AddNewEntries(
const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) {
DCHECK(!entries.empty());
has_more_ = has_more;
@@ -134,15 +138,16 @@
entry_ = NULL;
}
-bool DirectoryReader::FillUpEntry() {
+bool PPB_DirectoryReader_Impl::FillUpEntry() {
DCHECK(entry_);
if (!entries_.empty()) {
base::FileUtilProxy::Entry dir_entry = entries_.front();
entries_.pop();
if (entry_->file_ref)
ResourceTracker::Get()->UnrefResource(entry_->file_ref);
- FileRef* file_ref = new FileRef(module(), directory_ref_->GetFileSystem(),
- FilePathStringToUTF8String(dir_entry.name));
+ PPB_FileRef_Impl* file_ref =
+ new PPB_FileRef_Impl(module(), directory_ref_->GetFileSystem(),
+ FilePathStringToUTF8String(dir_entry.name));
entry_->file_ref = file_ref->GetReference();
entry_->file_type =
(dir_entry.is_directory ? PP_FILETYPE_DIRECTORY : PP_FILETYPE_REGULAR);
@@ -157,4 +162,6 @@
return false;
}
-} // namespace pepper
+} // namespace ppapi
+} // namespace webkit
+
« no previous file with comments | « webkit/plugins/ppapi/ppb_directory_reader_impl.h ('k') | webkit/plugins/ppapi/ppb_file_chooser_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698