From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/fileapi/AsyncFileStream.h | 50 +++++++------------------------- 1 file changed, 11 insertions(+), 39 deletions(-) (limited to 'Source/WebCore/fileapi/AsyncFileStream.h') diff --git a/Source/WebCore/fileapi/AsyncFileStream.h b/Source/WebCore/fileapi/AsyncFileStream.h index 849ea2bc9..2098ee3f4 100644 --- a/Source/WebCore/fileapi/AsyncFileStream.h +++ b/Source/WebCore/fileapi/AsyncFileStream.h @@ -1,6 +1,6 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. - * Copyright (C) 2010, 2012 Apple Inc. All rights reserved. + * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2010, 2012, 2014 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -29,14 +29,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef AsyncFileStream_h -#define AsyncFileStream_h - -#if ENABLE(BLOB) +#pragma once +#include #include -#include -#include +#include namespace WebCore { @@ -44,47 +41,22 @@ class FileStreamClient; class FileStream; class URL; -class AsyncFileStream : public RefCounted { +class WEBCORE_EXPORT AsyncFileStream { public: - static PassRefPtr create(FileStreamClient*); + explicit AsyncFileStream(FileStreamClient&); ~AsyncFileStream(); void getSize(const String& path, double expectedModificationTime); void openForRead(const String& path, long long offset, long long length); - void openForWrite(const String& path); void close(); void read(char* buffer, int length); - void write(const URL& blobURL, long long position, int length); - void truncate(long long position); - - // Stops the proxy and schedules it to be destructed. All the pending tasks will be aborted and the file stream will be closed. - // Note: the caller should deref the instance immediately after calling stop(). - void stop(); - - FileStreamClient* client() const { return m_client; } - void setClient(FileStreamClient* client) { m_client = client; } private: - AsyncFileStream(FileStreamClient*); - - // Called on File thread. - void startOnFileThread(); - void stopOnFileThread(); - void getSizeOnFileThread(const String& path, double expectedModificationTime); - void openForReadOnFileThread(const String& path, long long offset, long long length); - void openForWriteOnFileThread(const String& path); - void closeOnFileThread(); - void readOnFileThread(char* buffer, int length); - void writeOnFileThread(const URL& blobURL, long long position, int length); - void truncateOnFileThread(long long position); + void start(); + void perform(Function(FileStream&)>&&); - RefPtr m_stream; - - FileStreamClient* m_client; + struct Internals; + std::unique_ptr m_internals; }; } // namespace WebCore - -#endif // ENABLE(BLOB) - -#endif // AsyncFileStream_h -- cgit v1.2.1