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

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)

Created:
4 years, 2 months ago by Alex Z.
Modified:
4 years, 1 month ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, blink-reviews-platform-graphics_chromium.org, dshwang, yzshen+watch_chromium.org, Stephen Chennney, rwlbuis, darin (slow to review), krit, drott+blinkwatch_chromium.org, Justin Novosad, abarth-chromium, Rik, blink-reviews-bindings_chromium.org, blink-reviews, ajuma+watch_chromium.org, pdr+graphicswatchlist_chromium.org, jbroman+watch_chromium.org, haraken, cc-bugs_chromium.org, Aaron Boodman, f(malita), danakj+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replaced cc::SurfaceId::nonce_ with base::UnguessableToken base::SurfaceId::nonce_ is an uint64 generated at random to make the entire surface id unguessable. base::UnguessableToken is a wrapper for 2 uint64 (high_ and low_). high_ and low_ are generated at random using base::UnguessableToken::Create(). base::UnguessableToken achieves the same goal as the original cc::SurfaceId::nonce_ with better security and uses more common code. BUG=649800 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Committed: https://crrev.com/6b01e58ff708c17f74b560fe1b57f7733b78da53 Committed: https://crrev.com/7d7f6ebb02ae3b9e354406ce2670399a241baeca Cr-Original-Commit-Position: refs/heads/master@{#431294} Cr-Commit-Position: refs/heads/master@{#431398}

Patch Set 1 #

Total comments: 14

Patch Set 2 : Format and merge conflicts #

Patch Set 3 : Changes based on comments #

Patch Set 4 : Resolved merge conflicts #

Patch Set 5 : Rebase #

Patch Set 6 : Moved include statement from surface_id_struct_traits.h to local_frame_id_struct_traits.h #

Total comments: 6

Patch Set 7 : Removed the newly added LocalFrameId constructor #

Patch Set 8 : Changed unit tests to use base::UnguessableToken as LocalFrameId::nonce_ #

Patch Set 9 : Modified WebKit unit tests to be compatible with the change #

Patch Set 10 : Chagned SurfaceAggregator pert tests to use base::UnguessableToken #

Patch Set 11 : Changed comments in surface_id.h to reflect the change #

Total comments: 2

Patch Set 12 : Clean up and rebase #

Patch Set 13 : Fixed cc_unittests #

Patch Set 14 : Fixed FrameGenerator unit tests #

Patch Set 15 : printf for debugging #

Patch Set 16 : Removed printf #

Patch Set 17 : Replaced uasages of UnguessableToken's default construtor with a const #

Patch Set 18 : Added kludge to avoid invalid UnguessableToken #

Patch Set 19 : Made the UnguessableToken's default constructor returns a constexpr to avoid compiling errors on Wi… #

Patch Set 20 : Rebase #

Patch Set 21 : format #

Patch Set 22 : Added static cast to LocalFrameId::hash() to avoid warnings when compiled on Windows #

Total comments: 2

Patch Set 23 : rebase #

Patch Set 24 : Nit change based on comment. #

Total comments: 4

Patch Set 25 : Localized kArbitraryLocalFrameId #

Patch Set 26 : Changed SurfaceManager::kRootSurfaceId to private const to avoid static initialization. #

Patch Set 27 : Changed SurfaceManager::kRootSurfaceId to a private field to avoid static initialization #

Unified diffs Side-by-side diffs Delta from patch set Stats (+256 lines, -161 lines) Patch
M base/unguessable_token.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 26 1 chunk +1 line, -1 line 0 comments Download
M cc/ipc/DEPS View 26 1 chunk +1 line, -0 lines 0 comments Download
M cc/ipc/cc_param_traits.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 26 2 chunks +2 lines, -1 line 0 comments Download
M cc/ipc/cc_param_traits_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 1 chunk +3 lines, -2 lines 0 comments Download
M cc/ipc/local_frame_id.mojom View 1 2 3 4 5 6 26 1 chunk +2 lines, -3 lines 0 comments Download
M cc/ipc/local_frame_id_struct_traits.h View 1 2 3 4 5 6 26 2 chunks +8 lines, -2 lines 0 comments Download
M cc/ipc/struct_traits_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 4 chunks +9 lines, -4 lines 0 comments Download
M cc/layers/surface_layer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 2 chunks +3 lines, -1 line 0 comments Download
M cc/layers/surface_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 9 chunks +21 lines, -14 lines 0 comments Download
M cc/quads/draw_quad_unittest.cc View 1 2 3 4 5 6 7 26 2 chunks +4 lines, -2 lines 0 comments Download
M cc/surfaces/display_scheduler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 26 11 chunks +50 lines, -25 lines 0 comments Download
M cc/surfaces/local_frame_id.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 2 chunks +14 lines, -8 lines 0 comments Download
M cc/surfaces/surface_aggregator_perftest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 26 6 chunks +16 lines, -12 lines 0 comments Download
M cc/surfaces/surface_aggregator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 7 chunks +14 lines, -11 lines 0 comments Download
M cc/surfaces/surface_factory_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 9 chunks +13 lines, -11 lines 0 comments Download
M cc/surfaces/surface_hittest_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 26 1 chunk +3 lines, -2 lines 0 comments Download
M cc/surfaces/surface_id.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 26 1 chunk +4 lines, -8 lines 0 comments Download
M cc/surfaces/surface_id_allocator.cc View 1 2 3 4 5 6 26 2 chunks +2 lines, -2 lines 0 comments Download
M cc/surfaces/surface_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 chunks +6 lines, -4 lines 0 comments Download
M cc/surfaces/surface_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +3 lines, -4 lines 0 comments Download
M cc/surfaces/surface_manager_ref_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 12 chunks +15 lines, -14 lines 0 comments Download
M cc/surfaces/surface_unittest.cc View 1 2 3 4 5 6 7 26 1 chunk +1 line, -1 line 0 comments Download
M services/ui/ws/frame_generator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 3 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 26 6 chunks +12 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp View 1 2 3 4 5 6 7 26 1 chunk +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h View 1 2 3 4 5 6 7 8 9 10 11 26 2 chunks +8 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp View 1 2 3 4 5 6 7 8 9 10 11 26 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 1 chunk +8 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp View 1 2 3 4 5 6 7 8 26 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 1 chunk +7 lines, -3 lines 0 comments Download
M ui/compositor/layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 26 2 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 111 (66 generated)
Alex Z.
danakj@chromium.org: Please review changes in cc code. sky@chromium.org: Please review changes in WebKit code. tsepez@: ...
4 years, 2 months ago (2016-09-30 20:04:02 UTC) #3
Tom Sepez
LGTM.
4 years, 2 months ago (2016-09-30 20:23:24 UTC) #4
Fady Samuel
Drive by comments. https://codereview.chromium.org/2379653006/diff/1/cc/ipc/surface_id_struct_traits.h File cc/ipc/surface_id_struct_traits.h (right): https://codereview.chromium.org/2379653006/diff/1/cc/ipc/surface_id_struct_traits.h#newcode20 cc/ipc/surface_id_struct_traits.h:20: static base::UnguessableToken nonce(const cc::SurfaceId& id) { ...
4 years, 2 months ago (2016-09-30 20:30:41 UTC) #6
danakj
https://codereview.chromium.org/2379653006/diff/1/cc/surfaces/surface_id.h File cc/surfaces/surface_id.h (right): https://codereview.chromium.org/2379653006/diff/1/cc/surfaces/surface_id.h#newcode43 cc/surfaces/surface_id.h:43: nonce_ = base::UnguessableToken::Create(); do this as a constructor initializer ...
4 years, 2 months ago (2016-09-30 20:45:12 UTC) #7
sky
I'm not a good reviewer for webkit changes. Please find a more local reviewer.
4 years, 2 months ago (2016-10-03 15:50:59 UTC) #8
Alex Z.
https://codereview.chromium.org/2379653006/diff/1/cc/ipc/surface_id_struct_traits.h File cc/ipc/surface_id_struct_traits.h (right): https://codereview.chromium.org/2379653006/diff/1/cc/ipc/surface_id_struct_traits.h#newcode20 cc/ipc/surface_id_struct_traits.h:20: static base::UnguessableToken nonce(const cc::SurfaceId& id) { On 2016/09/30 20:30:41, ...
4 years, 2 months ago (2016-10-05 18:10:46 UTC) #11
Alex Z.
jam@chromium.org: Please review changes in WebKit
4 years, 2 months ago (2016-10-05 18:17:48 UTC) #13
Fady Samuel
please hold off on this patch for another day. I'm wrapping up a change that ...
4 years, 2 months ago (2016-10-05 20:30:48 UTC) #14
jam
On 2016/10/05 18:17:48, StarAZ1 wrote: > mailto:jam@chromium.org: Please review changes in WebKit please pick an ...
4 years, 2 months ago (2016-10-05 22:55:55 UTC) #15
haraken
bindings/ LGTM jbroman@: We'll need to make the same change to the new serializer.
4 years, 2 months ago (2016-10-06 00:31:47 UTC) #18
Fady Samuel
Please rebase now. I'll L-G-T-M it once the rebase is complete. Thanks!
4 years, 2 months ago (2016-10-06 02:42:40 UTC) #19
jbroman
On 2016/10/06 at 00:31:47, haraken wrote: > bindings/ LGTM > > jbroman@: We'll need to ...
4 years, 2 months ago (2016-10-06 02:45:17 UTC) #20
Alex Z.
On 2016/10/06 02:42:40, Fady Samuel wrote: > Please rebase now. I'll L-G-T-M it once the ...
4 years, 2 months ago (2016-10-07 14:12:58 UTC) #21
Fady Samuel
https://codereview.chromium.org/2379653006/diff/100001/cc/ipc/local_frame_id.mojom File cc/ipc/local_frame_id.mojom (left): https://codereview.chromium.org/2379653006/diff/100001/cc/ipc/local_frame_id.mojom#oldcode12 cc/ipc/local_frame_id.mojom:12: // A cryptographically secure random int chosen to make ...
4 years, 2 months ago (2016-10-07 14:18:11 UTC) #22
Alex Z.
https://codereview.chromium.org/2379653006/diff/100001/cc/ipc/local_frame_id.mojom File cc/ipc/local_frame_id.mojom (left): https://codereview.chromium.org/2379653006/diff/100001/cc/ipc/local_frame_id.mojom#oldcode12 cc/ipc/local_frame_id.mojom:12: // A cryptographically secure random int chosen to make ...
4 years, 2 months ago (2016-10-07 14:27:50 UTC) #23
Fady Samuel
lgtm
4 years, 2 months ago (2016-10-07 14:29:36 UTC) #24
vmpstr
cc lgtm
4 years, 2 months ago (2016-10-11 23:39:36 UTC) #26
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/2379653006/140001
4 years, 2 months ago (2016-10-12 18:33:19 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_precise_blink_rel on master.tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_precise_blink_rel/builds/3743)
4 years, 2 months ago (2016-10-12 18:47:26 UTC) #35
Alex Z.
sky@: Please review my changes in cc/ipc/DEPS (added dependency to mojo/common)
4 years, 2 months ago (2016-10-12 18:55:02 UTC) #37
sky
DEPS LGTM
4 years, 2 months ago (2016-10-12 19:31:52 UTC) #38
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/2379653006/140001
4 years, 2 months ago (2016-10-12 19:34:01 UTC) #40
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/2379653006/180001
4 years, 2 months ago (2016-10-14 15:09:29 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/241996)
4 years, 2 months ago (2016-10-14 15:38:57 UTC) #49
Fady Samuel
https://codereview.chromium.org/2379653006/diff/200001/cc/surfaces/surface_aggregator_perftest.cc File cc/surfaces/surface_aggregator_perftest.cc (right): https://codereview.chromium.org/2379653006/diff/200001/cc/surfaces/surface_aggregator_perftest.cc#newcode54 cc/surfaces/surface_aggregator_perftest.cc:54: LocalFrameId local_frame_id(i, base::UnguessableToken()); Let's avoid using the default constructor.
4 years, 2 months ago (2016-10-18 03:56:09 UTC) #50
Alex Z.
https://codereview.chromium.org/2379653006/diff/200001/cc/surfaces/surface_aggregator_perftest.cc File cc/surfaces/surface_aggregator_perftest.cc (right): https://codereview.chromium.org/2379653006/diff/200001/cc/surfaces/surface_aggregator_perftest.cc#newcode54 cc/surfaces/surface_aggregator_perftest.cc:54: LocalFrameId local_frame_id(i, base::UnguessableToken()); On 2016/10/18 03:56:09, Fady Samuel wrote: ...
4 years, 1 month ago (2016-11-02 17:10:20 UTC) #71
Fady Samuel
Now that your is_valid() patch has landed, you'll likely need to rebase this patch. Thanks! ...
4 years, 1 month ago (2016-11-09 21:25:37 UTC) #72
Fady Samuel
https://codereview.chromium.org/2379653006/diff/420001/cc/surfaces/surface_id.h File cc/surfaces/surface_id.h (right): https://codereview.chromium.org/2379653006/diff/420001/cc/surfaces/surface_id.h#newcode29 cc/surfaces/surface_id.h:29: // A SurfaceId consists of two components: FrameSinkId and ...
4 years, 1 month ago (2016-11-09 21:41:57 UTC) #73
Alex Z.
dcheng@: Please review my changes in base/unguessable_token.h
4 years, 1 month ago (2016-11-09 22:04:38 UTC) #77
Alex Z.
https://codereview.chromium.org/2379653006/diff/420001/cc/surfaces/surface_id.h File cc/surfaces/surface_id.h (right): https://codereview.chromium.org/2379653006/diff/420001/cc/surfaces/surface_id.h#newcode29 cc/surfaces/surface_id.h:29: // A SurfaceId consists of two components: FrameSinkId and ...
4 years, 1 month ago (2016-11-09 22:05:21 UTC) #78
dcheng
base LGTM There are some typos in the CL description (NonguessableToken -> UnguessableToken), and I'm ...
4 years, 1 month ago (2016-11-09 22:10:49 UTC) #81
danakj
On 2016/11/09 22:10:49, dcheng wrote: > base LGTM base LGTM also. > There are some ...
4 years, 1 month ago (2016-11-10 00:01:37 UTC) #82
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/2379653006/480001
4 years, 1 month ago (2016-11-10 15:54:41 UTC) #88
Alex Z.
On 2016/11/09 22:10:49, dcheng wrote: > base LGTM > > There are some typos in ...
4 years, 1 month ago (2016-11-10 15:57:29 UTC) #89
Alex Z.
https://codereview.chromium.org/2379653006/diff/460001/cc/layers/surface_layer_impl_unittest.cc File cc/layers/surface_layer_impl_unittest.cc (right): https://codereview.chromium.org/2379653006/diff/460001/cc/layers/surface_layer_impl_unittest.cc#newcode18 cc/layers/surface_layer_impl_unittest.cc:18: base::UnguessableToken::Create()); On 2016/11/09 22:10:48, dcheng wrote: > I'm surprised ...
4 years, 1 month ago (2016-11-10 15:57:43 UTC) #90
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/65312)
4 years, 1 month ago (2016-11-10 17:23:47 UTC) #92
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/2379653006/480001
4 years, 1 month ago (2016-11-10 17:41:49 UTC) #94
commit-bot: I haz the power
Committed patchset #25 (id:480001)
4 years, 1 month ago (2016-11-10 18:19:41 UTC) #96
commit-bot: I haz the power
Patchset 25 (id:??) landed as https://crrev.com/6b01e58ff708c17f74b560fe1b57f7733b78da53 Cr-Commit-Position: refs/heads/master@{#431294}
4 years, 1 month ago (2016-11-10 18:38:48 UTC) #98
Dirk Pranke
A revert of this CL (patchset #25 id:480001) has been created in https://codereview.chromium.org/2494833002/ by dpranke@chromium.org. ...
4 years, 1 month ago (2016-11-10 20:03:02 UTC) #99
Fady Samuel
On 2016/11/10 20:03:02, Dirk Pranke wrote: > A revert of this CL (patchset #25 id:480001) ...
4 years, 1 month ago (2016-11-10 20:40:25 UTC) #100
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/2379653006/520001
4 years, 1 month ago (2016-11-10 20:59:39 UTC) #104
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/2379653006/520001
4 years, 1 month ago (2016-11-10 22:08:16 UTC) #107
commit-bot: I haz the power
Committed patchset #27 (id:520001)
4 years, 1 month ago (2016-11-11 00:19:50 UTC) #109
commit-bot: I haz the power
4 years, 1 month ago (2016-11-11 00:21:37 UTC) #111
Message was sent while issue was closed.
Patchset 27 (id:??) landed as
https://crrev.com/7d7f6ebb02ae3b9e354406ce2670399a241baeca
Cr-Commit-Position: refs/heads/master@{#431398}

Powered by Google App Engine
This is Rietveld 408576698