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

Issue 1350553005: [Android WebView] Call shouldInterceptRequest on a background thread (Closed)

Created:
5 years, 3 months ago by mnaganov (inactive)
Modified:
5 years, 2 months ago
Reviewers:
boliu, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, android-webview-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android WebView] Call shouldInterceptRequest on a background thread Move the call to WebViewClient.shouldInterceptRequest from IO thread to a background thread. This is in order to avoid situations when embedder's code blocks inside shouldInterceptRequest callback, and this effectively shuts down IPC messages processing. BUG=533082 R=boliu@chromium.org, mmenke@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/0f79c573df3eeebd91bb056686bbade31a6aa5fd

Patch Set 1 #

Patch Set 2 : Rebased #

Patch Set 3 : Presumably fixed crashes #

Patch Set 4 : Working draft (with DEPS violations) #

Patch Set 5 : Rebased after The Merge #

Patch Set 6 : Use FILE thread #

Patch Set 7 : Final version? #

Total comments: 16

Patch Set 8 : Comments addressed #

Total comments: 28

Patch Set 9 : mmenke@'s comments addressed #

Patch Set 10 : Removed unneeded method #

Patch Set 11 : Trying --find-copies #

Patch Set 12 : Trying --similarity=20 #

Patch Set 13 : Fixed indent in AwStreamReaderJobDelegateImpl #

Total comments: 5

Patch Set 14 : Should not crash, but still not all tests pass #

Patch Set 15 : Initialize new boolean fields in AndroidStreamReaderURLRequestJob #

Patch Set 16 : Get rid of has_been_killed #

Total comments: 12

Patch Set 17 : Refactored as suggested by mmenke@ #

Patch Set 18 : Moved code a bit #

Total comments: 20

Patch Set 19 : Post-refactoring comments addressed #

Patch Set 20 : Re-uploading with standard diff settings to work around Windows patch issues #

Unified diffs Side-by-side diffs Delta from patch set Stats (+515 lines, -408 lines) Patch
M android_webview/android_webview.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +3 lines, -4 lines 0 comments Download
M android_webview/browser/aw_contents_io_thread_client.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -2 lines 0 comments Download
M android_webview/browser/aw_request_interceptor.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -46 lines 0 comments Download
M android_webview/browser/aw_request_interceptor.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -90 lines 0 comments Download
M android_webview/browser/aw_web_resource_response.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -60 lines 0 comments Download
M android_webview/browser/aw_web_resource_response.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -86 lines 0 comments Download
M android_webview/browser/net/android_stream_reader_url_request_job.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +27 lines, -4 lines 0 comments Download
M android_webview/browser/net/android_stream_reader_url_request_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +55 lines, -19 lines 0 comments Download
A + android_webview/browser/net/aw_request_interceptor.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -11 lines 0 comments Download
A android_webview/browser/net/aw_request_interceptor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +157 lines, -0 lines 0 comments Download
M android_webview/browser/net/aw_url_request_context_getter.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
A + android_webview/browser/net/aw_web_resource_response.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +3 lines, -13 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +35 lines, -24 lines 0 comments Download
A android_webview/java/src/org/chromium/android_webview/AwContentsBackgroundThreadClient.java View 1 2 3 4 5 6 7 12 13 14 15 16 17 18 19 1 chunk +40 lines, -0 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContentsIoThreadClient.java View 1 2 3 4 5 6 2 chunks +2 lines, -19 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java View 1 2 3 4 5 6 6 chunks +50 lines, -8 lines 0 comments Download
M android_webview/native/android_webview_jni_registrar.cc View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
A android_webview/native/aw_contents_background_thread_client.h View 1 2 3 4 5 6 12 13 14 15 16 17 18 19 1 chunk +30 lines, -0 lines 0 comments Download
A android_webview/native/aw_contents_background_thread_client.cc View 1 2 3 4 5 6 7 12 13 14 15 16 17 18 19 1 chunk +31 lines, -0 lines 0 comments Download
M android_webview/native/aw_contents_io_thread_client_impl.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M android_webview/native/aw_contents_io_thread_client_impl.cc View 1 2 3 4 5 6 7 4 chunks +61 lines, -18 lines 0 comments Download
M android_webview/native/aw_web_resource_response_impl.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M android_webview/native/webview_native.gyp View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 46 (9 generated)
mnaganov (inactive)
Hi Bo, Can you please look at the CL? I plan to show it to ...
5 years, 2 months ago (2015-09-28 22:41:54 UTC) #2
boliu
Mostly small-ish comments I think. Overall makes sense to me. The part I'm not entirely ...
5 years, 2 months ago (2015-09-28 23:26:28 UTC) #3
mnaganov (inactive)
Thanks for the comments, Bo! https://codereview.chromium.org/1350553005/diff/120001/android_webview/browser/aw_contents_io_thread_client.h File android_webview/browser/aw_contents_io_thread_client.h (right): https://codereview.chromium.org/1350553005/diff/120001/android_webview/browser/aw_contents_io_thread_client.h#newcode75 android_webview/browser/aw_contents_io_thread_client.h:75: const base::Callback<void(scoped_ptr<AwWebResourceResponse>)> On 2015/09/28 ...
5 years, 2 months ago (2015-09-29 00:14:06 UTC) #4
mnaganov (inactive)
Hi Matt, Can you please look at aw_request_interceptor*, aw_request_handler*, and android_stream_reader_url_request_job* to make sure that ...
5 years, 2 months ago (2015-09-29 00:16:42 UTC) #6
mmenke
Just looked at the browser/ files. Only real concerns are with ref counting, though also ...
5 years, 2 months ago (2015-09-29 15:56:06 UTC) #7
mnaganov (inactive)
Thanks for awesome comments, Matt! I think now the code should look much simpler and ...
5 years, 2 months ago (2015-09-29 23:45:36 UTC) #8
boliu
Possible to avoid moving *existing* files? Or maybe could tweak git cl upload --similarity= Can't ...
5 years, 2 months ago (2015-09-30 00:14:47 UTC) #9
mnaganov (inactive)
On 2015/09/30 00:14:47, boliu wrote: > Possible to avoid moving *existing* files? Or maybe could ...
5 years, 2 months ago (2015-09-30 00:23:50 UTC) #10
boliu
lgtm https://codereview.chromium.org/1350553005/diff/240001/android_webview/browser/net/aw_request_interceptor.cc File android_webview/browser/net/aw_request_interceptor.cc (left): https://codereview.chromium.org/1350553005/diff/240001/android_webview/browser/net/aw_request_interceptor.cc#oldcode67 android_webview/browser/net/aw_request_interceptor.cc:67: // See if we've already found out the ...
5 years, 2 months ago (2015-09-30 00:43:20 UTC) #11
mnaganov (inactive)
Hmmm... Now I'm getting a DCHECK failure because AndroidStreamReaderURLRequestJob::Start() is getting called twice in a ...
5 years, 2 months ago (2015-09-30 01:01:50 UTC) #12
mnaganov (inactive)
https://codereview.chromium.org/1350553005/diff/240001/android_webview/browser/net/aw_request_interceptor.cc File android_webview/browser/net/aw_request_interceptor.cc (left): https://codereview.chromium.org/1350553005/diff/240001/android_webview/browser/net/aw_request_interceptor.cc#oldcode67 android_webview/browser/net/aw_request_interceptor.cc:67: // See if we've already found out the aw_web_resource_response ...
5 years, 2 months ago (2015-09-30 18:05:30 UTC) #13
boliu
https://codereview.chromium.org/1350553005/diff/240001/android_webview/browser/net/aw_request_interceptor.cc File android_webview/browser/net/aw_request_interceptor.cc (left): https://codereview.chromium.org/1350553005/diff/240001/android_webview/browser/net/aw_request_interceptor.cc#oldcode67 android_webview/browser/net/aw_request_interceptor.cc:67: // See if we've already found out the aw_web_resource_response ...
5 years, 2 months ago (2015-09-30 18:06:19 UTC) #14
mnaganov (inactive)
mmenke@: Matt, please take a look! I figured out what was the problem -- I ...
5 years, 2 months ago (2015-09-30 18:09:17 UTC) #15
mmenke
On 2015/09/30 18:09:17, mnaganov wrote: > mmenke@: Matt, please take a look! > > I ...
5 years, 2 months ago (2015-09-30 18:41:30 UTC) #16
mmenke
android_webview/browser/net/ LGTM, just a couple suggestions. https://chromiumcodereview.appspot.com/1350553005/diff/300001/android_webview/browser/net/android_stream_reader_url_request_job.h File android_webview/browser/net/android_stream_reader_url_request_job.h (right): https://chromiumcodereview.appspot.com/1350553005/diff/300001/android_webview/browser/net/android_stream_reader_url_request_job.h#newcode83 android_webview/browser/net/android_stream_reader_url_request_job.h:83: scoped_ptr<Delegate> delegate); nit: ...
5 years, 2 months ago (2015-09-30 21:13:34 UTC) #17
mnaganov (inactive)
Thanks, Matt! Awesome suggestions again :) https://codereview.chromium.org/1350553005/diff/300001/android_webview/browser/net/android_stream_reader_url_request_job.h File android_webview/browser/net/android_stream_reader_url_request_job.h (right): https://codereview.chromium.org/1350553005/diff/300001/android_webview/browser/net/android_stream_reader_url_request_job.h#newcode83 android_webview/browser/net/android_stream_reader_url_request_job.h:83: scoped_ptr<Delegate> delegate); On ...
5 years, 2 months ago (2015-10-01 18:04:30 UTC) #18
mmenke
https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/android_stream_reader_url_request_job.h File android_webview/browser/net/android_stream_reader_url_request_job.h (right): https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/android_stream_reader_url_request_job.h#newcode81 android_webview/browser/net/android_stream_reader_url_request_job.h:81: Callback callback) = 0; nit: const Callback& https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/android_stream_reader_url_request_job.h#newcode83 android_webview/browser/net/android_stream_reader_url_request_job.h:83: ...
5 years, 2 months ago (2015-10-01 18:34:40 UTC) #19
mmenke
https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/aw_request_interceptor.cc File android_webview/browser/net/aw_request_interceptor.cc (right): https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/aw_request_interceptor.cc#newcode92 android_webview/browser/net/aw_request_interceptor.cc:92: base::Unretained(this))); On 2015/10/01 18:34:40, mmenke wrote: > This should ...
5 years, 2 months ago (2015-10-01 18:41:35 UTC) #20
boliu
https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/android_stream_reader_url_request_job.cc File android_webview/browser/net/android_stream_reader_url_request_job.cc (right): https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/android_stream_reader_url_request_job.cc#newcode297 android_webview/browser/net/android_stream_reader_url_request_job.cc:297: delegate_obtainer_.reset(nullptr); nit: just reset() https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/android_stream_reader_url_request_job.cc#newcode299 android_webview/browser/net/android_stream_reader_url_request_job.cc:299: delegate_.swap(delegate); DCHECK(!delegate_) before ...
5 years, 2 months ago (2015-10-01 19:13:56 UTC) #21
mnaganov (inactive)
Really appreciated that you have took another look, guys! I addressed your comments, planning to ...
5 years, 2 months ago (2015-10-01 19:51:04 UTC) #22
mmenke
https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/aw_request_interceptor.cc File android_webview/browser/net/aw_request_interceptor.cc (right): https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/aw_request_interceptor.cc#newcode87 android_webview/browser/net/aw_request_interceptor.cc:87: io_thread_client_->ShouldInterceptRequestAsync( On 2015/10/01 19:51:04, mnaganov wrote: > On 2015/10/01 ...
5 years, 2 months ago (2015-10-01 20:06:53 UTC) #23
boliu
lgtm https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/aw_request_interceptor.cc File android_webview/browser/net/aw_request_interceptor.cc (right): https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/aw_request_interceptor.cc#newcode87 android_webview/browser/net/aw_request_interceptor.cc:87: io_thread_client_->ShouldInterceptRequestAsync( On 2015/10/01 20:06:53, mmenke wrote: > On ...
5 years, 2 months ago (2015-10-01 20:28:37 UTC) #24
mnaganov (inactive)
On 2015/10/01 20:06:53, mmenke wrote: > https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/aw_request_interceptor.cc > File android_webview/browser/net/aw_request_interceptor.cc (right): > > https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/aw_request_interceptor.cc#newcode87 > ...
5 years, 2 months ago (2015-10-01 20:32:33 UTC) #25
mmenke
On 2015/10/01 20:32:33, mnaganov wrote: > On 2015/10/01 20:06:53, mmenke wrote: > > > https://codereview.chromium.org/1350553005/diff/330024/android_webview/browser/net/aw_request_interceptor.cc ...
5 years, 2 months ago (2015-10-01 20:36:20 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350553005/350001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350553005/350001
5 years, 2 months ago (2015-10-01 20:38:19 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/111848)
5 years, 2 months ago (2015-10-01 20:49:42 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350553005/370001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350553005/370001
5 years, 2 months ago (2015-10-01 20:56:24 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/104671) win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, ...
5 years, 2 months ago (2015-10-01 21:02:27 UTC) #35
boliu
On 2015/10/01 21:02:27, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 2 months ago (2015-10-01 21:04:01 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350553005/370001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350553005/370001
5 years, 2 months ago (2015-10-01 21:06:36 UTC) #38
mnaganov (inactive)
Yeah, discovered that in the logs -- the bots are just failing while trying to ...
5 years, 2 months ago (2015-10-01 21:07:08 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_ng/builds/48405) win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, ...
5 years, 2 months ago (2015-10-01 21:07:37 UTC) #41
mnaganov (inactive)
On 2015/10/01 21:07:37, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 2 months ago (2015-10-01 21:36:05 UTC) #42
boliu
On 2015/10/01 21:36:05, mnaganov wrote: > On 2015/10/01 21:07:37, commit-bot: I haz the power wrote: ...
5 years, 2 months ago (2015-10-01 21:39:18 UTC) #43
commit-bot: I haz the power
Patchset 20 (id:??) landed as https://crrev.com/0f79c573df3eeebd91bb056686bbade31a6aa5fd Cr-Commit-Position: refs/heads/master@{#351894}
5 years, 2 months ago (2015-10-01 21:40:48 UTC) #44
mnaganov (inactive)
Committed patchset #20 (id:370001) manually as 0f79c573df3eeebd91bb056686bbade31a6aa5fd (presubmit successful).
5 years, 2 months ago (2015-10-01 21:41:13 UTC) #45
mnaganov (inactive)
5 years, 2 months ago (2015-10-01 21:41:59 UTC) #46
Message was sent while issue was closed.
Right, and win_chromium_compile_dbg_ng was green once, so should be OK.

On Thu, Oct 1, 2015 at 2:39 PM, <boliu@chromium.org> wrote:

> On 2015/10/01 21:36:05, mnaganov wrote:
>
>> On 2015/10/01 21:07:37, commit-bot: I haz the power wrote:
>> > Try jobs failed on following builders:
>> >   win8_chromium_ng on tryserver.chromium.win (JOB_FAILED,
>> >
>>
>
>
>
http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_ng/...
> )
>
>> >   win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED,
>> >
>>
>
>
>
http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...
> )
>
>> >   win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED,
>> >
>>
>
>
>
http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...
> )
>
> OK, since all the bots are green except for Windows bots (which we couldn't
>> possibly break), and we had 'win_chromium_compile_dbg_ng' green for PS 19,
>>
> I'll
>
>> try landing manually.
>>
>
> Android-only changes can break windows bots:
> https://codereview.chromium.org/1357643002#msg14
>
> But.. not doing any case-sensitive renames here, so probably ok
>
> https://codereview.chromium.org/1350553005/
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698