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

Issue 10880025: [Android] Fix handling of asset files loading. (Closed)

Created:
8 years, 3 months ago by mnaganov (inactive)
Modified:
8 years, 3 months ago
Reviewers:
joth, Sami
CC:
chromium-reviews
Visibility:
Public.

Description

[Android] Fix handling of asset files loading. This is needed after https://chromiumcodereview.appspot.com/10700117. BUG=144266 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=154102

Patch Set 1 #

Total comments: 9

Patch Set 2 : Comments addressed #

Total comments: 14

Patch Set 3 : Comments addressed #

Total comments: 6

Patch Set 4 : Comments addressed #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -31 lines) Patch
M chrome/browser/android/android_protocol_adapter.h View 1 2 3 1 chunk +20 lines, -3 lines 0 comments Download
M chrome/browser/android/android_protocol_adapter.cc View 1 2 3 5 chunks +89 lines, -28 lines 5 comments Download

Messages

Total messages: 16 (0 generated)
mnaganov (inactive)
Sami, I think you wrote the original code, please take a look. Joth, need owner's ...
8 years, 3 months ago (2012-08-23 17:17:28 UTC) #1
joth
https://chromiumcodereview.appspot.com/10880025/diff/1/chrome/browser/android/android_protocol_adapter.cc File chrome/browser/android/android_protocol_adapter.cc (right): https://chromiumcodereview.appspot.com/10880025/diff/1/chrome/browser/android/android_protocol_adapter.cc#newcode15 chrome/browser/android/android_protocol_adapter.cc:15: #include "chrome/common/url_constants.h" prefer to be removing chrome/ deps from ...
8 years, 3 months ago (2012-08-23 18:23:28 UTC) #2
mnaganov (inactive)
https://chromiumcodereview.appspot.com/10880025/diff/1/chrome/browser/android/android_protocol_adapter.cc File chrome/browser/android/android_protocol_adapter.cc (right): https://chromiumcodereview.appspot.com/10880025/diff/1/chrome/browser/android/android_protocol_adapter.cc#newcode15 chrome/browser/android/android_protocol_adapter.cc:15: #include "chrome/common/url_constants.h" On 2012/08/23 18:23:28, joth wrote: > prefer ...
8 years, 3 months ago (2012-08-24 12:53:05 UTC) #3
joth
https://chromiumcodereview.appspot.com/10880025/diff/5001/chrome/browser/android/android_protocol_adapter.cc File chrome/browser/android/android_protocol_adapter.cc (right): https://chromiumcodereview.appspot.com/10880025/diff/5001/chrome/browser/android/android_protocol_adapter.cc#newcode99 chrome/browser/android/android_protocol_adapter.cc:99: network_delegate, did you mean this? Looks like a compile ...
8 years, 3 months ago (2012-08-24 17:28:28 UTC) #4
mnaganov (inactive)
https://chromiumcodereview.appspot.com/10880025/diff/5001/chrome/browser/android/android_protocol_adapter.cc File chrome/browser/android/android_protocol_adapter.cc (right): https://chromiumcodereview.appspot.com/10880025/diff/5001/chrome/browser/android/android_protocol_adapter.cc#newcode99 chrome/browser/android/android_protocol_adapter.cc:99: network_delegate, On 2012/08/24 17:28:28, joth wrote: > did you ...
8 years, 3 months ago (2012-08-24 18:17:22 UTC) #5
joth
https://chromiumcodereview.appspot.com/10880025/diff/5001/chrome/browser/android/android_protocol_adapter.cc File chrome/browser/android/android_protocol_adapter.cc (right): https://chromiumcodereview.appspot.com/10880025/diff/5001/chrome/browser/android/android_protocol_adapter.cc#newcode99 chrome/browser/android/android_protocol_adapter.cc:99: network_delegate, On 2012/08/24 18:17:22, Mikhail Naganov (Chromium) wrote: > ...
8 years, 3 months ago (2012-08-24 23:22:26 UTC) #6
Sami
https://chromiumcodereview.appspot.com/10880025/diff/9001/chrome/browser/android/android_protocol_adapter.cc File chrome/browser/android/android_protocol_adapter.cc (right): https://chromiumcodereview.appspot.com/10880025/diff/9001/chrome/browser/android/android_protocol_adapter.cc#newcode73 chrome/browser/android/android_protocol_adapter.cc:73: virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) const OVERRIDE; Line length? https://chromiumcodereview.appspot.com/10880025/diff/9001/chrome/browser/android/android_protocol_adapter.cc#newcode115 ...
8 years, 3 months ago (2012-08-28 11:10:50 UTC) #7
mnaganov (inactive)
On 2012/08/24 23:22:26, joth wrote: > https://chromiumcodereview.appspot.com/10880025/diff/5001/chrome/browser/android/android_protocol_adapter.cc > File chrome/browser/android/android_protocol_adapter.cc (right): > > https://chromiumcodereview.appspot.com/10880025/diff/5001/chrome/browser/android/android_protocol_adapter.cc#newcode99 > ...
8 years, 3 months ago (2012-08-28 13:07:47 UTC) #8
mnaganov (inactive)
https://chromiumcodereview.appspot.com/10880025/diff/9001/chrome/browser/android/android_protocol_adapter.cc File chrome/browser/android/android_protocol_adapter.cc (right): https://chromiumcodereview.appspot.com/10880025/diff/9001/chrome/browser/android/android_protocol_adapter.cc#newcode73 chrome/browser/android/android_protocol_adapter.cc:73: virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) const OVERRIDE; On 2012/08/28 11:10:50, ...
8 years, 3 months ago (2012-08-28 13:08:00 UTC) #9
mnaganov (inactive)
joth@ -- what do you think now? I would like to have this fix submitted, ...
8 years, 3 months ago (2012-08-29 14:25:19 UTC) #10
joth
lgtm sorry thought I already sent this one yesterday... :/ just a couple nits. https://chromiumcodereview.appspot.com/10880025/diff/13001/chrome/browser/android/android_protocol_adapter.cc ...
8 years, 3 months ago (2012-08-29 19:49:33 UTC) #11
mnaganov (inactive)
https://chromiumcodereview.appspot.com/10880025/diff/13001/chrome/browser/android/android_protocol_adapter.cc File chrome/browser/android/android_protocol_adapter.cc (right): https://chromiumcodereview.appspot.com/10880025/diff/13001/chrome/browser/android/android_protocol_adapter.cc#newcode249 chrome/browser/android/android_protocol_adapter.cc:249: kAssetPrefix(std::string(chrome::kFileScheme) + On 2012/08/29 19:49:33, joth wrote: > nit: ...
8 years, 3 months ago (2012-08-30 09:24:38 UTC) #12
joth
new patch upload? (sgtm though from comments, so you can tbr if you want to ...
8 years, 3 months ago (2012-08-30 18:10:40 UTC) #13
mnaganov (inactive)
On 2012/08/30 18:10:40, joth wrote: > new patch upload? > I have committed it already ...
8 years, 3 months ago (2012-08-30 20:11:23 UTC) #14
joth
On 30 August 2012 13:11, <mnaganov@chromium.org> wrote: > On 2012/08/30 18:10:40, joth wrote: > >> ...
8 years, 3 months ago (2012-08-30 20:23:56 UTC) #15
joth
8 years, 3 months ago (2012-08-30 20:23:56 UTC) #16
On 30 August 2012 13:11, <mnaganov@chromium.org> wrote:

> On 2012/08/30 18:10:40, joth wrote:
>
>> new patch upload?
>>
>
>
> I have committed it already after fixing your last comments. There is a
> link to
> the committed revision:
>
https://src.chromium.org/**viewvc/chrome?view=rev&**revision=154102<https://s...
>
>
> Ha, of course. I'm too used to gerrit now  where a new patchset is always
uploaded...
 Thanks.



>  (sgtm though from comments, so you can tbr if you want to land without
>> another
>> day passing)
>>
>
>
> https://chromiumcodereview.**appspot.com/10880025/diff/**
>
13001/chrome/browser/android/**android_protocol_adapter.cc<https://chromiumcodereview.appspot.com/10880025/diff/13001/chrome/browser/android/android_protocol_adapter.cc>
>
>> File chrome/browser/android/**android_protocol_adapter.cc (right):
>>
>
>
> https://chromiumcodereview.**appspot.com/10880025/diff/**
>
13001/chrome/browser/android/**android_protocol_adapter.cc#**newcode252<https://chromiumcodereview.appspot.com/10880025/diff/13001/chrome/browser/android/android_protocol_adapter.cc#newcode252>
>
>> chrome/browser/android/**android_protocol_adapter.cc:**252:
>> kResourcePrefix(std::string(**chrome::kFileScheme) +
>> On 2012/08/30 09:24:38, Mikhail Naganov (Chromium) wrote:
>> > On 2012/08/29 19:49:33, joth wrote:
>> > > nit: I think technically kConst is only for things constants that are
>> > statically
>> > > defined at compile time.
>> > >
>> >
>> > Agree. Changed to asset_prefix_ and resource_prefix_.
>> >
>> > > On balance I think these may as well be done that way too (i.e.:
>> static
>> const
>> > > char[] kFoo = "file://android_asset"). while it means we 'duplicate'
>> parts
>> of
>> > > the string literals on the flip side it makes it much easier to see
>> (and
>> > verify)
>> > > exactly what those constants contains, and in reality these aren't
>> going
>>
> to
>
>> > > change a whole lot as they're in the public API spec.
>> >
>> > Well, URI scheme names also doesn't change, but we anyway have
>> constants for
>> > them. One reason for using constants is that if you mistype the name of
>> the
>> > constant, you'll get a compiler error. For clarity, I've added comments
>> for
>> > these constants with their intended values.
>>
>
>  Ah I wasn't meaning to suggest removing constants, just change them to be
>> true
>> compile-time constants, e.g.:
>>
>
>  namespace {
>> const char[] kAndroidAssetPrefix = "file://android_asset";
>> ...
>> }
>>
>
> That's what I was talking about -- make a typo in the constant value (BTW,
> it
> should be "file:///android_asset/", which is automagically derived from the
> result of other constants concatenation), and you are screwed. While if
> you make
> a typo in the constant name, the code will not compile.
>
>
Yes, that's true. (although many would argue, this is what we have tests
for)
[I just see the 10 temporary std::string instances created in the process
of initializing 2 constants and may head spins :) ]



>
>
https://chromiumcodereview.**appspot.com/10880025/<https://chromiumcodereview...
>

Powered by Google App Engine
This is Rietveld 408576698