WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
153910
Clean up Blob code
https://bugs.webkit.org/show_bug.cgi?id=153910
Summary
Clean up Blob code
Alex Christensen
Reported
2016-02-04 21:28:28 PST
Clean up Blob code
Attachments
Patch
(16.88 KB, patch)
2016-02-04 21:37 PST
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(22.80 KB, patch)
2016-02-04 22:42 PST
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(20.34 KB, patch)
2016-02-04 22:51 PST
,
Alex Christensen
ap
: review+
ap
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Alex Christensen
Comment 1
2016-02-04 21:37:58 PST
Created
attachment 270725
[details]
Patch
Alex Christensen
Comment 2
2016-02-04 22:42:51 PST
Created
attachment 270736
[details]
Patch
Alex Christensen
Comment 3
2016-02-04 22:51:30 PST
Created
attachment 270737
[details]
Patch
Alexey Proskuryakov
Comment 4
2016-02-04 23:01:09 PST
Comment on
attachment 270737
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=270737&action=review
> Source/WebCore/fileapi/Blob.h:79 > +#ifndef NDEBUG
If this is for assertions only, then it should be using ASSERT_DISABLED macro (name from memory).
> Source/WebCore/platform/network/BlobRegistry.h:69 > + virtual ~BlobRegistry() { };
This is not an improvement - constructors and destructors of polymorphic classes should not be inline, because of code size bloat.
> Source/WebCore/platform/network/BlobRegistryImpl.cpp:78 > + return nullptr;
Does return value optimization work in functions with multiple exit points?
> Source/WebCore/platform/network/BlobRegistryImpl.h:70 > + HashMap<URL, RefPtr<BlobData>> m_blobs;
Why is this better? URL is a large object. Do we waste time reparsing them later?
Alex Christensen
Comment 5
2016-02-05 08:46:15 PST
Comment on
attachment 270737
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=270737&action=review
>> Source/WebCore/platform/network/BlobRegistryImpl.cpp:78 >> + return nullptr; > > Does return value optimization work in functions with multiple exit points?
Yes.
> Source/WebCore/platform/network/BlobRegistryImpl.cpp:149 > - if (!m_blobs.contains(part.url().string())) > + if (!m_blobs.contains(part.url())) > return; > - for (const BlobDataItem& item : m_blobs.get(part.url().string())->items()) > + for (const BlobDataItem& item : m_blobs.get(part.url())->items())
I am going to make this only lookup the url once in the HashMap, though.
>> Source/WebCore/platform/network/BlobRegistryImpl.h:70 >> + HashMap<URL, RefPtr<BlobData>> m_blobs; > > Why is this better? URL is a large object. Do we waste time reparsing them later?
I thought it was more clear, and we don't reparse them, but you're right: this is a memory regression.
Alex Christensen
Comment 6
2016-02-05 08:57:26 PST
http://trac.webkit.org/changeset/196174
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug