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

Issue 1308013005: Add scoped_ptr-safe base::Value to Dictionary/List conversion functions. (Closed)

Created:
5 years, 3 months ago by Reilly Grant (use Gerrit)
Modified:
5 years, 3 months ago
Reviewers:
Lei Zhang, Evan Stade
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add scoped_ptr-safe base::Value to Dictionary/List conversion functions. This change adds two static From() functions to the DictionaryValue and ListValue classes which take a scoped_ptr to a Value and either convert it to a scoped_ptr to a DictionaryValue or ListValue, or return nullptr. These are intended to replace the existing pattern, make_scoped_ptr(static_cast<base::DictionaryValue*>(value.release())) with the shorter and safer alternative, base::DictionaryValue::From(value.Pass()) Instances of this pattern in //extensions have been converted as examples. Committed: https://crrev.com/259c0a3f44bdd8130c5d835e9f596624a079fbd1 Cr-Commit-Position: refs/heads/master@{#348294}

Patch Set 1 #

Patch Set 2 : Made conversions static members. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -50 lines) Patch
M base/values.h View 1 2 chunks +6 lines, -0 lines 0 comments Download
M base/values.cc View 1 2 chunks +20 lines, -0 lines 0 comments Download
M extensions/browser/api/sockets_tcp/sockets_tcp_apitest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/browser/api/sockets_tcp_server/sockets_tcp_server_apitest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/browser/api_test_utils.cc View 1 2 chunks +2 lines, -10 lines 0 comments Download
M extensions/common/extension_api.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M extensions/common/features/json_feature_provider_source.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/common/file_util.h View 1 chunk +4 lines, -3 lines 0 comments Download
M extensions/common/file_util.cc View 1 3 chunks +7 lines, -6 lines 0 comments Download
M extensions/common/file_util_unittest.cc View 1 4 chunks +7 lines, -10 lines 0 comments Download
M extensions/renderer/event_bindings.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc View 1 2 chunks +4 lines, -6 lines 0 comments Download
M extensions/utility/unpacker.h View 1 chunk +1 line, -2 lines 0 comments Download
M extensions/utility/unpacker.cc View 1 4 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 15 (3 generated)
Reilly Grant (use Gerrit)
What do you think of these new wrappers?
5 years, 3 months ago (2015-09-08 19:46:59 UTC) #2
Lei Zhang
Or maybe as: static scoped_ptr<DictionaryValue> DictionaryValue::CreateFrom(scoped_ptr<Value> value) ? +estade for his opinion
5 years, 3 months ago (2015-09-08 20:25:55 UTC) #4
Reilly Grant (use Gerrit)
On 2015/09/08 20:25:55, Lei Zhang wrote: > Or maybe as: > static scoped_ptr<DictionaryValue> DictionaryValue::CreateFrom(scoped_ptr<Value> > ...
5 years, 3 months ago (2015-09-08 20:33:10 UTC) #5
Evan Stade
On 2015/09/08 20:33:10, Reilly Grant wrote: > On 2015/09/08 20:25:55, Lei Zhang wrote: > > ...
5 years, 3 months ago (2015-09-08 21:12:27 UTC) #6
Reilly Grant (use Gerrit)
On 2015/09/08 21:12:27, Evan Stade wrote: > On 2015/09/08 20:33:10, Reilly Grant wrote: > > ...
5 years, 3 months ago (2015-09-10 19:38:52 UTC) #7
Lei Zhang
On 2015/09/10 19:38:52, Reilly Grant wrote: > So, these new functions are good as they ...
5 years, 3 months ago (2015-09-10 21:01:22 UTC) #8
Reilly Grant (use Gerrit)
On 2015/09/10 21:01:22, Lei Zhang wrote: > On 2015/09/10 19:38:52, Reilly Grant wrote: > > ...
5 years, 3 months ago (2015-09-10 22:16:05 UTC) #9
Lei Zhang
lgtm
5 years, 3 months ago (2015-09-10 22:21:18 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1308013005/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1308013005/20001
5 years, 3 months ago (2015-09-10 23:05:22 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 3 months ago (2015-09-11 00:25:59 UTC) #13
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/259c0a3f44bdd8130c5d835e9f596624a079fbd1 Cr-Commit-Position: refs/heads/master@{#348294}
5 years, 3 months ago (2015-09-11 00:26:47 UTC) #14
commit-bot: I haz the power
5 years, 3 months ago (2015-09-23 12:16:52 UTC) #15
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/259c0a3f44bdd8130c5d835e9f596624a079fbd1
Cr-Commit-Position: refs/heads/master@{#348294}

Powered by Google App Engine
This is Rietveld 408576698