| Index: Source/core/html/HTMLFrameJavaScriptURLOpener.h
|
| diff --git a/Source/core/fileapi/FileList.h b/Source/core/html/HTMLFrameJavaScriptURLOpener.h
|
| similarity index 53%
|
| copy from Source/core/fileapi/FileList.h
|
| copy to Source/core/html/HTMLFrameJavaScriptURLOpener.h
|
| index 736a6fcb84be552e1fc0b748dfa488839a394421..a0e82aeb14e225a20ec11a0207be86045fa63d53 100644
|
| --- a/Source/core/fileapi/FileList.h
|
| +++ b/Source/core/html/HTMLFrameJavaScriptURLOpener.h
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (C) 2008 Apple Inc. All Rights Reserved.
|
| + * Copyright (C) 2014 Google, Inc. All Rights Reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions
|
| @@ -23,42 +23,55 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef FileList_h
|
| -#define FileList_h
|
| +#ifndef HTMLFrameJavaScriptURLOpener_h
|
| +#define HTMLFrameJavaScriptURLOpener_h
|
|
|
| -#include "bindings/v8/ScriptWrappable.h"
|
| -#include "core/fileapi/File.h"
|
| -#include "heap/Handle.h"
|
| -#include "wtf/PassRefPtr.h"
|
| +#include "platform/weborigin/KURL.h"
|
| #include "wtf/RefCounted.h"
|
| #include "wtf/RefPtr.h"
|
| #include "wtf/Vector.h"
|
|
|
| namespace WebCore {
|
|
|
| -class FileList : public RefCountedWillBeGarbageCollectedFinalized<FileList>, public ScriptWrappable {
|
| -public:
|
| - static PassRefPtrWillBeRawPtr<FileList> create()
|
| - {
|
| - return adoptRefWillBeNoop(new FileList);
|
| - }
|
| +class Document;
|
| +class HTMLFrameElementBase;
|
|
|
| - unsigned length() const { return m_files.size(); }
|
| - File* item(unsigned index) const;
|
| +// FIXME: Some day, this could be implemented as a C++ level
|
| +// equivalent of custom element enterView callback.
|
| +// We don't have that yet, so uses timer for a while.
|
| +class HTMLFrameJavaScriptURLOpener {
|
| + WTF_MAKE_NONCOPYABLE(HTMLFrameJavaScriptURLOpener); WTF_MAKE_FAST_ALLOCATED;
|
| +public:
|
| + ~HTMLFrameJavaScriptURLOpener();
|
|
|
| - bool isEmpty() const { return m_files.isEmpty(); }
|
| - void clear() { m_files.clear(); }
|
| - void append(PassRefPtrWillBeRawPtr<File> file) { m_files.append(file); }
|
| - Vector<String> paths() const;
|
| + void request(PassRefPtr<HTMLFrameElementBase>);
|
| + void processPendingRequests();
|
|
|
| - void trace(Visitor*);
|
| + static HTMLFrameJavaScriptURLOpener& instance();
|
|
|
| private:
|
| - FileList();
|
| + static void microtaskCallback();
|
| +
|
| + HTMLFrameJavaScriptURLOpener();
|
| +
|
| + class Request : public RefCounted<Request> {
|
| + WTF_MAKE_NONCOPYABLE(Request); WTF_MAKE_FAST_ALLOCATED;
|
| + public:
|
| + explicit Request(PassRefPtr<HTMLFrameElementBase>);
|
| + ~Request();
|
| +
|
| + void setNameAndOpenURL();
|
| +
|
| + private:
|
| + RefPtr<HTMLFrameElementBase> m_element;
|
| + RefPtr<Document> m_document;
|
| + AtomicString m_lastURL;
|
| + };
|
|
|
| - WillBeHeapVector<RefPtrWillBeMember<File> > m_files;
|
| + Vector<RefPtr<Request> > m_requests;
|
| + bool m_enqueued;
|
| };
|
|
|
| -} // namespace WebCore
|
| +}
|
|
|
| -#endif // FileList_h
|
| +#endif
|
|
|