Bug 208698 - Some PDFPlugin cleanup in prep for incremental loading
Summary: Some PDFPlugin cleanup in prep for incremental loading
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-05 22:35 PST by Brady Eidson
Modified: 2020-03-06 17:46 PST (History)
3 users (show)

See Also:


Attachments
Patch (17.78 KB, patch)
2020-03-05 22:38 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (18.87 KB, patch)
2020-03-06 07:36 PST, Brady Eidson
achristensen: review+
Details | Formatted Diff | Diff
PFL (18.86 KB, patch)
2020-03-06 15:21 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>