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

Issue 2644313002: SafeAudioVideoChecker: use UtilityProcessMojoClient (Closed)

Created:
3 years, 11 months ago by Noel Gordon
Modified:
3 years, 9 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, qsr+mojo_chromium.org, tommycli, posciak+watch_chromium.org, tzik, viettrungluu+watch_chromium.org, nhiroki, abarth-chromium, Lei Zhang, yzshen+watch_chromium.org, chromium-apps-reviews_chromium.org, darin (slow to review), kinuko+fileapi, Aaron Boodman
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

SafeAudioVideoChecker: use UtilityProcessMojoClient Remove SafeAudioVideoChecker's public derivation from the UtilityProcessHost class, and the interfaces it required, OnMessageReceived, OnProcessCrashed and the state_ member used to prevent multiple callbacks from them. Replace all the above with a UtilityProcessMojoClient, to make the code all mojo, per TODO. Covered by browsertests MediaFileValidatorTest.{ValidVideo,ValidAudio}. BUG=680928 Review-Url: https://codereview.chromium.org/2644313002 Cr-Commit-Position: refs/heads/master@{#445557} Committed: https://chromium.googlesource.com/chromium/src/+/2ce603cd53ff8a412483d343937b8e65bcfc27dc

Patch Set 1 : Depends on another patch, but let's move on. #

Patch Set 2 : Dependent patch landed, sync up to ToT. #

Patch Set 3 : Comments and other minor clean-up. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -72 lines) Patch
M chrome/browser/media_galleries/fileapi/safe_audio_video_checker.h View 1 2 1 chunk +20 lines, -31 lines 0 comments Download
M chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc View 1 2 1 chunk +20 lines, -41 lines 1 comment Download

Messages

Total messages: 45 (34 generated)
Noel Gordon
3 years, 11 months ago (2017-01-23 00:51:58 UTC) #28
Sam McNally
lgtm
3 years, 11 months ago (2017-01-23 02:33:18 UTC) #29
tibell
lgtm
3 years, 11 months ago (2017-01-23 04:09:20 UTC) #30
tommycli
lgtm from media galleries perspective
3 years, 11 months ago (2017-01-23 19:12:33 UTC) #31
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/2644313002/80001
3 years, 11 months ago (2017-01-23 22:35:58 UTC) #33
Noel Gordon
+jochen for OWNERS
3 years, 11 months ago (2017-01-23 22:38:04 UTC) #36
Noel Gordon
On 2017/01/23 22:38:04, noel gordon wrote: > +jochen for OWNERS Ignore me: if chrome butler ...
3 years, 11 months ago (2017-01-24 00:14:59 UTC) #37
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/2644313002/80001
3 years, 11 months ago (2017-01-24 00:16:09 UTC) #39
commit-bot: I haz the power
Committed patchset #3 (id:80001) as https://chromium.googlesource.com/chromium/src/+/2ce603cd53ff8a412483d343937b8e65bcfc27dc
3 years, 11 months ago (2017-01-24 00:23:59 UTC) #42
Lei Zhang
Thank you for doing this Mojo conversion and simplifying the code. https://codereview.chromium.org/2644313002/diff/80001/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc File chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc (right): ...
3 years, 9 months ago (2017-03-11 00:44:19 UTC) #44
Noel Gordon
3 years, 9 months ago (2017-03-11 07:04:01 UTC) #45
Message was sent while issue was closed.
On 2017/03/11 00:44:19, Lei Zhang (super slow) wrote:
> Thank you for doing this Mojo conversion and simplifying the code.

Thanks for mentioning it.

>
https://codereview.chromium.org/2644313002/diff/80001/chrome/browser/media_ga...
> File chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc
(right):
> 
>
https://codereview.chromium.org/2644313002/diff/80001/chrome/browser/media_ga...
> chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc:36:
> utility_process_mojo_client_.reset(
> nit for future CLs in general: foo_unique_ptr.reset(new Foo(bar)) ->
> foo_unique_ptr = base::MakeUnique<Foo>(bar);

Yeah, this CL was early-on in our work with the utility_process_mojo_client.  As
work progressed mojo'n the utility process clients, we changed the client-side
pattern we use to [1]

  81   utility_process_mojo_client_ = base::MakeUnique<
  82      
content::UtilityProcessMojoClient<chrome::mojom::SafeArchiveAnalyzer>>(
  83       l10n_util::GetStringUTF16(
  84           IDS_UTILITY_PROCESS_SAFE_BROWSING_ZIP_FILE_ANALYZER_NAME));
  85   utility_process_mojo_client_->set_error_callback(
  86       base::Bind(&SandboxedZipAnalyzer::AnalyzeFileDone, this, Results()));
  87 
  88   utility_process_mojo_client_->Start();
  89   ...

viz., make use of base::MakeUnique<Foo> as you noted.

[1]
https://codereview.chromium.org/2737763002/diff/240001/chrome/browser/safe_br...

Powered by Google App Engine
This is Rietveld 408576698