Bug 122010 - [WIN] Make WebHistory compile without USE(CF)
Summary: [WIN] Make WebHistory compile without USE(CF)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on: 119389 121599 121801
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-27 05:27 PDT by Patrick R. Gansterer
Modified: 2013-10-31 11:01 PDT (History)
2 users (show)

See Also:


Attachments
Patch (8.32 KB, patch)
2013-09-27 05:32 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff
Patch (8.09 KB, patch)
2013-09-27 05:35 PDT, Patrick R. Gansterer
bfulgham: review-
Details | Formatted Diff | Diff
Patch (8.09 KB, patch)
2013-10-31 10:24 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick R. Gansterer 2013-09-27 05:27:08 PDT
[WIN] Make WebHistory compile without USE(CF)
Comment 1 Patrick R. Gansterer 2013-09-27 05:32:11 PDT
Created attachment 212799 [details]
Patch
Comment 2 Patrick R. Gansterer 2013-09-27 05:35:08 PDT
Created attachment 212800 [details]
Patch
Comment 3 WebKit Commit Bot 2013-09-27 05:36:40 PDT
Attachment 212800 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/win/COMVariantSetter.h', u'Source/WebKit/win/ChangeLog', u'Source/WebKit/win/WebHistory.cpp', u'Source/WebKit/win/WebHistory.h']" exit_code: 1
Source/WebKit/win/COMVariantSetter.h:125:  This { should be at the end of the previous line  [whitespace/braces] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Darin Adler 2013-09-29 13:38:45 PDT
Comment on attachment 212800 [details]
Patch

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

> Source/WebKit/win/WebHistory.cpp:88
> -static COMPtr<CFDictionaryPropertyBag> createUserInfoFromArray(BSTR notificationStr, CFArrayRef arrayItem)
> +static COMPtr<IPropertyBag> createUserInfoFromArray(BSTR notificationStr, IWebHistoryItem** data, size_t size)
>  {
> +#if USE(CF)
> +    RetainPtr<CFArrayRef> arrayItem = adoptCF(CFArrayCreate(kCFAllocatorDefault, (const void**)data, size, &MarshallingHelpers::kIUnknownArrayCallBacks));
> +
>      RetainPtr<CFMutableDictionaryRef> dictionary = adoptCF(
>          CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
>  
>      RetainPtr<CFStringRef> key = adoptCF(MarshallingHelpers::BSTRToCFStringRef(notificationStr));
> -    CFDictionaryAddValue(dictionary.get(), key.get(), arrayItem);
> +    CFDictionaryAddValue(dictionary.get(), key.get(), arrayItem.get());
>  
>      COMPtr<CFDictionaryPropertyBag> result = CFDictionaryPropertyBag::createInstance();
>      result->setDictionary(dictionary.get());
> -    return result;
> +    return COMPtr<IPropertyBag>(AdoptCOM, result.leakRef());
> +#else
> +    Vector<COMPtr<IWebHistoryItem>, 1> arrayItem;
> +    arrayItem.reserveInitialCapacity(size);
> +    for (size_t i = 0; i < size; ++i)
> +        arrayItem[i] = data[i];
> +
> +    HashMap<String, Vector<COMPtr<IWebHistoryItem>>> dictionary;
> +    String key(notificationStr, ::SysStringLen(notificationStr));
> +    dictionary.set(key, std::move(arrayItem));
> +    return COMPtr<IPropertyBag>(AdoptCOM, COMPropertyBag<Vector<COMPtr<IWebHistoryItem>>>::adopt(dictionary));
> +#endif
>  }

Does not make sense to have both of these. Why keep the CF version?
Comment 5 Patrick R. Gansterer 2013-09-29 14:46:41 PDT
(In reply to comment #4)
> Does not make sense to have both of these. Why keep the CF version?

Maybe someone wants to query the CFDictionaryPropertyBag interface. I don't know what the Safari (or other windows application) code does to access the values.
Comment 6 Brent Fulgham 2013-10-31 10:11:10 PDT
Comment on attachment 212800 [details]
Patch

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

Looks good to me. Please correct the bracket placement and we can land this.

>> Source/WebKit/win/COMVariantSetter.h:125
>> +{
> 
> This { should be at the end of the previous line  [whitespace/braces] [4]

Please correct this bracket position.

>> Source/WebKit/win/WebHistory.cpp:88
>>  }
> 
> Does not make sense to have both of these. Why keep the CF version?

We need the CF versions to maintain compatibility with other software.
Comment 7 Patrick R. Gansterer 2013-10-31 10:24:34 PDT
Created attachment 215658 [details]
Patch
Comment 8 Brent Fulgham 2013-10-31 10:30:39 PDT
Comment on attachment 215658 [details]
Patch

r=me
Comment 9 WebKit Commit Bot 2013-10-31 11:01:06 PDT
Comment on attachment 215658 [details]
Patch

Clearing flags on attachment: 215658

Committed r158370: <http://trac.webkit.org/changeset/158370>
Comment 10 WebKit Commit Bot 2013-10-31 11:01:09 PDT
All reviewed patches have been landed.  Closing bug.