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

Issue 2627863002: Split Closure part of TestPendingTask out of the struct (Closed)

Created:
3 years, 11 months ago by tzik
Modified:
3 years, 11 months ago
Reviewers:
dcheng
CC:
chromium-reviews, cbentzel+watch_chromium.org, chromium-apps-reviews_chromium.org, cc-bugs_chromium.org, extensions-reviews_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Split Closure part of TestPendingTask out of the struct This CL extracts base::Closure out of TestPendingTask, and convert it to base::OnceClosure. OnceClosure is a move-only and call-once variant of Callback, that we want to replace Closure with it. Since OnceClosure is noncopyable and needs to be non const to run. However in general, once we put an object into std::priority_queue or std::set, we can't take it from the container without const qualifier. To avoid it, this CL splits TestPendingTask into TestPendingTaskInfo and OnceClosure, so that we can store and take the non-const OnceClosure object using TestPendingTaskInfo as the key. CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Patch Set 1 #

Patch Set 2 : fix #

Patch Set 3 : fix #

Patch Set 4 : test_pending_task{.h,.cc,_unittest.cc} -> test_pending_task_info{.h,.cc,_unittest.cc} #

Patch Set 5 : win build fix #

Patch Set 6 : win build fix #

Patch Set 7 : win build fix #

Patch Set 8 : clean up #

Patch Set 9 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -485 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M base/test/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M base/test/scoped_mock_time_message_loop_task_runner.cc View 1 2 3 4 5 6 7 2 chunks +16 lines, -4 lines 0 comments Download
M base/test/scoped_mock_time_message_loop_task_runner_unittest.cc View 1 2 3 4 5 6 7 4 chunks +25 lines, -17 lines 0 comments Download
M base/test/test_mock_time_task_runner.h View 1 2 3 4 chunks +9 lines, -9 lines 0 comments Download
M base/test/test_mock_time_task_runner.cc View 1 2 3 4 5 6 7 7 chunks +57 lines, -50 lines 0 comments Download
M base/test/test_pending_task.h View 1 2 3 1 chunk +0 lines, -73 lines 0 comments Download
M base/test/test_pending_task.cc View 1 2 3 1 chunk +0 lines, -79 lines 0 comments Download
A + base/test/test_pending_task_info.h View 1 2 3 3 chunks +23 lines, -19 lines 0 comments Download
A + base/test/test_pending_task_info.cc View 1 2 3 2 chunks +16 lines, -15 lines 0 comments Download
A + base/test/test_pending_task_info_unittest.cc View 1 2 3 2 chunks +12 lines, -11 lines 0 comments Download
M base/test/test_pending_task_unittest.cc View 1 2 3 1 chunk +0 lines, -57 lines 0 comments Download
M base/test/test_simple_task_runner.h View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M base/test/test_simple_task_runner.cc View 1 2 3 4 5 6 7 5 chunks +14 lines, -12 lines 0 comments Download
M cc/base/delayed_unique_notifier_unittest.cc View 1 2 3 12 chunks +52 lines, -35 lines 0 comments Download
M cc/test/ordered_simple_task_runner.h View 3 chunks +16 lines, -13 lines 0 comments Download
M cc/test/ordered_simple_task_runner.cc View 8 chunks +37 lines, -41 lines 0 comments Download
M cc/test/ordered_simple_task_runner_unittest.cc View 1 2 3 3 chunks +5 lines, -5 lines 0 comments Download
M components/policy/core/common/cloud/external_policy_data_updater_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M device/bluetooth/bluetooth_task_manager_win_unittest.cc View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M device/bluetooth/test/bluetooth_test_win.h View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M device/bluetooth/test/bluetooth_test_win.cc View 1 2 3 4 5 6 7 3 chunks +18 lines, -10 lines 0 comments Download
M extensions/common/one_shot_event_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/cast/test/skewed_single_thread_task_runner.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/quic/chromium/quic_chromium_alarm_factory_test.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M net/quic/chromium/quic_stream_factory_test.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M net/quic/quartc/quartc_alarm_factory_test.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M net/quic/test_tools/test_task_runner.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M net/quic/test_tools/test_task_runner.cc View 1 2 3 4 5 6 7 2 chunks +9 lines, -6 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 38 (35 generated)
tzik
PTAL
3 years, 11 months ago (2017-01-12 23:16:47 UTC) #32
dcheng
On 2017/01/12 23:16:47, tzik wrote: > PTAL How urgent is this CL? I'd rather not ...
3 years, 11 months ago (2017-01-17 22:18:18 UTC) #37
tzik
3 years, 11 months ago (2017-01-18 13:32:12 UTC) #38
On 2017/01/17 22:18:18, dcheng wrote:
> On 2017/01/12 23:16:47, tzik wrote:
> > PTAL
> 
> How urgent is this CL? I'd rather not land CLs like this. I'm hoping we can
work
> on moving Chrome over to containers where we don't have to actively fight the
> implementation to make it work correctly.

It's not in the time pressure, but this blocks base::TaskRunner migration from
Callback to OnceCallback.
This CL is essentially to avoid the constness of the value of std::set and
std::priority_queue. So, another option is using const_cast. That looks less
clean to me, though it'll require smaller change.

Powered by Google App Engine
This is Rietveld 408576698