Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Issue 2125853002: Replace RefPtrs with raw pointers (imageFromNode in Editor.cpp) (Closed)

Created:
4 years, 5 months ago by hajimehoshi
Modified:
4 years, 5 months ago
CC:
chromium-reviews, tyoshino+watch_chromium.org, dshwang, ajuma+watch-canvas_chromium.org, blink-reviews-html_chromium.org, Justin Novosad, loading-reviews_chromium.org, dglazkov+blink, Rik, gavinp+loader_chromium.org, blink-reviews, Nate Chapin
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace RefPtrs with raw pointers (imageFromNode in Editor.cpp) imageFromNode in Editor.cpp now returns a RefPtr to an Image, but this function creates a return value from ImageResource::getImage(), which returns a raw pointer to ImageResource::m_image. To reduce unnecessary refs of that field, this CL replaces (Pass)RefPtrs with raw pointers. The goal is to change ImageResource::m_image to be a unique_ptr, and this CL is one of all steps. BUG=n/a TEST=webkit_unit_tests --gtest_filter=CanvasRenderingContext2DTest.* CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Patch Set 1 : impl #

Total comments: 5

Patch Set 2 : (rebase) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -16 lines) Patch
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 3 chunks +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 5 chunks +14 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 19 (8 generated)
hajimehoshi
PTAL haraken: core/ kbr: modules/webgl
4 years, 5 months ago (2016-07-06 12:35:17 UTC) #5
haraken
https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.h File third_party/WebKit/Source/core/html/HTMLCanvasElement.h (right): https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.h#newcode267 third_party/WebKit/Source/core/html/HTMLCanvasElement.h:267: mutable RefPtr<Image> m_transparentImage; Why do we need to keep ...
4 years, 5 months ago (2016-07-06 12:46:44 UTC) #6
Ken Russell (switch to Gerrit)
+junov, who should review this and provide guidance too. https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp File third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp#newcode1197 third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:1197: ...
4 years, 5 months ago (2016-07-06 21:37:04 UTC) #8
hajimehoshi
https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp File third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp#newcode1197 third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:1197: return m_transparentImage.get(); On 2016/07/06 21:37:04, Ken Russell wrote: > ...
4 years, 5 months ago (2016-07-07 10:53:07 UTC) #9
haraken
https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.h File third_party/WebKit/Source/core/html/HTMLCanvasElement.h (right): https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.h#newcode267 third_party/WebKit/Source/core/html/HTMLCanvasElement.h:267: mutable RefPtr<Image> m_transparentImage; On 2016/07/07 10:53:07, hajimehoshi wrote: > ...
4 years, 5 months ago (2016-07-07 11:00:56 UTC) #10
hajimehoshi
On 2016/07/07 11:00:56, haraken wrote: > https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.h > File third_party/WebKit/Source/core/html/HTMLCanvasElement.h (right): > > https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.h#newcode267 > ...
4 years, 5 months ago (2016-07-07 11:08:54 UTC) #11
hajimehoshi
On 2016/07/07 11:08:54, hajimehoshi wrote: > On 2016/07/07 11:00:56, haraken wrote: > > > https://codereview.chromium.org/2125853002/diff/20001/third_party/WebKit/Source/core/html/HTMLCanvasElement.h ...
4 years, 5 months ago (2016-07-07 11:10:03 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2125853002/20001
4 years, 5 months ago (2016-07-07 11:17:19 UTC) #14
haraken
On 2016/07/07 11:10:03, hajimehoshi wrote: > On 2016/07/07 11:08:54, hajimehoshi wrote: > > On 2016/07/07 ...
4 years, 5 months ago (2016-07-07 11:18:02 UTC) #15
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/32106) ios-device-gn on ...
4 years, 5 months ago (2016-07-07 11:18:58 UTC) #17
hajimehoshi
4 years, 5 months ago (2016-07-07 12:19:07 UTC) #19
We chatted in hangout and concluded that it is difficult to change
ImageResource::m_image to be a unique_ptr. This would require Image not to be
RefCounted and functions like copiedImage which return either a new image or an
image owned by an object to be rewritten. Let me close this CL.

Powered by Google App Engine
This is Rietveld 408576698