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

Issue 1028543002: Turn the utility process image decoder into a Mojo service. (Closed)

Created:
5 years, 9 months ago by Anand Mistry (off Chromium)
Modified:
5 years ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, darin (slow to review), ben+mojo_chromium.org, chrome-apps-syd-reviews_chromium.org, mtklein
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Turn the utility process image decoder into a Mojo service. Also, keep the Chrome IPC based decoder, just in case.

Patch Set 1 #

Patch Set 2 : Move to //services. #

Total comments: 4

Patch Set 3 : Move things around. #

Total comments: 1

Patch Set 4 : Clean up and add test. #

Total comments: 15

Patch Set 5 : Review comments #

Patch Set 6 : Rebase. #

Patch Set 7 : Rebase and remove ref counting. #

Total comments: 17

Patch Set 8 : Comments. #

Patch Set 9 : Add gyp rules. #

Patch Set 10 : Type converter arg change. #

Total comments: 2

Patch Set 11 : Rebase and move into //components #

Patch Set 12 : Fix some compile issues. #

Patch Set 13 : Maybe fix windows build #

Patch Set 14 : Another windows fix. #

Patch Set 15 : Fix gyp dependencies. #

Patch Set 16 : Fix windows linker and sawrming issues. #

Patch Set 17 : Remove Mojo dependencies from image_decoder.h #

Patch Set 18 : Rebase. #

Total comments: 10

Patch Set 19 : Review comments. #

Total comments: 2

Patch Set 20 : Rebase and type converter change. #

Patch Set 21 : Post-rebase fixes, and attempt to fix android. #

Patch Set 22 : Fix android test, take 2. #

Total comments: 4

Patch Set 23 : Change type converter to use readPixels instead of getPixels, and rebase. #

Patch Set 24 : Rebase and address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+766 lines, -41 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/image_decoder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/image_decoder.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 5 chunks +67 lines, -13 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_utility.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.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 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/common/chrome_switches.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 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/utility/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +1 line, -0 lines 0 comments Download
M chrome/utility/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M chrome/utility/chrome_content_utility_client.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 4 chunks +15 lines, -14 lines 0 comments Download
M components/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +4 lines, -1 line 0 comments Download
M components/components.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 4 chunks +32 lines, -0 lines 0 comments Download
M components/components_unittests.isolate View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -0 lines 0 comments Download
M components/enhanced_bookmarks.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
A components/image_decoder.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +42 lines, -0 lines 0 comments Download
A components/image_decoder/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +41 lines, -0 lines 0 comments Download
A components/image_decoder/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -0 lines 0 comments Download
A components/image_decoder/image_decoder_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +37 lines, -0 lines 0 comments Download
A components/image_decoder/image_decoder_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +92 lines, -0 lines 0 comments Download
A components/image_decoder/image_decoder_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +126 lines, -0 lines 0 comments Download
A + components/image_decoder/public/interfaces/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -2 lines 0 comments Download
A components/image_decoder/public/interfaces/image_decoder.mojom View 1 2 3 4 5 6 7 8 9 10 1 chunk +17 lines, -0 lines 0 comments Download
M components/test/run_all_unittests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +4 lines, -2 lines 0 comments Download
A + skia/public/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -7 lines 0 comments Download
A + skia/public/interfaces/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +1 line, -2 lines 0 comments Download
A skia/public/interfaces/bitmap.mojom View 1 2 3 1 chunk +43 lines, -0 lines 0 comments Download
A skia/public/type_converters.h View 1 2 3 10 11 12 13 14 15 16 17 18 19 1 chunk +26 lines, -0 lines 0 comments Download
A skia/public/type_converters.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 1 chunk +142 lines, -0 lines 0 comments Download
M skia/skia.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 48 (8 generated)
darin (slow to review)
services/*/services/ ?? maybe the second "services" should be "src" or some other term?
5 years, 9 months ago (2015-03-24 16:37:40 UTC) #2
Ken Rockot(use gerrit already)
Cool! I might suggest omitting the inner services/ altogether here, letting the impl live in ...
5 years, 9 months ago (2015-03-24 20:35:12 UTC) #4
Anand Mistry (off Chromium)
The Chrome convention seems to be explicit public and implicit impl in terms of directory ...
5 years, 9 months ago (2015-03-25 03:14:32 UTC) #5
Ken Rockot(use gerrit already)
On 2015/03/25 03:14:32, Anand Mistry wrote: > I kinda want to keep services to minimise ...
5 years, 9 months ago (2015-03-25 22:43:44 UTC) #6
Anand Mistry (off Chromium)
edisonn@google.com: Please review changes in skia/ jam@chromium.org: For new top-level directory sky@chromium.org: Please review changes ...
5 years, 8 months ago (2015-04-01 07:43:40 UTC) #9
sky
https://codereview.chromium.org/1028543002/diff/60001/chrome/browser/image_decoder.cc File chrome/browser/image_decoder.cc (right): https://codereview.chromium.org/1028543002/diff/60001/chrome/browser/image_decoder.cc#newcode40 chrome/browser/image_decoder.cc:40: ImageDecoder::~ImageDecoder() {} I'm not familiar with this class. What ...
5 years, 8 months ago (2015-04-01 15:00:45 UTC) #10
Anand Mistry (off Chromium)
Hold off reviewing chrome/browser/image_decoder.cc because that has substantial changes I need to rebase and resolve. ...
5 years, 8 months ago (2015-04-02 04:29:45 UTC) #12
Anand Mistry (off Chromium)
+twellington, who's recently made major changes to ImageDecoder Now it's safe to look at chrome/browser/image_decoder.cc ...
5 years, 8 months ago (2015-04-02 07:02:10 UTC) #14
sky
https://codereview.chromium.org/1028543002/diff/60001/chrome/browser/image_decoder.cc File chrome/browser/image_decoder.cc (right): https://codereview.chromium.org/1028543002/diff/60001/chrome/browser/image_decoder.cc#newcode40 chrome/browser/image_decoder.cc:40: ImageDecoder::~ImageDecoder() {} On 2015/04/02 04:29:45, Anand Mistry wrote: > ...
5 years, 8 months ago (2015-04-02 17:20:10 UTC) #15
Anand Mistry (off Chromium)
Removed the utility process ref counting stuff since it's somewhat problematic. Also, rebase onto https://codereview.chromium.org/1071453002/ ...
5 years, 8 months ago (2015-04-08 07:14:16 UTC) #16
Sam McNally
https://codereview.chromium.org/1028543002/diff/120001/chrome/browser/image_decoder.cc File chrome/browser/image_decoder.cc (right): https://codereview.chromium.org/1028543002/diff/120001/chrome/browser/image_decoder.cc#newcode273 chrome/browser/image_decoder.cc:273: utility_process_host_.reset(); 3 space indent? https://codereview.chromium.org/1028543002/diff/120001/chrome/browser/image_decoder.h File chrome/browser/image_decoder.h (right): https://codereview.chromium.org/1028543002/diff/120001/chrome/browser/image_decoder.h#newcode153 ...
5 years, 8 months ago (2015-04-08 08:09:00 UTC) #17
Anand Mistry (off Chromium)
https://codereview.chromium.org/1028543002/diff/120001/chrome/browser/image_decoder.cc File chrome/browser/image_decoder.cc (right): https://codereview.chromium.org/1028543002/diff/120001/chrome/browser/image_decoder.cc#newcode273 chrome/browser/image_decoder.cc:273: utility_process_host_.reset(); On 2015/04/08 08:09:00, Sam McNally wrote: > 3 ...
5 years, 8 months ago (2015-04-09 05:25:03 UTC) #18
Sam McNally
https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc File skia/public/type_converters.cc (right): https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc#newcode98 skia/public/type_converters.cc:98: SkBitmap TypeConverter<SkBitmap, skia::BitmapPtr>::Convert( On 2015/04/09 05:25:03, Anand Mistry wrote: ...
5 years, 8 months ago (2015-04-09 08:35:30 UTC) #19
Anand Mistry (off Chromium)
https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc File skia/public/type_converters.cc (right): https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc#newcode98 skia/public/type_converters.cc:98: SkBitmap TypeConverter<SkBitmap, skia::BitmapPtr>::Convert( On 2015/04/09 08:35:30, Sam McNally wrote: ...
5 years, 8 months ago (2015-04-10 02:56:28 UTC) #20
Theresa
https://codereview.chromium.org/1028543002/diff/60001/chrome/browser/image_decoder.cc File chrome/browser/image_decoder.cc (right): https://codereview.chromium.org/1028543002/diff/60001/chrome/browser/image_decoder.cc#newcode40 chrome/browser/image_decoder.cc:40: ImageDecoder::~ImageDecoder() {} On 2015/04/02 17:20:10, sky wrote: > On ...
5 years, 8 months ago (2015-04-13 18:52:27 UTC) #21
leonhsl(Using Gerrit)
Hi, Sorry to disturb. I have a concern about skia.Bitmap converter definition: I'm re-using the ...
5 years, 8 months ago (2015-04-16 10:11:03 UTC) #22
Ken Rockot(use gerrit already)
On 2015/04/16 10:11:03, leon.han wrote: > Hi, > Sorry to disturb. > I have a ...
5 years, 8 months ago (2015-04-16 15:20:17 UTC) #23
leonhsl(Using Gerrit)
@Rockot Thanks a lot for confirmation about the TypeConverters question~ And I've splitted out /skia/public ...
5 years, 8 months ago (2015-04-17 06:25:13 UTC) #24
reed1
very intersted to learn more about this (from skia's perspective)
5 years, 8 months ago (2015-04-20 16:07:11 UTC) #26
scroggo
On 2015/04/01 07:43:40, Anand Mistry (away till 30th) wrote: > mailto:edisonn@google.com: Please review changes in ...
5 years, 8 months ago (2015-04-20 18:47:06 UTC) #27
sky
We had a discussion at the mandoline team about directory structures and decided on moving ...
5 years, 8 months ago (2015-04-20 22:58:49 UTC) #28
Anand Mistry (off Chromium)
I've moved this into //components now. I'm still battling with gyp build issues and some ...
5 years, 7 months ago (2015-05-01 06:49:04 UTC) #30
Sam McNally
https://codereview.chromium.org/1028543002/diff/330001/chrome/browser/image_decoder.h File chrome/browser/image_decoder.h (right): https://codereview.chromium.org/1028543002/diff/330001/chrome/browser/image_decoder.h#newcode164 chrome/browser/image_decoder.h:164: scoped_ptr<mojo::InterfacePtr<image_decoder::ImageDecoder>> decoder_; Why a scoped_ptr? https://codereview.chromium.org/1028543002/diff/330001/chrome/utility/BUILD.gn File chrome/utility/BUILD.gn (right): ...
5 years, 7 months ago (2015-05-06 06:41:39 UTC) #31
Anand Mistry (off Chromium)
https://codereview.chromium.org/1028543002/diff/330001/chrome/browser/image_decoder.h File chrome/browser/image_decoder.h (right): https://codereview.chromium.org/1028543002/diff/330001/chrome/browser/image_decoder.h#newcode164 chrome/browser/image_decoder.h:164: scoped_ptr<mojo::InterfacePtr<image_decoder::ImageDecoder>> decoder_; On 2015/05/06 06:41:39, Sam McNally wrote: > ...
5 years, 7 months ago (2015-05-06 07:14:24 UTC) #32
Sam McNally
LGTM
5 years, 7 months ago (2015-05-06 07:20:16 UTC) #33
Ken Rockot(use gerrit already)
lgtm. It may help to refresh your request for specific OWNERs reviews given the age ...
5 years, 7 months ago (2015-05-08 19:39:05 UTC) #34
Theresa
chrome/browser/image_decoder.* changes lgtm
5 years, 7 months ago (2015-05-08 20:25:49 UTC) #35
Anand Mistry (off Chromium)
Reviewers, ping! reed: For //skia sky: For //chrome jam: For //content
5 years, 7 months ago (2015-05-11 07:42:16 UTC) #36
sky
jam is an owner of chrome too. He should review both chrome and content as ...
5 years, 7 months ago (2015-05-11 15:07:17 UTC) #37
jam
lgtm with comment https://codereview.chromium.org/1028543002/diff/350001/chrome/common/chrome_switches.cc File chrome/common/chrome_switches.cc (right): https://codereview.chromium.org/1028543002/diff/350001/chrome/common/chrome_switches.cc#newcode1393 chrome/common/chrome_switches.cc:1393: bool MojoUtilityServicesEnabled() { we don't add ...
5 years, 7 months ago (2015-05-12 23:24:57 UTC) #38
Anand Mistry (off Chromium)
https://codereview.chromium.org/1028543002/diff/350001/chrome/common/chrome_switches.cc File chrome/common/chrome_switches.cc (right): https://codereview.chromium.org/1028543002/diff/350001/chrome/common/chrome_switches.cc#newcode1393 chrome/common/chrome_switches.cc:1393: bool MojoUtilityServicesEnabled() { On 2015/05/12 23:24:57, jam wrote: > ...
5 years, 7 months ago (2015-05-13 04:35:12 UTC) #39
Anand Mistry (off Chromium)
https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc File skia/public/type_converters.cc (right): https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc#newcode98 skia/public/type_converters.cc:98: SkBitmap TypeConverter<SkBitmap, skia::BitmapPtr>::Convert( On 2015/04/10 02:56:27, Anand Mistry wrote: ...
5 years, 7 months ago (2015-05-13 05:44:05 UTC) #40
Sam McNally
https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc File skia/public/type_converters.cc (right): https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc#newcode98 skia/public/type_converters.cc:98: SkBitmap TypeConverter<SkBitmap, skia::BitmapPtr>::Convert( On 2015/05/13 05:44:05, Anand Mistry wrote: ...
5 years, 7 months ago (2015-05-13 05:52:04 UTC) #41
Anand Mistry (off Chromium)
https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc File skia/public/type_converters.cc (right): https://codereview.chromium.org/1028543002/diff/120001/skia/public/type_converters.cc#newcode98 skia/public/type_converters.cc:98: SkBitmap TypeConverter<SkBitmap, skia::BitmapPtr>::Convert( On 2015/05/13 05:52:04, Sam McNally wrote: ...
5 years, 7 months ago (2015-05-13 07:36:07 UTC) #42
reed1
For the short-term I'm sure we can support this. Longer-term, I would feel better moving ...
5 years, 7 months ago (2015-05-14 15:50:39 UTC) #43
reed1
https://codereview.chromium.org/1028543002/diff/410001/skia/public/type_converters.cc File skia/public/type_converters.cc (right): https://codereview.chromium.org/1028543002/diff/410001/skia/public/type_converters.cc#newcode130 skia/public/type_converters.cc:130: memcpy(&result->pixel_data[0], bitmap.getPixels(), size); 4. this explicitly is forcing a ...
5 years, 7 months ago (2015-05-14 15:52:12 UTC) #44
Anand Mistry (off Chromium)
https://codereview.chromium.org/1028543002/diff/410001/skia/public/type_converters.cc File skia/public/type_converters.cc (right): https://codereview.chromium.org/1028543002/diff/410001/skia/public/type_converters.cc#newcode127 skia/public/type_converters.cc:127: SkAutoLockPixels lock(bitmap); On 2015/05/14 15:50:39, reed1 wrote: > A ...
5 years, 7 months ago (2015-05-15 06:51:23 UTC) #45
Anand Mistry (off Chromium)
Ugh! This change might stall for a while. The android bot is failing, and I ...
5 years, 7 months ago (2015-05-15 07:32:50 UTC) #46
reed1
On 2015/05/15 06:51:23, Anand Mistry wrote: > https://codereview.chromium.org/1028543002/diff/410001/skia/public/type_converters.cc > File skia/public/type_converters.cc (right): > > https://codereview.chromium.org/1028543002/diff/410001/skia/public/type_converters.cc#newcode127 ...
5 years, 7 months ago (2015-05-15 13:06:58 UTC) #47
Anand Mistry (off Chromium)
5 years, 6 months ago (2015-06-01 05:59:03 UTC) #48
On 2015/05/15 13:06:58, reed1 wrote:
> On 2015/05/15 06:51:23, Anand Mistry wrote:
> >
>
https://codereview.chromium.org/1028543002/diff/410001/skia/public/type_conve...
> > File skia/public/type_converters.cc (right):
> > 
> >
>
https://codereview.chromium.org/1028543002/diff/410001/skia/public/type_conve...
> > skia/public/type_converters.cc:127: SkAutoLockPixels lock(bitmap);
> > On 2015/05/14 15:50:39, reed1 wrote:
> > > A couple of notes:
> > > 
> > > 1. there is no code to handle Index8 colortable bitmaps here.
> > > 2. lockPixels can fail, with bitmap.getPixels() returning NULL.
> > > 
> > > 3. bitmap.readPixels() is the modern way to get a copy of the pixels out
of
> a
> > > bitmap. It requires the caller to allocate space for the pixels ahead of
> time,
> > > but that should not be a problem here.
> > 
> > The goal here is to serialize the SkBitmap without performing any
conversions.
> I
> > think it's also worth noting that this code is pretty much a reflection of
> > what's in
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/ui/gfx/ipc/gfx_par...,
> > which has all the issues you've mentioned. I'm not sure what the correct
thing
> > to do here is. Since no existing IPC uses Index8 (since the current IPC
> doesn't
> > support it), I wonder if it's ok to punt on support for that until it's
> actually
> > needed.
> > 
> >
>
https://codereview.chromium.org/1028543002/diff/410001/skia/public/type_conve...
> > skia/public/type_converters.cc:130: memcpy(&result->pixel_data[0],
> > bitmap.getPixels(), size);
> > On 2015/05/14 15:52:12, reed1 wrote:
> > > 4. this explicitly is forcing a decode if the bitmap was backed by JPEG or
> PNG
> > > or whatever. Is that required, or could we logically send the encoded form
> > > through mojo? It could be much much smaller.
> > 
> > Actually, we want to force a decode. The two immediate users of this (this
CL
> > and https://codereview.chromium.org/1085783002/) do untrusted image decoding
> in
> > a sandboxed process. Even for any other user, I don't think we can trust
> passing
> > a JPEG or PNG here.
> 
> 1. skipping index8 : sgtm, though perhaps it could assert or fail
> 2. I think the code should check to see if getPixels() is null before
proceeding
> 3. This is a change I can propose later, so I'm fine with no change now
(though
> readPixels is more correct and just as efficient)
> 4. Ack.

Done. I'm going to split the skia stuff off this and send to you separately.
Until I can figure out what's happening with the Android bot, I can't submit the
rest.

Powered by Google App Engine
This is Rietveld 408576698