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

Issue 2204383003: Make blink::JSONValue (and subclasses) use unique_ptr rather than RefPtrs. (Closed)

Created:
4 years, 4 months ago by iclelland
Modified:
4 years, 4 months ago
Reviewers:
jbroman
CC:
jbroman, ajuma+watch_chromium.org, apavlov+blink_chromium.org, blink-layers+watch_chromium.org, blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-html_chromium.org, blink-reviews-layout_chromium.org, blink-reviews-platform-graphics_chromium.org, Rik, caseq+blink_chromium.org, chromium-reviews, danakj+watch_chromium.org, devtools-reviews_chromium.org, dglazkov+blink, dshwang, drott+blinkwatch_chromium.org, krit, eae+blinkwatch, f(malita), haraken, jchaffraix+rendering, Justin Novosad, kinuko+watch, kinuko+fileapi, kozyatinskiy+blink_chromium.org, leviw+renderwatch, loading-reviews+parser_chromium.org, lushnikov+blink_chromium.org, nhiroki, pdr+renderingwatchlist_chromium.org, pdr+graphicswatchlist_chromium.org, pfeldman+blink_chromium.org, rwlbuis, Stephen Chennney, szager+layoutwatch_chromium.org, tzik, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make blink::JSONValue (and subclasses) use unique_ptr rather than RefPtrs. Some groundwork for this change was started back in February, but the transition was never actually made. (See https://crrev.com/ffa7f6f) BUG=

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+247 lines, -238 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/JSONValuesForV8.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/JSONValuesForV8.cpp View 3 chunks +9 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/XSSAuditorDelegate.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/filesystem/DevToolsHostFileSystem.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/nfc/NFC.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/payments/PaymentRequest.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/JSONValues.h View 8 chunks +48 lines, -47 lines 1 comment Download
M third_party/WebKit/Source/platform/JSONValues.cpp View 6 chunks +30 lines, -27 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsLayer.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp View 6 chunks +35 lines, -35 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/LoggingCanvas.h View 2 chunks +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp View 37 chunks +89 lines, -88 lines 1 comment Download
M third_party/WebKit/Source/platform/graphics/PictureSnapshot.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp View 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 8 (6 generated)
iclelland
+r jbroman -- Can you PTAL? There's a lot of std::move()ing going on, and I ...
4 years, 4 months ago (2016-08-04 14:53:32 UTC) #5
jbroman
4 years, 4 months ago (2016-08-04 15:17:31 UTC) #6
lgtm

If there's a relevant bug for this work, please update the BUG= line.

https://codereview.chromium.org/2204383003/diff/1/third_party/WebKit/Source/p...
File third_party/WebKit/Source/platform/JSONValues.h (right):

https://codereview.chromium.org/2204383003/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/JSONValues.h:58:
WTF_MAKE_NONCOPYABLE(JSONValue);
You may also want USING_FAST_MALLOC(JSONValue), as RefCounted<T> are allocated
with partition alloc by default, whereas this moves it to the malloc allocator.

https://codereview.chromium.org/2204383003/diff/1/third_party/WebKit/Source/p...
File third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp (right):

https://codereview.chromium.org/2204383003/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp:844:
std::unique_ptr<JSONArray> LoggingCanvas::log()
nit: All of the existing call sites seem to stop drawing to the canvas at this
point; do we actually need to create a new log, or could we just "return
std::move(m_log);" with a comment that the canvas cannot be used after this
point? I don't feel strongly.

super-nit: If we do want this logic, I personally find it somewhat cleaner to
avoid std::swap (so that "originalLog" only ever contains the original log).
WDYT?

std::unique_ptr<JSONArray> originalLog = std::move(m_log);
m_log = JSONArray::create();
return originalLog;

Powered by Google App Engine
This is Rietveld 408576698