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

Issue 10820049: Load 2x resources on demand (Closed)

Created:
8 years, 4 months ago by oshima
Modified:
8 years, 3 months ago
Reviewers:
pkotwicz, sky
CC:
chromium-reviews
Visibility:
Public.

Description

Load 2x resources on demand Currently, this always load 1x. This will be fixed in follow up CL to use currently used scale factor. * Added thread check to ImageSkiaStorage using NonThreadSafe. This is important as GetRepresentation may change the stage now even for the Image obtained from ResourceBundle. * Added SetReadOnly to protect read only resources (ones in ResourceBundle) from being modified by accident. * Addded MakeThreadSafe to guarantee that it can be safely accessed from multiple threads. BUG=141351, 144367 TEST=covered by tests. Also run with --force-device-scale-factor=2 and --load-2x-resources and make sure chrome still uses 2x resources where available. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=153846

Patch Set 1 #

Patch Set 2 : . #

Total comments: 3

Patch Set 3 : NOT FOR REVIEW: Testing thread #

Patch Set 4 : . #

Total comments: 1

Patch Set 5 : cleanup #

Patch Set 6 : cleanup #

Total comments: 1

Patch Set 7 : CHECK -> DCHECK #

Total comments: 4

Patch Set 8 : #

Total comments: 2

Patch Set 9 : remove unnecessary code #

Total comments: 7

Patch Set 10 : #

Total comments: 2

Patch Set 11 : NOT FOR REVIEW #

Patch Set 12 : For preview #

Total comments: 4

Patch Set 13 : #

Patch Set 14 : cleanup #

Total comments: 4

Patch Set 15 : updated comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+521 lines, -192 lines) Patch
M chrome/browser/chromeos/login/user_image_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/wallpaper_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +4 lines, -22 lines 0 comments Download
M chrome/browser/extensions/image_loading_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/icon_loader_chromeos.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/icon_loader_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/icon_loader_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/icon_loader_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/themes/browser_theme_pack.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/themes/browser_theme_pack.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +8 lines, -41 lines 0 comments Download
M chrome/browser/ui/app_list/extension_app_item.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +9 lines, -4 lines 0 comments Download
M chrome/browser/web_applications/web_app_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M ui/app_list/app_list_item_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M ui/app_list/app_list_item_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -9 lines 0 comments Download
M ui/base/resource/resource_bundle.h View 1 2 3 4 3 chunks +9 lines, -4 lines 0 comments Download
M ui/base/resource/resource_bundle.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +104 lines, -49 lines 0 comments Download
M ui/gfx/image/image_skia.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +48 lines, -10 lines 0 comments Download
M ui/gfx/image/image_skia.cc View 1 2 3 4 5 6 7 8 9 10 11 12 16 chunks +122 lines, -24 lines 0 comments Download
M ui/gfx/image/image_skia_source.h View 1 1 chunk +4 lines, -1 line 0 comments Download
M ui/gfx/image/image_skia_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +182 lines, -9 lines 0 comments Download
M ui/gfx/image/image_skia_util_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -5 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
oshima
8 years, 4 months ago (2012-08-08 12:17:49 UTC) #1
sky
http://codereview.chromium.org/10820049/diff/7004/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): http://codereview.chromium.org/10820049/diff/7004/ui/base/resource/resource_bundle.cc#newcode349 ui/base/resource/resource_bundle.cc:349: // Check to see if the image is already ...
8 years, 4 months ago (2012-08-08 14:41:24 UTC) #2
oshima
http://codereview.chromium.org/10820049/diff/7004/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): http://codereview.chromium.org/10820049/diff/7004/ui/base/resource/resource_bundle.cc#newcode349 ui/base/resource/resource_bundle.cc:349: // Check to see if the image is already ...
8 years, 4 months ago (2012-08-08 15:12:15 UTC) #3
sky
On Wed, Aug 8, 2012 at 8:12 AM, <oshima@chromium.org> wrote: > > http://codereview.chromium.org/10820049/diff/7004/ui/base/resource/resource_bundle.cc > File ...
8 years, 4 months ago (2012-08-08 16:10:48 UTC) #4
pkotwicz
The code in BrowserThemePack does in fact use images from the resource bundle off the ...
8 years, 4 months ago (2012-08-08 16:40:26 UTC) #5
bshe
http://codereview.chromium.org/10820049/diff/7004/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): http://codereview.chromium.org/10820049/diff/7004/ui/base/resource/resource_bundle.cc#newcode349 ui/base/resource/resource_bundle.cc:349: // Check to see if the image is already ...
8 years, 4 months ago (2012-08-08 17:26:12 UTC) #6
oshima
Thank you guys for info. I'll investigate thread safety issue and will get back to ...
8 years, 4 months ago (2012-08-09 00:29:25 UTC) #7
oshima
I looked into both cases, and they seems to be fine. 1) Theme Pack: BrowserThemePack ...
8 years, 4 months ago (2012-08-09 07:38:33 UTC) #8
pkotwicz
I think that BrowserThemePack::RepackImages can also generate image reps. Only some of the image reps ...
8 years, 4 months ago (2012-08-09 16:01:47 UTC) #9
sky
I think we have two options here: . Ideally we only need access on the ...
8 years, 4 months ago (2012-08-09 16:35:01 UTC) #10
oshima
On 2012/08/09 16:01:47, pkotwicz wrote: > I think that BrowserThemePack::RepackImages can also generate image reps. ...
8 years, 4 months ago (2012-08-10 01:08:10 UTC) #11
sky
On Thu, Aug 9, 2012 at 6:08 PM, <oshima@chromium.org> wrote: > On 2012/08/09 16:01:47, pkotwicz ...
8 years, 4 months ago (2012-08-10 16:10:51 UTC) #12
oshima
Scott, I added the code to detect multiple thread access and fixed a few places ...
8 years, 4 months ago (2012-08-23 07:23:13 UTC) #13
oshima
http://codereview.chromium.org/10820049/diff/31002/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): http://codereview.chromium.org/10820049/diff/31002/ui/gfx/image/image_skia.cc#newcode108 ui/gfx/image/image_skia.cc:108: // TODO(oshima): Make this DCHECK for M23. crbug.com/144367. Looks ...
8 years, 4 months ago (2012-08-23 14:21:08 UTC) #14
sky
http://codereview.chromium.org/10820049/diff/31005/chrome/browser/themes/browser_theme_pack.cc File chrome/browser/themes/browser_theme_pack.cc (right): http://codereview.chromium.org/10820049/diff/31005/chrome/browser/themes/browser_theme_pack.cc#newcode441 chrome/browser/themes/browser_theme_pack.cc:441: for (ImageCache::iterator it = pack->images_on_file_thread_.begin(); This is too error ...
8 years, 4 months ago (2012-08-23 16:32:32 UTC) #15
oshima
http://codereview.chromium.org/10820049/diff/31005/chrome/browser/themes/browser_theme_pack.cc File chrome/browser/themes/browser_theme_pack.cc (right): http://codereview.chromium.org/10820049/diff/31005/chrome/browser/themes/browser_theme_pack.cc#newcode441 chrome/browser/themes/browser_theme_pack.cc:441: for (ImageCache::iterator it = pack->images_on_file_thread_.begin(); On 2012/08/23 16:32:32, sky ...
8 years, 4 months ago (2012-08-23 16:57:31 UTC) #16
pkotwicz
http://codereview.chromium.org/10820049/diff/18025/chrome/browser/themes/browser_theme_pack.cc File chrome/browser/themes/browser_theme_pack.cc (right): http://codereview.chromium.org/10820049/diff/18025/chrome/browser/themes/browser_theme_pack.cc#newcode447 chrome/browser/themes/browser_theme_pack.cc:447: } Why don't you make images_on_ui_thread_ have images for ...
8 years, 4 months ago (2012-08-23 16:58:48 UTC) #17
oshima
http://codereview.chromium.org/10820049/diff/18025/chrome/browser/themes/browser_theme_pack.cc File chrome/browser/themes/browser_theme_pack.cc (right): http://codereview.chromium.org/10820049/diff/18025/chrome/browser/themes/browser_theme_pack.cc#newcode447 chrome/browser/themes/browser_theme_pack.cc:447: } On 2012/08/23 16:58:48, pkotwicz wrote: > Why don't ...
8 years, 4 months ago (2012-08-23 17:16:50 UTC) #18
sky
Can we add checks to ResourceBundle that loading only happens on the UI thread? http://codereview.chromium.org/10820049/diff/18026/chrome/browser/themes/browser_theme_pack.cc ...
8 years, 4 months ago (2012-08-23 19:44:09 UTC) #19
pkotwicz
http://codereview.chromium.org/10820049/diff/18028/chrome/browser/themes/browser_theme_pack.cc File chrome/browser/themes/browser_theme_pack.cc (right): http://codereview.chromium.org/10820049/diff/18028/chrome/browser/themes/browser_theme_pack.cc#newcode1124 chrome/browser/themes/browser_theme_pack.cc:1124: // Attempt to generate image reps for all supported ...
8 years, 4 months ago (2012-08-23 22:20:33 UTC) #20
oshima
Scott, I added read only mode, and updated places that access ImageSkia from non UI ...
8 years, 4 months ago (2012-08-24 16:45:34 UTC) #21
sky
This seems reasonable, but I have one thought below. http://codereview.chromium.org/10820049/diff/25013/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): http://codereview.chromium.org/10820049/diff/25013/ui/gfx/image/image_skia.cc#newcode240 ui/gfx/image/image_skia.cc:240: ...
8 years, 4 months ago (2012-08-24 18:25:48 UTC) #22
oshima
https://chromiumcodereview.appspot.com/10820049/diff/25013/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): https://chromiumcodereview.appspot.com/10820049/diff/25013/ui/gfx/image/image_skia.cc#newcode240 ui/gfx/image/image_skia.cc:240: storage_->AssertModify(); On 2012/08/24 18:25:48, sky wrote: > One other ...
8 years, 4 months ago (2012-08-24 19:06:45 UTC) #23
oshima
Added SetReadOnly/MakeThreadSafe/DeepCopy to ImageSkia and updated related code. PTAL.
8 years, 3 months ago (2012-08-28 09:33:08 UTC) #24
sky
LGTM http://codereview.chromium.org/10820049/diff/42001/ui/gfx/image/image_skia.h File ui/gfx/image/image_skia.h (right): http://codereview.chromium.org/10820049/diff/42001/ui/gfx/image/image_skia.h#newcode72 ui/gfx/image/image_skia.h:72: // the ImageSkiaRep instances that this ImageSkia currently ...
8 years, 3 months ago (2012-08-28 17:18:14 UTC) #25
oshima
http://codereview.chromium.org/10820049/diff/42001/ui/gfx/image/image_skia.h File ui/gfx/image/image_skia.h (right): http://codereview.chromium.org/10820049/diff/42001/ui/gfx/image/image_skia.h#newcode72 ui/gfx/image/image_skia.h:72: // the ImageSkiaRep instances that this ImageSkia currently have. ...
8 years, 3 months ago (2012-08-28 21:23:34 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/oshima@chromium.org/10820049/35021
8 years, 3 months ago (2012-08-28 21:25:13 UTC) #27
commit-bot: I haz the power
8 years, 3 months ago (2012-08-29 03:46:29 UTC) #28
Change committed as 153846

Powered by Google App Engine
This is Rietveld 408576698