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

Issue 2696703008: Adds RefPtr::leakRef method to allow raw pointers that prevent destruct. (Closed)

Created:
3 years, 10 months ago by Bugs Nash
Modified:
3 years, 10 months ago
Reviewers:
Yuta Kitamura
CC:
blink-reviews, blink-reviews-wtf_chromium.org, chromium-reviews, Mikhail
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adds RefPtr::leakRef method to allow raw pointers that prevent destruct. Part of the removal of PassRefPtr. Adds RefPtr::leakRef method which returns a raw pointer while maintaining a ref to the RefCounted object. This creates a hanging ref on the object. RefPtr::leakRef is intended to replace PassRefPtr::leakRef. Also replaces all conversions of RefPtr objects to PassRefPtr objects in order to use PassRefPtr::leakRef (i.e. through .release().leakRef()) with direct usage of the new RefPtr::leakRef method. BUG=494719 Review-Url: https://codereview.chromium.org/2696703008 Cr-Commit-Position: refs/heads/master@{#451658} Committed: https://chromium.googlesource.com/chromium/src/+/1da78e8df793d7a431a3f29662e59116736a7cd5

Patch Set 1 #

Patch Set 2 : Added unit test for new RefPtr::leakRef method. #

Patch Set 3 : Added deref in RefPtrTest.LeakRef to avoid memory leak. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -5 lines) Patch
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/wtf/PassRefPtr.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/wtf/RefPtr.h View 2 chunks +8 lines, -1 line 0 comments Download
M third_party/WebKit/Source/wtf/RefPtrTest.cpp View 1 2 1 chunk +13 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/wtf/text/AtomicStringTable.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 26 (18 generated)
Bugs Nash
3 years, 10 months ago (2017-02-16 02:29:48 UTC) #7
Yuta Kitamura
lgtm
3 years, 10 months ago (2017-02-16 05:48:42 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2696703008/20001
3 years, 10 months ago (2017-02-17 00:43:24 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/121283)
3 years, 10 months ago (2017-02-17 05:28:27 UTC) #15
Bugs Nash
https://codereview.chromium.org/2696703008/diff/40001/third_party/WebKit/Source/wtf/RefPtrTest.cpp File third_party/WebKit/Source/wtf/RefPtrTest.cpp (right): https://codereview.chromium.org/2696703008/diff/40001/third_party/WebKit/Source/wtf/RefPtrTest.cpp#newcode32 third_party/WebKit/Source/wtf/RefPtrTest.cpp:32: leaked->deref(); Needed to add this line to prevent memory ...
3 years, 10 months ago (2017-02-20 01:53:38 UTC) #20
Yuta Kitamura
Still LGTM
3 years, 10 months ago (2017-02-20 06:06:41 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2696703008/40001
3 years, 10 months ago (2017-02-20 20:34:01 UTC) #23
commit-bot: I haz the power
3 years, 10 months ago (2017-02-20 20:39:09 UTC) #26
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/1da78e8df793d7a431a3f29662e5...

Powered by Google App Engine
This is Rietveld 408576698