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

Issue 2738133002: Provide an overload to WebView::create that does not require a WebViewClient. (Closed)

Created:
3 years, 9 months ago by slangley
Modified:
3 years, 9 months ago
Reviewers:
sashab, dcheng
CC:
apacible+watch_chromium.org, avayvod+watch_chromium.org, blink-reviews, blink-reviews-api_chromium.org, chfremer+watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, erickung+watch_chromium.org, extensions-reviews_chromium.org, feature-media-reviews_chromium.org, jam, kinuko+watch, mcasas+watch+vc_chromium.org, miu+watch_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-media_chromium.org, posciak+watch_chromium.org, xjz+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Provide an overload to WebView::create that does not require a WebViewClient. Provide an overload to WebView::create and WebViewImpl::create where a that does not require WebViewClient or nullptr to be passed. This is part of the pre-work to make it invalid to pass a nullptr to WebView::create - it makes more sense for clients to be able to call a specific method when they don't want to supply a client rathen than passing nullptr. Also added DCHECK() to WebView*::create(WebViewClient*) to prevent nullptr being passed, and went and cleaned up all of the call sites. Followup work will create a internal specialization of WebViewClient that will behave the way that a null WebViewClient works today. BUG=696895 COMMIT=false

Patch Set 1 #

Patch Set 2 : Add a derived WebViewClient and use it when no client is passed. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -14 lines) Patch
M components/printing/renderer/print_web_view_helper.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/android/media_info_loader_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/scoped_web_frame.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/blink/multibuffer_data_source_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/blink/resource_multibuffer_data_provider_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/blink/webmediaplayer_impl_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 1 chunk +17 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebViewTest.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/public/web/WebView.h View 1 chunk +9 lines, -3 lines 0 comments Download

Messages

Total messages: 22 (4 generated)
slangley
3 years, 9 months ago (2017-03-09 04:31:01 UTC) #2
sashab
LGTM but please get another review :) Also great CL description, you're starting to get ...
3 years, 9 months ago (2017-03-09 04:43:10 UTC) #4
slangley
dcheng - ptal
3 years, 9 months ago (2017-03-09 04:54:39 UTC) #6
dcheng
On 2017/03/09 04:54:39, slangley wrote: > dcheng - ptal Hmm, so one of the motivating ...
3 years, 9 months ago (2017-03-09 05:13:06 UTC) #7
slangley
On 2017/03/09 05:13:06, dcheng wrote: > On 2017/03/09 04:54:39, slangley wrote: > > dcheng - ...
3 years, 9 months ago (2017-03-09 05:24:46 UTC) #8
dcheng
On 2017/03/09 05:24:46, slangley wrote: > On 2017/03/09 05:13:06, dcheng wrote: > > On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 05:30:42 UTC) #9
slangley
On 2017/03/09 05:30:42, dcheng wrote: > On 2017/03/09 05:24:46, slangley wrote: > > On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 05:36:05 UTC) #10
dcheng
On 2017/03/09 05:36:05, slangley wrote: > On 2017/03/09 05:30:42, dcheng wrote: > > On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 19:35:35 UTC) #11
slangley
On 2017/03/09 19:35:35, dcheng wrote: > On 2017/03/09 05:36:05, slangley wrote: > > On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 22:35:53 UTC) #12
slangley
On 2017/03/09 22:35:53, slangley wrote: > On 2017/03/09 19:35:35, dcheng wrote: > > On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 22:42:31 UTC) #13
dcheng
On 2017/03/09 22:42:31, slangley wrote: > On 2017/03/09 22:35:53, slangley wrote: > > On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 22:49:22 UTC) #14
slangley
On 2017/03/09 22:49:22, dcheng wrote: > On 2017/03/09 22:42:31, slangley wrote: > > On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 22:55:30 UTC) #15
dcheng
On 2017/03/09 22:55:30, slangley wrote: > On 2017/03/09 22:49:22, dcheng wrote: > > On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 23:06:17 UTC) #16
slangley
dcheng@ - so i added some code to WebViewImpl.cc to illustrate my idea. It cannot ...
3 years, 9 months ago (2017-03-10 02:40:44 UTC) #18
dcheng
On 2017/03/10 02:40:44, slangley wrote: > dcheng@ - so i added some code to WebViewImpl.cc ...
3 years, 9 months ago (2017-03-10 02:53:28 UTC) #19
slangley
On 2017/03/10 at 02:53:28, dcheng wrote: > On 2017/03/10 02:40:44, slangley wrote: > > dcheng@ ...
3 years, 9 months ago (2017-03-10 03:01:22 UTC) #20
dcheng
On 2017/03/10 03:01:22, slangley wrote: > On 2017/03/10 at 02:53:28, dcheng wrote: > > On ...
3 years, 9 months ago (2017-03-10 03:27:40 UTC) #21
slangley
3 years, 9 months ago (2017-03-10 05:46:31 UTC) #22
On 2017/03/10 at 03:27:40, dcheng wrote:
> On 2017/03/10 03:01:22, slangley wrote:
> > On 2017/03/10 at 02:53:28, dcheng wrote:
> > > On 2017/03/10 02:40:44, slangley wrote:
> > > > dcheng@ - so i added some code to WebViewImpl.cc to illustrate my idea.
It
> > > > cannot be submitted in this state as it cases tests to fail in places,
but
> > you
> > > > get the idea.
> > > > 
> > > > WDYT of this approach?
> > > 
> > > Hmm... I think I'd rather just explicitly pass a client to use. It doesn't
> > seem like it's a big burden to do so here, especially given the small number
of
> > callsites.
> > 
> > OK - in that case do you expect local callers to derive their own
WebViewClient,
> > or should we provide one in the public API, or should we make WebViewClient
> > instantiable and expect each callsite to manage the life cycle(note this
would
> > require additional changes to existing derived WebViewClients)?
> 
> They can just derive one themselves. It'll likely be a direct subclass with no
overrides most of the time, but I think that's OK.

Ok I'll spin up a new CL for doing it that way and keep this one as is for now.

Powered by Google App Engine
This is Rietveld 408576698