Title: [157449] trunk/Source/WebCore
- Revision
- 157449
- Author
- [email protected]
- Date
- 2013-10-15 06:02:14 -0700 (Tue, 15 Oct 2013)
Log Message
FileIconLoader should not be ref-counted.
<https://webkit.org/b/122827>
FileIconLoader is singly-owned by FileInputType.
Reviewed by Antti Koivisto.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (157448 => 157449)
--- trunk/Source/WebCore/ChangeLog 2013-10-15 11:45:03 UTC (rev 157448)
+++ trunk/Source/WebCore/ChangeLog 2013-10-15 13:02:14 UTC (rev 157449)
@@ -1,5 +1,14 @@
2013-10-15 Andreas Kling <[email protected]>
+ FileIconLoader should not be ref-counted.
+ <https://webkit.org/b/122827>
+
+ FileIconLoader is singly-owned by FileInputType.
+
+ Reviewed by Antti Koivisto.
+
+2013-10-15 Andreas Kling <[email protected]>
+
RenderText should cache RenderStyle in locals more.
<https://webkit.org/b/122823>
Modified: trunk/Source/WebCore/html/FileInputType.cpp (157448 => 157449)
--- trunk/Source/WebCore/html/FileInputType.cpp 2013-10-15 11:45:03 UTC (rev 157448)
+++ trunk/Source/WebCore/html/FileInputType.cpp 2013-10-15 13:02:14 UTC (rev 157449)
@@ -344,7 +344,7 @@
if (m_fileIconLoader)
m_fileIconLoader->invalidate();
- m_fileIconLoader = FileIconLoader::create(this);
+ m_fileIconLoader = std::make_unique<FileIconLoader>(static_cast<FileIconLoaderClient&>(*this));
chrome->loadIconForFiles(paths, m_fileIconLoader.get());
}
Modified: trunk/Source/WebCore/html/FileInputType.h (157448 => 157449)
--- trunk/Source/WebCore/html/FileInputType.h 2013-10-15 11:45:03 UTC (rev 157448)
+++ trunk/Source/WebCore/html/FileInputType.h 2013-10-15 13:02:14 UTC (rev 157449)
@@ -90,7 +90,7 @@
void applyFileChooserSettings(const FileChooserSettings&);
RefPtr<FileChooser> m_fileChooser;
- RefPtr<FileIconLoader> m_fileIconLoader;
+ std::unique_ptr<FileIconLoader> m_fileIconLoader;
RefPtr<FileList> m_fileList;
RefPtr<Icon> m_icon;
Modified: trunk/Source/WebCore/html/forms/FileIconLoader.cpp (157448 => 157449)
--- trunk/Source/WebCore/html/forms/FileIconLoader.cpp 2013-10-15 11:45:03 UTC (rev 157448)
+++ trunk/Source/WebCore/html/forms/FileIconLoader.cpp 2013-10-15 13:02:14 UTC (rev 157449)
@@ -34,15 +34,9 @@
namespace WebCore {
-PassRefPtr<FileIconLoader> FileIconLoader::create(FileIconLoaderClient* client)
-{
- return adoptRef(new FileIconLoader(client));
-}
-
void FileIconLoader::invalidate()
{
ASSERT(m_client);
-
m_client = 0;
}
@@ -52,8 +46,8 @@
m_client->updateRendering(icon);
}
-FileIconLoader::FileIconLoader(FileIconLoaderClient* client)
- : m_client(client)
+FileIconLoader::FileIconLoader(FileIconLoaderClient& client)
+ : m_client(&client)
{
}
Modified: trunk/Source/WebCore/html/forms/FileIconLoader.h (157448 => 157449)
--- trunk/Source/WebCore/html/forms/FileIconLoader.h 2013-10-15 11:45:03 UTC (rev 157448)
+++ trunk/Source/WebCore/html/forms/FileIconLoader.h 2013-10-15 13:02:14 UTC (rev 157449)
@@ -45,17 +45,14 @@
virtual void updateRendering(PassRefPtr<Icon>) = 0;
};
-class FileIconLoader : public RefCounted<FileIconLoader> {
+class FileIconLoader {
public:
- static PassRefPtr<FileIconLoader> create(FileIconLoaderClient*);
+ explicit FileIconLoader(FileIconLoaderClient&);
void invalidate();
-
void notifyFinished(PassRefPtr<Icon>);
private:
- explicit FileIconLoader(FileIconLoaderClient*);
-
FileIconLoaderClient* m_client;
};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes