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

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: Rebase 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
« no previous file with comments | « Source/modules/filesystem/FileSystemCallbacks.h ('k') | Source/modules/filesystem/FileWriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/filesystem/FileSystemCallbacks.cpp
diff --git a/Source/modules/filesystem/FileSystemCallbacks.cpp b/Source/modules/filesystem/FileSystemCallbacks.cpp
index 1cece893836949f8585c78751071a0fc2d95c0bf..34dfae2d19e1ddd7ec6790b622e58ea36ca24509 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)
@@ -127,7 +127,7 @@ void EntriesCallbacks::didReadDirectoryEntry(const String& name, bool isDirector
void EntriesCallbacks::didReadDirectoryEntries(bool hasMore)
{
m_directoryReader->setHasMoreEntries(hasMore);
- EntryVector entries;
+ EntryHeapVector entries;
entries.swap(m_entries);
if (m_successCallback)
m_successCallback->handleEvent(entries);
@@ -151,7 +151,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();
}
@@ -174,8 +174,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)) {
@@ -213,12 +213,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)
@@ -228,8 +228,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) {
+ m_successCallback->handleEvent(m_fileWriter.get());
+ m_fileWriter = nullptr;
+ }
m_successCallback.clear();
}
« no previous file with comments | « Source/modules/filesystem/FileSystemCallbacks.h ('k') | Source/modules/filesystem/FileWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698