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

Unified Diff: Source/modules/filesystem/FileSystemCallbacks.cpp

Issue 188503002: Oilpan: add transition types to FileSystem APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid DirectoryReaderBase virtuals Created 6 years, 9 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: Source/modules/filesystem/FileSystemCallbacks.cpp
diff --git a/Source/modules/filesystem/FileSystemCallbacks.cpp b/Source/modules/filesystem/FileSystemCallbacks.cpp
index 85a7c86a868eed0c75110dbea9e6b85b585a9671..d10b4720a081e4ad44a6212b724b4c13773a4d13 100644
--- a/Source/modules/filesystem/FileSystemCallbacks.cpp
+++ b/Source/modules/filesystem/FileSystemCallbacks.cpp
@@ -76,12 +76,12 @@ void FileSystemCallbacksBase::didFail(int code)
// EntryCallbacks -------------------------------------------------------------
-PassOwnPtr<AsyncFileSystemCallbacks> EntryCallbacks::create(PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
+PassOwnPtr<AsyncFileSystemCallbacks> EntryCallbacks::create(PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtrWillBeRawPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
{
return adoptPtr(new EntryCallbacks(successCallback, errorCallback, fileSystem, expectedPath, isDirectory));
}
-EntryCallbacks::EntryCallbacks(PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
+EntryCallbacks::EntryCallbacks(PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtrWillBeRawPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
: FileSystemCallbacksBase(errorCallback, fileSystem.get())
, m_successCallback(successCallback)
, m_expectedPath(expectedPath)
@@ -102,12 +102,12 @@ void EntryCallbacks::didSucceed()
// EntriesCallbacks -----------------------------------------------------------
-PassOwnPtr<AsyncFileSystemCallbacks> EntriesCallbacks::create(PassOwnPtr<EntriesCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
+PassOwnPtr<AsyncFileSystemCallbacks> EntriesCallbacks::create(PassOwnPtr<EntriesCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtrWillBeRawPtr<DirectoryReaderBase> directoryReader, const String& basePath)
{
return adoptPtr(new EntriesCallbacks(successCallback, errorCallback, directoryReader, basePath));
}
-EntriesCallbacks::EntriesCallbacks(PassOwnPtr<EntriesCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
+EntriesCallbacks::EntriesCallbacks(PassOwnPtr<EntriesCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtrWillBeRawPtr<DirectoryReaderBase> directoryReader, const String& basePath)
: FileSystemCallbacksBase(errorCallback, directoryReader->filesystem())
, m_successCallback(successCallback)
, m_directoryReader(directoryReader)
@@ -149,7 +149,7 @@ FileSystemCallbacks::FileSystemCallbacks(PassOwnPtr<FileSystemCallback> successC
void FileSystemCallbacks::didOpenFileSystem(const String& name, const KURL& rootURL)
{
if (m_successCallback) {
- RefPtr<DOMFileSystem> fileSystem = DOMFileSystem::create(m_executionContext.get(), name, m_type, rootURL);
+ RefPtrWillBeRawPtr<DOMFileSystem> fileSystem = DOMFileSystem::create(m_executionContext.get(), name, m_type, rootURL);
m_successCallback->handleEvent(fileSystem.get());
m_executionContext.clear();
}
@@ -172,8 +172,8 @@ ResolveURICallbacks::ResolveURICallbacks(PassOwnPtr<EntryCallback> successCallba
void ResolveURICallbacks::didResolveURL(const String& name, const KURL& rootURL, FileSystemType type, const String& filePath, bool isDirectory)
{
- RefPtr<DOMFileSystem> filesystem = DOMFileSystem::create(m_executionContext.get(), name, type, rootURL);
- RefPtr<DirectoryEntry> root = filesystem->root();
+ RefPtrWillBeRawPtr<DOMFileSystem> filesystem = DOMFileSystem::create(m_executionContext.get(), name, type, rootURL);
+ RefPtrWillBeRawPtr<DirectoryEntry> root = filesystem->root();
String absolutePath;
if (!DOMFileSystemBase::pathToAbsolutePath(type, root.get(), filePath, absolutePath)) {
@@ -211,12 +211,12 @@ void MetadataCallbacks::didReadMetadata(const FileMetadata& metadata)
// FileWriterBaseCallbacks ----------------------------------------------------------
-PassOwnPtr<AsyncFileSystemCallbacks> FileWriterBaseCallbacks::create(PassRefPtr<FileWriterBase> fileWriter, PassOwnPtr<FileWriterBaseCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
+PassOwnPtr<AsyncFileSystemCallbacks> FileWriterBaseCallbacks::create(PassRefPtrWillBeRawPtr<FileWriterBase> fileWriter, PassOwnPtr<FileWriterBaseCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
{
return adoptPtr(new FileWriterBaseCallbacks(fileWriter, successCallback, errorCallback));
}
-FileWriterBaseCallbacks::FileWriterBaseCallbacks(PassRefPtr<FileWriterBase> fileWriter, PassOwnPtr<FileWriterBaseCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
+FileWriterBaseCallbacks::FileWriterBaseCallbacks(PassRefPtrWillBeRawPtr<FileWriterBase> fileWriter, PassOwnPtr<FileWriterBaseCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
: FileSystemCallbacksBase(errorCallback, 0)
, m_fileWriter(fileWriter)
, m_successCallback(successCallback)
@@ -226,8 +226,10 @@ FileWriterBaseCallbacks::FileWriterBaseCallbacks(PassRefPtr<FileWriterBase> file
void FileWriterBaseCallbacks::didCreateFileWriter(PassOwnPtr<blink::WebFileWriter> fileWriter, long long length)
{
m_fileWriter->initialize(fileWriter, length);
- if (m_successCallback)
- m_successCallback->handleEvent(m_fileWriter.release().get());
+ if (m_successCallback) {
+ RefPtrWillBeRawPtr<FileWriterBase> writer = m_fileWriter.release();
+ m_successCallback->handleEvent(writer.get());
haraken 2014/03/07 08:24:35 I'd write this as: m_successCallback->handleEve
sof 2014/03/07 09:37:36 Done.
+ }
m_successCallback.clear();
}

Powered by Google App Engine
This is Rietveld 408576698