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

Issue 10534096: Generalize AesDecryptor to make it more spec compliant. (Closed)

Created:
8 years, 6 months ago by xhwang
Modified:
8 years, 6 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Generalize AesDecryptor to make it more spec compliant. BUG=123260 TEST=media_unittests, encrypted-media layout tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=142553

Patch Set 1 #

Total comments: 66

Patch Set 2 : Revise on comments. #

Patch Set 3 : Updated to pass layout tests. #

Total comments: 17

Patch Set 4 : Rebase #

Patch Set 5 : Fix compile error on Windows. #

Total comments: 18

Patch Set 6 : Revise on comments. #

Total comments: 15

Patch Set 7 : Revise again. #

Patch Set 8 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+667 lines, -202 lines) Patch
M media/base/mock_filters.h View 1 2 chunks +36 lines, -0 lines 0 comments Download
M media/base/mock_filters.cc View 1 1 chunk +20 lines, -0 lines 0 comments Download
M media/base/stream_parser.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M media/crypto/aes_decryptor.h View 1 2 3 4 5 6 2 chunks +55 lines, -12 lines 0 comments Download
M media/crypto/aes_decryptor.cc View 1 2 3 4 5 3 chunks +67 lines, -15 lines 0 comments Download
M media/crypto/aes_decryptor_unittest.cc View 1 2 3 4 5 2 chunks +88 lines, -29 lines 0 comments Download
A media/crypto/decryptor_client.h View 1 2 3 4 5 1 chunk +50 lines, -0 lines 0 comments Download
M media/filters/chunk_demuxer.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M media/filters/chunk_demuxer.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M media/filters/chunk_demuxer_client.h View 1 2 3 4 5 1 chunk +5 lines, -1 line 0 comments Download
M media/filters/chunk_demuxer_unittest.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -7 lines 0 comments Download
M media/filters/ffmpeg_video_decoder_unittest.cc View 1 2 3 4 5 6 7 8 chunks +33 lines, -11 lines 0 comments Download
M media/filters/pipeline_integration_test.cc View 1 2 3 4 5 6 6 chunks +100 lines, -22 lines 0 comments Download
M media/filters/pipeline_integration_test_base.h View 1 2 chunks +0 lines, -3 lines 0 comments Download
M media/filters/pipeline_integration_test_base.cc View 1 2 3 3 chunks +0 lines, -3 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M media/mp4/mp4_stream_parser.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M media/mp4/mp4_stream_parser.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -3 lines 0 comments Download
M media/webm/webm_stream_parser.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M media/webm/webm_stream_parser.cc View 1 2 3 4 5 6 7 3 chunks +4 lines, -4 lines 0 comments Download
M webkit/media/webmediaplayer_impl.h View 1 2 3 4 chunks +17 lines, -2 lines 0 comments Download
M webkit/media/webmediaplayer_impl.cc View 1 2 3 8 chunks +51 lines, -67 lines 0 comments Download
M webkit/media/webmediaplayer_proxy.h View 1 2 3 4 5 5 chunks +47 lines, -6 lines 0 comments Download
M webkit/media/webmediaplayer_proxy.cc View 1 2 3 2 chunks +71 lines, -6 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
xhwang
Hello scherkus and ddorwin, This is the patch that generalizes the AesDecryptor to make it ...
8 years, 6 months ago (2012-06-11 17:46:16 UTC) #1
ddorwin
Design looks good. http://codereview.chromium.org/10534096/diff/1/media/crypto/aes_decryptor.cc File media/crypto/aes_decryptor.cc (right): http://codereview.chromium.org/10534096/diff/1/media/crypto/aes_decryptor.cc#newcode87 media/crypto/aes_decryptor.cc:87: CHECK(init_data && key); I think this ...
8 years, 6 months ago (2012-06-11 21:02:40 UTC) #2
scherkus (not reviewing)
http://codereview.chromium.org/10534096/diff/1/media/base/mock_filters.h File media/base/mock_filters.h (right): http://codereview.chromium.org/10534096/diff/1/media/base/mock_filters.h#newcode223 media/base/mock_filters.h:223: // See http://code.google.com/p/googletest/issues/detail?id=395 AFAIK this is also due to ...
8 years, 6 months ago (2012-06-12 03:15:57 UTC) #3
xhwang
Mostly fixed on comments. I'll need to find a better name for MockEncryptedMedia later. Please ...
8 years, 6 months ago (2012-06-12 19:01:14 UTC) #4
scherkus (not reviewing)
http://codereview.chromium.org/10534096/diff/8024/media/crypto/aes_decryptor.cc File media/crypto/aes_decryptor.cc (right): http://codereview.chromium.org/10534096/diff/8024/media/crypto/aes_decryptor.cc#newcode130 media/crypto/aes_decryptor.cc:130: void AesDecryptor::CancelKeyRequest(const std::string& /* key_system */, nit: don't bother ...
8 years, 6 months ago (2012-06-13 23:35:08 UTC) #5
ddorwin
A few minor items. http://codereview.chromium.org/10534096/diff/2003/media/crypto/aes_decryptor_unittest.cc File media/crypto/aes_decryptor_unittest.cc (right): http://codereview.chromium.org/10534096/diff/2003/media/crypto/aes_decryptor_unittest.cc#newcode55 media/crypto/aes_decryptor_unittest.cc:55: EXPECT_CALL(client_, KeyMessageMock(kClearKeySystem, StrNe(std::string()), This is ...
8 years, 6 months ago (2012-06-14 21:00:13 UTC) #6
ddorwin
Replies to scherkus. http://codereview.chromium.org/10534096/diff/8024/media/crypto/aes_decryptor.cc File media/crypto/aes_decryptor.cc (right): http://codereview.chromium.org/10534096/diff/8024/media/crypto/aes_decryptor.cc#newcode130 media/crypto/aes_decryptor.cc:130: void AesDecryptor::CancelKeyRequest(const std::string& /* key_system */, ...
8 years, 6 months ago (2012-06-14 21:04:04 UTC) #7
xhwang
http://codereview.chromium.org/10534096/diff/8024/media/crypto/aes_decryptor.cc File media/crypto/aes_decryptor.cc (right): http://codereview.chromium.org/10534096/diff/8024/media/crypto/aes_decryptor.cc#newcode130 media/crypto/aes_decryptor.cc:130: void AesDecryptor::CancelKeyRequest(const std::string& /* key_system */, On 2012/06/14 21:04:04, ...
8 years, 6 months ago (2012-06-15 01:41:04 UTC) #8
scherkus (not reviewing)
one nit, one q http://codereview.chromium.org/10534096/diff/6011/media/crypto/aes_decryptor.h File media/crypto/aes_decryptor.h (right): http://codereview.chromium.org/10534096/diff/6011/media/crypto/aes_decryptor.h#newcode79 media/crypto/aes_decryptor.h:79: // Since only Decrypt() is ...
8 years, 6 months ago (2012-06-15 04:29:21 UTC) #9
ddorwin
nits http://codereview.chromium.org/10534096/diff/8024/media/filters/chunk_demuxer_client.h File media/filters/chunk_demuxer_client.h (right): http://codereview.chromium.org/10534096/diff/8024/media/filters/chunk_demuxer_client.h#newcode32 media/filters/chunk_demuxer_client.h:32: ~ChunkDemuxerClient() {} On 2012/06/15 01:41:04, xhwang wrote: > ...
8 years, 6 months ago (2012-06-15 04:29:25 UTC) #10
scherkus (not reviewing)
http://codereview.chromium.org/10534096/diff/8024/media/filters/chunk_demuxer_client.h File media/filters/chunk_demuxer_client.h (right): http://codereview.chromium.org/10534096/diff/8024/media/filters/chunk_demuxer_client.h#newcode32 media/filters/chunk_demuxer_client.h:32: ~ChunkDemuxerClient() {} On 2012/06/15 04:29:25, ddorwin wrote: > On ...
8 years, 6 months ago (2012-06-15 04:36:36 UTC) #11
xhwang
http://codereview.chromium.org/10534096/diff/8024/media/filters/chunk_demuxer_client.h File media/filters/chunk_demuxer_client.h (right): http://codereview.chromium.org/10534096/diff/8024/media/filters/chunk_demuxer_client.h#newcode32 media/filters/chunk_demuxer_client.h:32: ~ChunkDemuxerClient() {} On 2012/06/15 04:36:36, scherkus wrote: > On ...
8 years, 6 months ago (2012-06-15 16:39:18 UTC) #12
scherkus (not reviewing)
lgtm
8 years, 6 months ago (2012-06-15 16:42:44 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xhwang@chromium.org/10534096/15001
8 years, 6 months ago (2012-06-15 20:51:29 UTC) #14
commit-bot: I haz the power
Failed to apply patch for media/base/stream_parser.h: While running patch -p1 --forward --force; patching file media/base/stream_parser.h ...
8 years, 6 months ago (2012-06-15 20:51:43 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xhwang@chromium.org/10534096/18002
8 years, 6 months ago (2012-06-15 21:16:11 UTC) #16
commit-bot: I haz the power
Change committed as 142553
8 years, 6 months ago (2012-06-16 01:27:44 UTC) #17
ddorwin
LGTM. Thanks. I have a few comments that can be addressed in a future CL. ...
8 years, 6 months ago (2012-06-16 02:01:32 UTC) #18
xhwang
8 years, 6 months ago (2012-06-19 16:37:48 UTC) #19
http://codereview.chromium.org/10534096/diff/6011/media/filters/pipeline_inte...
File media/filters/pipeline_integration_test.cc (right):

http://codereview.chromium.org/10534096/diff/6011/media/filters/pipeline_inte...
media/filters/pipeline_integration_test.cc:127: virtual void KeyAdded(const
std::string& key_system,
On 2012/06/16 02:01:32, ddorwin wrote:
> On 2012/06/15 16:39:18, xhwang wrote:
> > On 2012/06/15 04:29:25, ddorwin wrote:
> > > Why did you override these instead of using GMock matchers? Don't you get
> > > warnings for an unexpected call? Previously, you had EXPECT_CALL().
> > 
> > In the IM-chat, scherkus@ points out that in pipeline integration test we
use
> > real stuff (real demuxers, real decoders, etc) and we create a minimal
> > implementation of auxiliary interfaces rather than using Mock-classes. If
you
> > look at pipeline_integration_test.cc you won't see any real Mock classes
used
> > and EXPECT_CALL is never used.
> > 
> > Quote scherkus's comment: "the outcome of a pipeline integration test should
> be
> > on basic pipeline stuff (i.e., most tests play a clip until the end)
> > we've had to implement a few basic interfaces to get stuff working, such as
a
> > file-based data source and a null audio sink".
> 
> Ah, I missed the parent class change and the class name threw me. In a future
> CL, please change the name to not include "Mock" since that implies it is a
real
> GMock class. FakeDecryptorClient is an appropriate name.

Done in http://codereview.chromium.org/10539150/, patch 4.

http://codereview.chromium.org/10534096/diff/6011/media/filters/pipeline_inte...
media/filters/pipeline_integration_test.cc:172: // In test file
bear-320x240-encrypted.webm, the decryption key is equal to
On 2012/06/16 02:01:32, ddorwin wrote:
> If this Fake is specific to this one file. We might as well move AddKey to
> KeyMessage() and do nothing if GKR has already been requested. I think that is
> more like an app implementation.

The reason I didn't put AddKey() in KeyMessage() is because in this test all
calls are synchronous. Then we'll have this reentrant calling sequence:
NeedKey() -> GKR() -> KeyMessage() -> AddKey(). I was trying to simulate the
scenario in a real application where these calls are not called in an reentrant
manner.

Powered by Google App Engine
This is Rietveld 408576698