Bug 208698

Summary: Some PDFPlugin cleanup in prep for incremental loading
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebKit Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
achristensen: review+
PFL none

Description Brady Eidson 2020-03-05 22:35:41 PST
Some PDFPlugin cleanup in prep for incremental loading

The frame is never cleared, so make it a reference.
Use a new "number of streamed bytes" variable instead of grabbing m_data's length, as m_data will soon become a "sparse" data buffer
Comment 1 Brady Eidson 2020-03-05 22:38:47 PST
Created attachment 392681 [details]
Patch
Comment 2 Brady Eidson 2020-03-06 07:36:49 PST
Created attachment 392719 [details]
Patch
Comment 3 Alex Christensen 2020-03-06 14:45:11 PST
Comment on attachment 392719 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392719&action=review

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:275
> +    WebFrame& m_frame;

Should we use a WeakPtr instead?

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:1347
> +    if (FrameView* frameView = m_frame.coreFrame()->view())

auto?

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:1854
> +    Frame* frame = m_frame.coreFrame();

auto?
Comment 4 Brady Eidson 2020-03-06 15:17:33 PST
(In reply to Alex Christensen from comment #3)
> Comment on attachment 392719 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=392719&action=review
> 
> > Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:275
> > +    WebFrame& m_frame;
> 
> Should we use a WeakPtr instead?

As this is no behavior change and we have no reason to believe it's currently a problem, not right now.

> 
> > Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:1347
> > +    if (FrameView* frameView = m_frame.coreFrame()->view())
> 
> auto?
> 
> > Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:1854
> > +    Frame* frame = m_frame.coreFrame();
> 
> auto?

Sure.
Comment 5 Brady Eidson 2020-03-06 15:21:50 PST
Created attachment 392786 [details]
PFL
Comment 6 WebKit Commit Bot 2020-03-06 17:45:01 PST
Comment on attachment 392786 [details]
PFL

Clearing flags on attachment: 392786

Committed r258043: <https://trac.webkit.org/changeset/258043>
Comment 7 WebKit Commit Bot 2020-03-06 17:45:03 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2020-03-06 17:46:13 PST
<rdar://problem/60178033>