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

Issue 2807073002: Removed local RefPtr objects created from PassRefPtr arguments. (Closed)

Created:
3 years, 8 months ago by Bugs Nash
Modified:
3 years, 8 months ago
Reviewers:
haraken, Yuta Kitamura
CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-frames_chromium.org, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, dshwang, drott+blinkwatch_chromium.org, krit, fmalita+watch_chromium.org, gavinp+loader_chromium.org, Nate Chapin, Justin Novosad, kinuko+watch, loading-reviews+fetch_chromium.org, loading-reviews_chromium.org, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney, tyoshino+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Removed local RefPtr objects created from PassRefPtr arguments. Removed local RefPtr objects created from PassRefPtr arguments and converted the PassRefPtr arguments to RefPtr. This patch deals with one specific corner case of copying PassRefPtr objects to RefPtr objects, where PassRefPtr arguments are copied into local RefPtr objects to be used throughout the function. All instances of PassRefPtr objects being copied into RefPtr objects need to be wrapped in std::move to avoid introducing ref churn in future changes when all PassRefPtr objects will be replaced with RefPtr objects. In these cases of creating a local RefPtr just to copy the PassRefPtr argument into, a std::move wrap doesn't make sense as it would result in a final state where a RefPtr argument is moved into a local RefPtr for no reason. So to handle these cases I have converted the PassRefPtr arguments to RefPtr in advance, and removed the local RefPtr argumen, instead using the passed RefPtr throughout the methods. In most cases the RefPtr argument name has been changed to match the previousf name of the local RefPtr. The syntax of the local RefPtr variables have also been changed to use std::move wraps instead of calling RefPtr::Release in cases where the RefPtr is no longer needed locally after passing. Note that std::move wraps have been introduced in some cases where RefPtr::Release() was not being called but should have been. BUG=494719 Review-Url: https://codereview.chromium.org/2807073002 Cr-Commit-Position: refs/heads/master@{#463565} Committed: https://chromium.googlesource.com/chromium/src/+/ad3dfab7e0e948209a3a68e1900a038c86182502

Patch Set 1 #

Total comments: 3

Patch Set 2 : addressed review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -44 lines) Patch
M third_party/WebKit/Source/core/frame/ImageBitmap.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 chunk +3 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp View 3 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h View 2 chunks +5 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp View 2 chunks +2 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageSource.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageSource.cpp View 1 chunk +1 line, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp View 2 chunks +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp View 1 2 chunks +1 line, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/network/NetworkStateNotifier.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/network/NetworkStateNotifier.cpp View 4 chunks +6 lines, -9 lines 0 comments Download

Messages

Total messages: 17 (9 generated)
Bugs Nash
3 years, 8 months ago (2017-04-10 05:49:20 UTC) #4
haraken
LGTM
3 years, 8 months ago (2017-04-10 06:49:22 UTC) #5
Yuta Kitamura
https://codereview.chromium.org/2807073002/diff/1/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp File third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp (left): https://codereview.chromium.org/2807073002/diff/1/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp#oldcode487 third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp:487: RefPtr<SecurityOrigin> new_security_origin = current_security_origin; I think the removal of ...
3 years, 8 months ago (2017-04-10 07:00:11 UTC) #6
Bugs Nash
https://codereview.chromium.org/2807073002/diff/1/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp File third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp (left): https://codereview.chromium.org/2807073002/diff/1/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp#oldcode487 third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp:487: RefPtr<SecurityOrigin> new_security_origin = current_security_origin; On 2017/04/10 at 07:00:11, Yuta ...
3 years, 8 months ago (2017-04-11 01:47:51 UTC) #9
Yuta Kitamura
LGTM w/ nit. https://codereview.chromium.org/2807073002/diff/1/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp File third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp (left): https://codereview.chromium.org/2807073002/diff/1/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp#oldcode487 third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp:487: RefPtr<SecurityOrigin> new_security_origin = current_security_origin; Ah I ...
3 years, 8 months ago (2017-04-11 05:49:39 UTC) #10
Bugs Nash
On 2017/04/11 at 05:49:39, yutak wrote: > LGTM w/ nit. > > https://codereview.chromium.org/2807073002/diff/1/third_party/WebKit/Source/platform/loader/fetch/CrossOriginAccessControl.cpp > File ...
3 years, 8 months ago (2017-04-11 06:05:36 UTC) #11
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/2807073002/20001
3 years, 8 months ago (2017-04-11 06:06:22 UTC) #14
commit-bot: I haz the power
3 years, 8 months ago (2017-04-11 07:32:28 UTC) #17
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/ad3dfab7e0e948209a3a68e1900a...

Powered by Google App Engine
This is Rietveld 408576698