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

Issue 2949103006: Removed RefPtr::Release. (Closed)

Created:
3 years, 6 months ago by Bugs Nash
Modified:
3 years, 5 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, dglazkov+blink, dshwang, drott+blinkwatch_chromium.org, krit, fmalita+watch_chromium.org, haraken, Justin Novosad, kinuko+watch, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Removed RefPtr::Release. Removed RefPtr::Release method and remaining uses of it, including: - Removed calls to RefPtr::Release in return statements that return a WebThreadSafeData object. Also added an initialising constructor for WebThreadSafeData that takes a RefPtr&& so that this return is valid. - Added move wraps for returned variables that are not automatically moved BUG=494719 Review-Url: https://codereview.chromium.org/2949103006 Cr-Commit-Position: refs/heads/master@{#482532} Committed: https://chromium.googlesource.com/chromium/src/+/dd68099cbb43f639901b84e0b38ad76509bacb6a

Patch Set 1 #

Total comments: 3

Patch Set 2 : rebased onto unit test changes #

Patch Set 3 : Removed Release from mac specific code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -8 lines) Patch
M third_party/WebKit/Source/core/exported/WebFrameSerializer.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/WebThreadSafeData.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/FontDataCache.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/wtf/RefPtr.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/public/platform/WebThreadSafeData.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 30 (18 generated)
Bugs Nash
3 years, 6 months ago (2017-06-23 05:29:53 UTC) #4
Bugs Nash
Note that this patch is also blocked on removing use of RefPtr::Release in unit tests.
3 years, 6 months ago (2017-06-23 05:39:57 UTC) #5
haraken
LGTM https://codereview.chromium.org/2949103006/diff/1/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp File third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp (right): https://codereview.chromium.org/2949103006/diff/1/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp#newcode130 third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp:130: return std::move(blob_data_handle_); If we forget adding std::move, what ...
3 years, 6 months ago (2017-06-23 05:59:50 UTC) #7
Bugs Nash
https://codereview.chromium.org/2949103006/diff/1/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp File third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp (right): https://codereview.chromium.org/2949103006/diff/1/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp#newcode130 third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp:130: return std::move(blob_data_handle_); On 2017/06/23 at 05:59:50, haraken wrote: > ...
3 years, 6 months ago (2017-06-23 06:09:49 UTC) #8
Yuta Kitamura
LGTM. My LGTM will stand as long as you only apply the similar fixes (i.e. ...
3 years, 6 months ago (2017-06-23 06:21:32 UTC) #9
Bugs Nash
rebased onto unit test changes
3 years, 6 months ago (2017-06-26 00:11:42 UTC) #10
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/2949103006/20001
3 years, 6 months ago (2017-06-26 00:23:28 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/449752)
3 years, 6 months ago (2017-06-26 00:48:36 UTC) #17
Bugs Nash
Removed Release from mac specific code
3 years, 5 months ago (2017-06-27 00:59:50 UTC) #18
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/2949103006/40001
3 years, 5 months ago (2017-06-27 03:33:49 UTC) #25
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/dd68099cbb43f639901b84e0b38ad76509bacb6a
3 years, 5 months ago (2017-06-27 03:38:21 UTC) #28
dcheng1
3 years, 5 months ago (2017-06-27 03:43:43 UTC) #30
Message was sent while issue was closed.
https://codereview.chromium.org/2949103006/diff/1/third_party/WebKit/Source/m...
File third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp (right):

https://codereview.chromium.org/2949103006/diff/1/third_party/WebKit/Source/m...
third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp:130: return
std::move(blob_data_handle_);
On 2017/06/23 06:09:49, Bugs Nash wrote:
> On 2017/06/23 at 05:59:50, haraken wrote:
> > If we forget adding std::move, what will happen?
> 
> ref churn - it will copy the RefPtr and the member will not be nullified (once
> the return type changes to RefPtr). While the return type is PassRefPtr the
> result is essentially the same but not through a simple copy.

It's worth noting that forgetting this could potentially be a functional bug: if
a function is called TakeBuffer() and it forgets to std::move() the buffer_
field, then the buffer won't have its ownership transferred out.

Powered by Google App Engine
This is Rietveld 408576698