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

Issue 2423213002: Remove a bunch of pointless null checks in FrameLoaderClientImpl.

Created:
4 years, 2 months ago by dcheng
Modified:
4 years, 1 month ago
CC:
blink-reviews, chromium-reviews, kinuko+watch
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove a bunch of unnecessary null checks in FrameLoaderClientImpl. WebLocalFrame can no longer be created with a null client: it's guaranteed to have a non-null client until it's detached. Since FrameLoaderClient only becomes null when a LocalFrame is detached, having a non-null FrameLoaderClient implies that WebFrameClient is also non-null. BUG=none

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : Remove unnecessary check #

Patch Set 4 : Fix formatting. #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -194 lines) Patch
M third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp View 1 2 3 26 chunks +84 lines, -182 lines 0 comments Download
M third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h View 1 1 chunk +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp View 1 2 chunks +10 lines, -5 lines 5 comments Download
M third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp View 1 4 chunks +15 lines, -4 lines 6 comments Download

Messages

Total messages: 25 (17 generated)
dcheng
+esprehn for overall review +toyoshim for worker stuff (I don't really understand the shadow page ...
4 years, 2 months ago (2016-10-17 22:33:29 UTC) #13
Takashi Toyoshima
+nhiroki who owns worker related code
4 years, 2 months ago (2016-10-19 07:31:59 UTC) #17
dcheng
esprehn: ping =)
4 years, 2 months ago (2016-10-19 22:09:04 UTC) #18
nhiroki
Does this issue block your project or something? If it blocks nothing, I'd prefer to ...
4 years, 2 months ago (2016-10-20 05:57:12 UTC) #19
kinuko
https://codereview.chromium.org/2423213002/diff/60001/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp File third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp (right): https://codereview.chromium.org/2423213002/diff/60001/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp#newcode356 third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp:356: WTF::unretained(this))); WebViewImpl::close in this class's dtor could synchronously call ...
4 years, 2 months ago (2016-10-20 13:01:54 UTC) #21
dcheng
On 2016/10/20 05:57:12, nhiroki (slow) wrote: > Does this issue block your project or something? ...
4 years, 2 months ago (2016-10-20 17:45:38 UTC) #23
esprehn
lgtm, but I'd prefer we return the empty interface provider instead of null. :) Also ...
4 years, 1 month ago (2016-10-24 21:27:08 UTC) #24
dcheng
4 years, 1 month ago (2016-10-24 21:31:34 UTC) #25
On 2016/10/24 21:27:08, esprehn wrote:
> lgtm, but I'd prefer we return the empty interface provider instead of null.
:)
> 
> Also I wonder if client() should return a reference, and ASSERT() internally
> that it's never null. Then code that can get called should check some method
> like !m_webFrame->isActive() and early return instead of null checking
client().

Yep! That's basically the idea I ran by Nate last week, so I'm glad that
multiple people feel this is the right long-term approach =)

> That puts an implicit null check at all of the users of client() which is
nice.
> 
>
https://codereview.chromium.org/2423213002/diff/60001/third_party/WebKit/Sour...
> File third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp (right):
> 
>
https://codereview.chromium.org/2423213002/diff/60001/third_party/WebKit/Sour...
> third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp:198: if
> (m_askedToTerminate)
> should m_networkProvider be nulled out once this is true?
> 
>
https://codereview.chromium.org/2423213002/diff/60001/third_party/WebKit/Sour...
> third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp:208: return
> m_networkProvider->serviceWorkerID(dataSource);
> ditto?
> 
>
https://codereview.chromium.org/2423213002/diff/60001/third_party/WebKit/Sour...
> third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp:213: return nullptr;
> Can we return getEmptyInterfaceProvider() instead? That avoids null checks on
> interfaceProvider() which should ideally never return null

I'll reply to this CL once I get the loading callbacks CL landed (and hopefully
don't need the hacks in the worker code)

Powered by Google App Engine
This is Rietveld 408576698