Bug 110759

Summary: [chromium] Flatten LazyDecodingPixelRef to SkData
Product: WebKit Reporter: Hin-Chung Lam <hclam>
Component: ImagesAssignee: scroggo
Status: RESOLVED FIXED    
Severity: Normal CC: cc-bugs, jamesr, scroggo, senorblanco, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Implement onRefEncodedData
benjamin: review-
patch implementing onRefEncodedData
none
Implement onRefEncodedData.
senorblanco: review+, webkit.review.bot: commit-queue-
Implement onRefEncodedData none

Hin-Chung Lam
Reported 2013-02-25 08:09:24 PST
LazyDecodingPixelRef should be serialized to SkData such that it can be recorded as SKP.
Attachments
Implement onRefEncodedData (2.82 KB, patch)
2013-03-15 15:03 PDT, scroggo
benjamin: review-
patch implementing onRefEncodedData (4.36 KB, patch)
2013-03-18 11:39 PDT, scroggo
no flags
Implement onRefEncodedData. (4.42 KB, patch)
2013-03-18 14:16 PDT, scroggo
senorblanco: review+
webkit.review.bot: commit-queue-
Implement onRefEncodedData (4.62 KB, patch)
2013-03-19 11:01 PDT, scroggo
no flags
scroggo
Comment 1 2013-03-15 15:03:27 PDT
Created attachment 193378 [details] Implement onRefEncodedData
Hin-Chung Lam
Comment 2 2013-03-15 15:24:12 PDT
Comment on attachment 193378 [details] Implement onRefEncodedData View in context: https://bugs.webkit.org/attachment.cgi?id=193378&action=review > platform/graphics/chromium/ImageFrameGenerator.cpp:72 > + m_data.data(data, allDataReceived); Call m_data, make a copy and pass it out. > platform/graphics/chromium/ImageFrameGenerator.h:68 > + void data(SharedBuffer**, bool* allDataReceived); Please change this to RefPtr<SharedBuffer>*, bool*. I would like to make a new copy of SharedBuffer, the data is really an internal data structure and shouldn't be given out directly. > platform/graphics/chromium/LazyDecodingPixelRef.cpp:61 > + SharedBuffer* buffer = 0; Change this to RefPtr<SharedBuffer> buffer. It will catch the new object from ImageFrameGenerator. > platform/graphics/chromium/LazyDecodingPixelRef.cpp:63 > + m_mutex.lock(); There's no need to lock here. m_frameGenerator is always valid and it gives us a new copy of SharedBuffer.
Hin-Chung Lam
Comment 3 2013-03-15 15:24:45 PDT
The patch also has a merge problem. Please merge and upload.
scroggo
Comment 4 2013-03-18 11:39:39 PDT
Created attachment 193617 [details] patch implementing onRefEncodedData
scroggo
Comment 5 2013-03-18 11:40:02 PDT
Comment on attachment 193378 [details] Implement onRefEncodedData View in context: https://bugs.webkit.org/attachment.cgi?id=193378&action=review >> platform/graphics/chromium/ImageFrameGenerator.cpp:72 >> + m_data.data(data, allDataReceived); > > Call m_data, make a copy and pass it out. Done. >> platform/graphics/chromium/ImageFrameGenerator.h:68 >> + void data(SharedBuffer**, bool* allDataReceived); > > Please change this to RefPtr<SharedBuffer>*, bool*. I would like to make a new copy of SharedBuffer, the data is really an internal data structure and shouldn't be given out directly. Done >> platform/graphics/chromium/LazyDecodingPixelRef.cpp:61 >> + SharedBuffer* buffer = 0; > > Change this to RefPtr<SharedBuffer> buffer. It will catch the new object from ImageFrameGenerator. Done. >> platform/graphics/chromium/LazyDecodingPixelRef.cpp:63 >> + m_mutex.lock(); > > There's no need to lock here. m_frameGenerator is always valid and it gives us a new copy of SharedBuffer. Done
Hin-Chung Lam
Comment 6 2013-03-18 11:51:03 PDT
Comment on attachment 193617 [details] patch implementing onRefEncodedData LGTM.
scroggo
Comment 7 2013-03-18 14:16:33 PDT
Created attachment 193649 [details] Implement onRefEncodedData. Fixes some style violations from the last patch.
Stephen White
Comment 8 2013-03-18 15:06:06 PDT
Comment on attachment 193649 [details] Implement onRefEncodedData. View in context: https://bugs.webkit.org/attachment.cgi?id=193649&action=review OK. r=me > Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp:70 > +void ImageFrameGenerator::data(RefPtr<SharedBuffer>* data, bool* allDataReceived) Naming nit: IWBN if this method had a verb in its name. It looks kind of like a getter, but it seems to have side-effects.
scroggo
Comment 9 2013-03-18 15:23:43 PDT
I actually agree, but I named it data() to be consistent with ThreadSafeDataTransport::data(), which it calls (and to which it behaves similarly). Do you have a suggestion? getData()? (That does not make it clear that it has a potential side effect though.)
WebKit Review Bot
Comment 10 2013-03-19 10:16:04 PDT
Comment on attachment 193649 [details] Implement onRefEncodedData. Rejecting attachment 193649 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=webkit-commit-queue.appspot.com', '--bot-id=gce-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 193649, '--port=chromium-xvfb']" exit_code: 2 cwd: /mnt/git/webkit-commit-queue Last 500 characters of output: /WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp Hunk #1 FAILED at 29. Hunk #2 succeeded at 56 with fuzz 1 (offset 1 line). 1 out of 2 hunks FAILED -- saving rejects to file Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp.rej patching file Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', '--force', '--reviewer', 'Stephen White']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue Full output: http://webkit-commit-queue.appspot.com/results/17209444
scroggo
Comment 11 2013-03-19 11:01:15 PDT
Created attachment 193866 [details] Implement onRefEncodedData Changed data() to copyData() and merged with latest.
Stephen White
Comment 12 2013-03-19 11:05:35 PDT
Comment on attachment 193866 [details] Implement onRefEncodedData Thanks for the name change. Looks good (bots willing). r=me
WebKit Review Bot
Comment 13 2013-03-19 11:47:43 PDT
Comment on attachment 193866 [details] Implement onRefEncodedData Clearing flags on attachment: 193866 Committed r146228: <http://trac.webkit.org/changeset/146228>
WebKit Review Bot
Comment 14 2013-03-19 11:47:47 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.