|
|
Chromium Code Reviews|
Created:
5 years ago by Olli Raula Modified:
5 years ago Reviewers:
Deprecated (see juliatuttle) CC:
chromium-reviews, cbentzel+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionRemove ScopedVector from prioritized_dispatcher_unittest
ScopedVector is deprecated.
BUG=554289
Committed: https://crrev.com/da99b3860fd79989d0e1a82bbe503ce422a202f3
Cr-Commit-Position: refs/heads/master@{#365788}
Patch Set 1 #Patch Set 2 : Only remove ScopedVector #Patch Set 3 : Fix include #Patch Set 4 : Move job owning to testcases #
Total comments: 3
Patch Set 5 : fixes #Messages
Total messages: 21 (9 generated)
Description was changed from ========== Simplify prioritized_dispatcher_unittest and remove ScopedVector Remove ScopedVector as it is unused and store TestJob in stack as we do not need pointers anywhere. BUG=554289 ========== to ========== Simplify prioritized_dispatcher_unittest and remove ScopedVector Remove ScopedVector as it is unused and we can store TestJob in stack because we do not need pointers anywhere. BUG=554289 ==========
olli.raula@intel.com changed reviewers: + ttuttle@chromium.org
Could you review? On 2015/12/08 08:06:53, Olli Raula wrote: > mailto:olli.raula@intel.com changed reviewers: > + mailto:ttuttle@chromium.org
On 2015/12/08 08:07:12, Olli Raula wrote: > Could you review? Hi Olli, I don't think your change works. You create a TestJob inside AddJob (allocated on the stack), call Add on it (which stores a pointer to it in the dispatcher), then return from AddJob, destroying the TestJob you created and returning a *copy*. You now have an invalid pointer inside the dispatcher. If you'd like to get rid of the ScopedVector, you could use individual scoped_ptrs for each TestJob instead, but that would be harder to read. What is your motivation for changing this test? Thanks, ttuttle
Description was changed from ========== Simplify prioritized_dispatcher_unittest and remove ScopedVector Remove ScopedVector as it is unused and we can store TestJob in stack because we do not need pointers anywhere. BUG=554289 ========== to ========== ScopedVector from prioritized_dispatcher_unittest BUG=554289 ==========
Hi, my motivation was remove ScopedVector and then I tried to simplify it more. Now it only changes ScopedVector to std::vector<scoped_ptr>>. Thanks
On 2015/12/10 07:36:11, Olli Raula wrote: > Hi, my motivation was remove ScopedVector and then I tried to simplify it more. > Now it only changes ScopedVector to std::vector<scoped_ptr>>. > > Thanks But why do you want to remove ScopedVector? Also, a std::vector<scoped_ptr> is worse than a ScopedVector; it does the same thing, but requires the awkward std::move every time you add elements. I meant using scoped_ptr inside each of the test cases, so they're deallocated when the test case finishes instead of when the test fixture object is destroyed.
> But why do you want to remove ScopedVector? You did not check the issue what I linked? ScopedVector is Deprecated, https://code.google.com/p/chromium/codesearch#chromium/src/base/memory/scoped... You can also see my commit history, I have bunch of these already committed.
Description was changed from ========== ScopedVector from prioritized_dispatcher_unittest BUG=554289 ========== to ========== Remove ScopedVector from prioritized_dispatcher_unittest BUG=554289 ==========
Could you please review this?
On 2015/12/15 07:04:51, Olli Raula wrote: > Could you please review this? And apologize my too direct words
On 2015/12/15 14:03:33, Olli Raula wrote: > On 2015/12/15 07:04:51, Olli Raula wrote: > > Could you please review this? > > And apologize my too direct words No worries -- sorry it dropped off my radar! I'd like a couple changes: 1. Please note that ScopedVector is deprecated in the change description, so it's obvious to anyone who sees it why you made the change. 2. Please move the scoped_ptr storage of the TestJobs into the test cases themselves. Right now, it appears that the test cases leak the TestJobs without a careful reading of the underlying class. (That is, have AddJob return a scoped_ptr<TestJob>, and declare the jobs as scoped_ptr<TestJob> in each of the test cases.)
Description was changed from ========== Remove ScopedVector from prioritized_dispatcher_unittest BUG=554289 ========== to ========== Remove ScopedVector from prioritized_dispatcher_unittest ScopedVector is deprecated. BUG=554289 ==========
lgtm if you fix the remaining nits. https://codereview.chromium.org/1510513002/diff/60001/net/base/prioritized_di... File net/base/prioritized_dispatcher_unittest.cc (right): https://codereview.chromium.org/1510513002/diff/60001/net/base/prioritized_di... net/base/prioritized_dispatcher_unittest.cc:6: #include <string> This is no longer needed, since you're not storing a vector in the test fixture at all. https://codereview.chromium.org/1510513002/diff/60001/net/base/prioritized_di... net/base/prioritized_dispatcher_unittest.cc:144: make_scoped_ptr(new TestJob(dispatcher_.get(), data, priority, &log_))); You don't need make_scoped_ptr here; scoped_ptr has a constructor that accepts (and takes ownership of) a raw pointer. https://codereview.chromium.org/1510513002/diff/60001/net/base/prioritized_di... net/base/prioritized_dispatcher_unittest.cc:151: make_scoped_ptr(new TestJob(dispatcher_.get(), data, priority, &log_))); Ditto.
The CQ bit was checked by olli.raula@intel.com
The patchset sent to the CQ was uploaded after l-g-t-m from ttuttle@chromium.org Link to the patchset: https://codereview.chromium.org/1510513002/#ps80001 (title: "fixes")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1510513002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1510513002/80001
Message was sent while issue was closed.
Description was changed from ========== Remove ScopedVector from prioritized_dispatcher_unittest ScopedVector is deprecated. BUG=554289 ========== to ========== Remove ScopedVector from prioritized_dispatcher_unittest ScopedVector is deprecated. BUG=554289 ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
Message was sent while issue was closed.
Description was changed from ========== Remove ScopedVector from prioritized_dispatcher_unittest ScopedVector is deprecated. BUG=554289 ========== to ========== Remove ScopedVector from prioritized_dispatcher_unittest ScopedVector is deprecated. BUG=554289 Committed: https://crrev.com/da99b3860fd79989d0e1a82bbe503ce422a202f3 Cr-Commit-Position: refs/heads/master@{#365788} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/da99b3860fd79989d0e1a82bbe503ce422a202f3 Cr-Commit-Position: refs/heads/master@{#365788} |
