Bug 139453 - REGRESSION (r173272): When open PDF from Safari in iBooks, title is replaced to “QuickLookPDF-s72DbgAU-1”
Summary: REGRESSION (r173272): When open PDF from Safari in iBooks, title is replaced ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-12-09 11:19 PST by Antti Koivisto
Modified: 2014-12-09 16:35 PST (History)
3 users (show)

See Also:


Attachments
patch (1.67 KB, patch)
2014-12-09 11:29 PST, Antti Koivisto
psolanki: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2014-12-09 11:19:06 PST
Bug in CFNetwork code path
Comment 1 Antti Koivisto 2014-12-09 11:29:43 PST
Created attachment 242947 [details]
patch
Comment 2 Antti Koivisto 2014-12-09 11:30:32 PST
rdar://problem/19052192
Comment 3 Pratik Solanki 2014-12-09 11:57:56 PST
Comment on attachment 242947 [details]
patch

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

> Source/WebCore/ChangeLog:4
> +        https://bugs.webkit.org/show_bug.cgi?id=139453

Can you add the radar link here as well.
Comment 4 Antti Koivisto 2014-12-09 12:07:11 PST
https://trac.webkit.org/r177031
Comment 5 Darin Adler 2014-12-09 14:08:54 PST
Comment on attachment 242947 [details]
patch

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

> Source/WebCore/platform/network/cf/ResourceResponseCFNet.cpp:133
> -    RetainPtr<CFStringRef> suggestedFilename = adoptCF(CFURLResponseCopySuggestedFilename(m_cfResponse.get()));
> +    RetainPtr<CFStringRef> suggestedFilename = adoptCF(CFURLResponseCopySuggestedFilename(cfURLResponse()));
>      return suggestedFilename.get();

I think that code like this reads better without a local RetainPtr variable:

    return adoptCF(CFURLResponseCopySuggestedFilename(cfURLResponse())).get();

In fact, I would write this:

    CFURLResponseRef underlyingResponse = cfURLResponse();
    if (!underlyingResponse)
        return String();
    return adoptCF(CFURLResponseCopySuggestedFilename(underlyingResponse)).get();
Comment 6 Antti Koivisto 2014-12-09 16:35:15 PST
>     CFURLResponseRef underlyingResponse = cfURLResponse();
>     if (!underlyingResponse)
>         return String();
>     return adoptCF(CFURLResponseCopySuggestedFilename(underlyingResponse)).get();

I wouldn't call it 'underlying' though as it doesn't describe the role of a synthesized CFURLResponse very well.