|
|
DescriptionPhase II Step 1: Remove updateImage() reentrancy around decodeError()
Design doc:
https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8bE/edit#heading=h.1rxkos5samv7
Previously, ImageResourceContent::updateImage() is reentered when
DecodeError occurred in ImageResource.
This CL removes the reentrancy and ImageResourceInfo::decodeError() by
1. making ImageResourceContent::updateImage() to return
ShouldDecodeError without calling notifyObservers()
when an decode error occurs,
2. then making ImageResource::updateImage() to call
ImageResource::decodeError(), and
3. then making ImageResource::decodeError() to call notifyObservers()
(via ImageResourceContent::updateImage()) if necessary.
This CL also adds DCHECK() for prohibiting reentering to
ImageResourceContent::updateImage().
In the case of a decode error inside didReceiveData(),
this CL removes one imageChanged() call, which looks unnecessary.
BUG=667641, 677188
Review-Url: https://codereview.chromium.org/2642823005
Cr-Commit-Position: refs/heads/master@{#451996}
Committed: https://chromium.googlesource.com/chromium/src/+/bd8c80c437ceaa8427186bbbbd3040ae17d6d13d
Patch Set 1 #Patch Set 2 : Fix the case of decode error with empty body #Patch Set 3 : Rebase. #Patch Set 4 : fix rebase errors #Patch Set 5 : Rebase #Patch Set 6 : Rebase. #Patch Set 7 : Rebase #Patch Set 8 : Rebase #Patch Set 9 : Rebase #Patch Set 10 : Rebase #Patch Set 11 : Rebase #Patch Set 12 : Rebase #
Total comments: 2
Patch Set 13 : Rebase. #Patch Set 14 : Rebase #
Depends on Patchset: Dependent Patchsets: Messages
Total messages: 68 (61 generated)
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Remove ImageResource::updateImage() reentrancy around decodeError() BUG= ========== to ========== Remove ImageResource::updateImage() reentrancy around decodeError() BUG=677188 ==========
Description was changed from ========== Remove ImageResource::updateImage() reentrancy around decodeError() BUG=677188 ========== to ========== Remove ImageResource::updateImage() reentrancy around decodeError() BUG=667641, 677188 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
Description was changed from ========== Remove ImageResource::updateImage() reentrancy around decodeError() BUG=667641, 677188 ========== to ========== Phase II Step 1: Remove updateImage() reentrancy around decodeError() BUG=667641, 677188 ==========
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...) chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
Description was changed from ========== Phase II Step 1: Remove updateImage() reentrancy around decodeError() BUG=667641, 677188 ========== to ========== Phase II Step 1: Remove updateImage() reentrancy around decodeError() Design doc: https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8... Previously, ImageResourceContent::updateImage() is reentered when DecodeError occurred in ImageResource. This CL removes the reentrancy by 1. making ImageResourceContent::updateImage() to return ShouldDecodeError without calling notifyObservers() when an decode error occurs, 2. then making ImageResource::updateImage() to call ImageResource::decodeError(), and 3. then making ImageResource::decodeError() to call notifyObservers() (via ImageResourceContent::updateImage()) if necessary. This CL also adds DCHECK() for prohibiting reentering to ImageResourceContent::updateImage(). In the case of a decode error inside didReceiveData(), this CL removes one imageChanged() call, which looks unnecessary. BUG=667641, 677188 ==========
Description was changed from ========== Phase II Step 1: Remove updateImage() reentrancy around decodeError() Design doc: https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8... Previously, ImageResourceContent::updateImage() is reentered when DecodeError occurred in ImageResource. This CL removes the reentrancy by 1. making ImageResourceContent::updateImage() to return ShouldDecodeError without calling notifyObservers() when an decode error occurs, 2. then making ImageResource::updateImage() to call ImageResource::decodeError(), and 3. then making ImageResource::decodeError() to call notifyObservers() (via ImageResourceContent::updateImage()) if necessary. This CL also adds DCHECK() for prohibiting reentering to ImageResourceContent::updateImage(). In the case of a decode error inside didReceiveData(), this CL removes one imageChanged() call, which looks unnecessary. BUG=667641, 677188 ========== to ========== Phase II Step 1: Remove updateImage() reentrancy around decodeError() Design doc: https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8... Previously, ImageResourceContent::updateImage() is reentered when DecodeError occurred in ImageResource. This CL removes the reentrancy and ImageResourceInfo::decodeError() by 1. making ImageResourceContent::updateImage() to return ShouldDecodeError without calling notifyObservers() when an decode error occurs, 2. then making ImageResource::updateImage() to call ImageResource::decodeError(), and 3. then making ImageResource::decodeError() to call notifyObservers() (via ImageResourceContent::updateImage()) if necessary. This CL also adds DCHECK() for prohibiting reentering to ImageResourceContent::updateImage(). In the case of a decode error inside didReceiveData(), this CL removes one imageChanged() call, which looks unnecessary. BUG=667641, 677188 ==========
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
hiroshige@chromium.org changed reviewers: + japhet@chromium.org, kouhei@chromium.org, yhirano@chromium.org
PTAL. https://codereview.chromium.org/2642823005/diff/220001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp (right): https://codereview.chromium.org/2642823005/diff/220001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:925: EXPECT_EQ(1, observer->imageChangedCount()); As mentioned in the design doc and CL description, the number of imageChanged() is decreased by one, which probably looks safe. https://codereview.chromium.org/2642823005/diff/220001/third_party/WebKit/Sou... third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp:1135: EXPECT_EQ(2, observer->imageChangedCount()); ditto.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
> (in the design doc) Also, we also refactor DecodeError handling because > there are timing dependencies between DecodeError handling and LoFi/Placeholder > reloading. Can you explain this a bit (either in the doc or here)? The reentrancy exists because updateImage handles three UpdateImageOptions; As it doesn't call decodeError with ClearAndNotifyObservers, splitting the function vanishes the reentrancy, right? If so, is it an option?
On 2017/01/25 09:50:04, yhirano wrote: > > (in the design doc) Also, we also refactor DecodeError handling because > > there are timing dependencies between DecodeError handling and > LoFi/Placeholder > > reloading. > > Can you explain this a bit (either in the doc or here)? > The reentrancy exists because updateImage handles three UpdateImageOptions; As > it doesn't call decodeError with ClearAndNotifyObservers, splitting the function > vanishes the reentrancy, right? No. updateImage(UpdateImage) is reentered. Particularly, - The first updateImage(UpdateImage, false) causes DecodeError, and calls decodeError(). The Image::setData() call at Line 364 is needed here. - The second (reentered) updateImage(UpdateImage, true) handles Placeholder processing (Lines 373--387 in the current implementation). Both of them (Line 364 and Lines 373--387) are done in (ClearAnd)UpdateImage options, so splitting ClearAndNotifyObservers out as a different function doesn't resolve the reentrancy. Also, this CL removes a call from ImageResourceContent to ImageResource (via ImageResourceInfo::decodeError()), i.e. removes a Content->Resource->Content call chain. (I'd like to make things flow in Resource->Content direction, not Content->Resource (via ImageResourceInfo)) If we just split updateImage() into two parts, we'll still have Content->Resource->Content call chain here (although direct reentrance to the same method is removed).
Thanks, lgtm.
The CQ bit was checked by hiroshige@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
This CL has an open dependency (Issue 2650543003 Patch 120001). Please resolve the dependency and try again. If you are sure that there is no real dependency, please use one of the options listed in https://goo.gl/9Es4OR to land the CL.
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was unchecked by hiroshige@chromium.org
The CQ bit was checked by hiroshige@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by hiroshige@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from yhirano@chromium.org Link to the patchset: https://codereview.chromium.org/2642823005/#ps260001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 260001, "attempt_start_ts": 1487748785312520, "parent_rev": "2c5c012360a9213b6895ce6c79fa62f941c2bd20", "commit_rev": "bd8c80c437ceaa8427186bbbbd3040ae17d6d13d"}
Message was sent while issue was closed.
Description was changed from ========== Phase II Step 1: Remove updateImage() reentrancy around decodeError() Design doc: https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8... Previously, ImageResourceContent::updateImage() is reentered when DecodeError occurred in ImageResource. This CL removes the reentrancy and ImageResourceInfo::decodeError() by 1. making ImageResourceContent::updateImage() to return ShouldDecodeError without calling notifyObservers() when an decode error occurs, 2. then making ImageResource::updateImage() to call ImageResource::decodeError(), and 3. then making ImageResource::decodeError() to call notifyObservers() (via ImageResourceContent::updateImage()) if necessary. This CL also adds DCHECK() for prohibiting reentering to ImageResourceContent::updateImage(). In the case of a decode error inside didReceiveData(), this CL removes one imageChanged() call, which looks unnecessary. BUG=667641, 677188 ========== to ========== Phase II Step 1: Remove updateImage() reentrancy around decodeError() Design doc: https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8... Previously, ImageResourceContent::updateImage() is reentered when DecodeError occurred in ImageResource. This CL removes the reentrancy and ImageResourceInfo::decodeError() by 1. making ImageResourceContent::updateImage() to return ShouldDecodeError without calling notifyObservers() when an decode error occurs, 2. then making ImageResource::updateImage() to call ImageResource::decodeError(), and 3. then making ImageResource::decodeError() to call notifyObservers() (via ImageResourceContent::updateImage()) if necessary. This CL also adds DCHECK() for prohibiting reentering to ImageResourceContent::updateImage(). In the case of a decode error inside didReceiveData(), this CL removes one imageChanged() call, which looks unnecessary. BUG=667641, 677188 Review-Url: https://codereview.chromium.org/2642823005 Cr-Commit-Position: refs/heads/master@{#451996} Committed: https://chromium.googlesource.com/chromium/src/+/bd8c80c437ceaa8427186bbbbd30... ==========
Message was sent while issue was closed.
Committed patchset #14 (id:260001) as https://chromium.googlesource.com/chromium/src/+/bd8c80c437ceaa8427186bbbbd30... |