Changeset 128812 in webkit
- Timestamp:
- Sep 17, 2012 3:05:27 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128809 r128812 1 2012-09-17 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r128809. 4 http://trac.webkit.org/changeset/128809 5 https://bugs.webkit.org/show_bug.cgi?id=96958 6 7 Broke the Windows build. (Requested by andersca on #webkit). 8 9 * platform/win/BString.cpp: 10 (WebCore::BString::~BString): 11 (WebCore::BString::adoptBSTR): 12 * platform/win/BString.h: 13 (BString): 14 1 15 2012-09-17 Patrick Gansterer <paroga@webkit.org> 2 16 -
trunk/Source/WebCore/platform/win/BString.cpp
r128809 r128812 107 107 BString::~BString() 108 108 { 109 clear();109 SysFreeString(m_bstr); 110 110 } 111 111 … … 120 120 void BString::adoptBSTR(BSTR bstr) 121 121 { 122 clear(); 122 if (m_bstr) 123 SysFreeString(m_bstr); 123 124 m_bstr = bstr; 124 }125 126 void BString::clear()127 {128 SysFreeString(m_bstr);129 125 } 130 126 -
trunk/Source/WebCore/platform/win/BString.h
r128809 r128812 53 53 54 54 void adoptBSTR(BSTR); 55 void clear();56 55 57 56 BString(const BString&); … … 59 58 BString& operator=(const BSTR&); 60 59 61 BSTR* operator&() { ASSERT(!m_bstr); return &m_bstr; }62 60 operator BSTR() const { return m_bstr; } 63 61 -
trunk/Source/WebKit/win/ChangeLog
r128771 r128812 1 2012-09-17 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r128809. 4 http://trac.webkit.org/changeset/128809 5 https://bugs.webkit.org/show_bug.cgi?id=96958 6 7 Broke the Windows build. (Requested by andersca on #webkit). 8 9 * DefaultPolicyDelegate.cpp: 10 (DefaultPolicyDelegate::decidePolicyForNavigationAction): 11 (DefaultPolicyDelegate::decidePolicyForMIMEType): 12 (DefaultPolicyDelegate::unableToImplementPolicyWithError): 13 * MarshallingHelpers.cpp: 14 (MarshallingHelpers::KURLToBSTR): 15 (MarshallingHelpers::CFStringRefToBSTR): 16 (MarshallingHelpers::stringArrayToSafeArray): 17 (MarshallingHelpers::safeArrayToStringArray): 18 * WebCoreSupport/WebChromeClient.cpp: 19 (WebChromeClient::runJavaScriptPrompt): 20 * WebCoreSupport/WebEditorClient.cpp: 21 (WebEditorClient::checkGrammarOfString): 22 (WebEditorClient::getGuessesForWord): 23 * WebFrame.cpp: 24 (WebFrame::canProvideDocumentSource): 25 * WebHistory.cpp: 26 (WebHistory::removeItem): 27 (WebHistory::addItem): 28 * WebIconDatabase.cpp: 29 (WebIconDatabase::startUpIconDatabase): 30 * WebNotificationCenter.cpp: 31 (WebNotificationCenter::postNotification): 32 * WebPreferences.cpp: 33 (WebPreferences::setStringValue): 34 * WebView.cpp: 35 (PreferencesChangedOrRemovedObserver::onNotify): 36 (WebView::close): 37 (WebView::canShowMIMEType): 38 (WebView::initWithFrame): 39 (WebView::setApplicationNameForUserAgent): 40 (WebView::setCustomUserAgent): 41 (WebView::userAgentForURL): 42 (WebView::setCustomTextEncodingName): 43 (WebView::customTextEncodingName): 44 (WebView::setPreferences): 45 (WebView::searchFor): 46 (WebView::executeCoreCommandByName): 47 (WebView::markAllMatchesForText): 48 (WebView::setGroupName): 49 (WebView::registerURLSchemeAsLocal): 50 (WebView::replaceSelectionWithText): 51 (WebView::onNotify): 52 (WebView::notifyPreferencesChanged): 53 (WebView::MIMETypeForExtension): 54 (WebView::standardUserAgentWithApplicationName): 55 (WebView::addAdditionalPluginDirectory): 56 (WebView::registerEmbeddedViewMIMEType): 57 (toString): 58 (toKURL): 59 (WebView::addOriginAccessWhitelistEntry): 60 (WebView::removeOriginAccessWhitelistEntry): 61 (WebView::geolocationDidFailWithError): 62 (WebView::setDomainRelaxationForbiddenForURLScheme): 63 (WebView::setCompositionForTesting): 64 (WebView::confirmCompositionForTesting): 65 1 66 2012-09-16 Mark Lam <mark.lam@apple.com> 2 67 -
trunk/Source/WebKit/win/DefaultPolicyDelegate.cpp
r128809 r128812 28 28 #include "DefaultPolicyDelegate.h" 29 29 30 #include <WebCore/BString.h>31 30 #include <WebCore/COMPtr.h> 32 31 #include <wtf/text/WTFString.h> … … 118 117 listener->use(); 119 118 else { 120 BS tringurl;119 BSTR url; 121 120 // A file URL shouldn't fall through to here, but if it did, 122 121 // it would be a security risk to open it. … … 126 125 } 127 126 listener->ignore(); 127 SysFreeString(url); 128 128 } 129 129 } … … 153 153 canShowMIMEType = FALSE; 154 154 155 BS tringurl;155 BSTR url; 156 156 request->URL(&url); 157 157 … … 172 172 else 173 173 listener->ignore(); 174 SysFreeString(url); 174 175 return S_OK; 175 176 } … … 180 181 /*[in]*/ IWebFrame* frame) 181 182 { 182 BS tringerrorStr;183 BSTR errorStr; 183 184 error->localizedDescription(&errorStr); 184 185 185 BS tringframeName;186 BSTR frameName; 186 187 frame->name(&frameName); 187 188 188 189 LOG_ERROR("called unableToImplementPolicyWithError:%S inFrame:%S", errorStr ? errorStr : TEXT(""), frameName ? frameName : TEXT("")); 190 SysFreeString(errorStr); 191 SysFreeString(frameName); 189 192 190 193 return S_OK; -
trunk/Source/WebKit/win/MarshallingHelpers.cpp
r128809 r128812 28 28 #include "MarshallingHelpers.h" 29 29 30 #include <WebCore/BString.h>31 30 #include <WebCore/IntRect.h> 32 31 #include <WebCore/KURL.h> … … 48 47 BSTR MarshallingHelpers::KURLToBSTR(const KURL& url) 49 48 { 50 return BString(url.string()).release();49 return SysAllocStringLen(url.string().characters(), url.string().length()); 51 50 } 52 51 … … 91 90 BSTR MarshallingHelpers::CFStringRefToBSTR(CFStringRef str) 92 91 { 93 return BString(str).release(); 92 if (!str) 93 return 0; 94 95 const UniChar* uniChars = CFStringGetCharactersPtr(str); 96 if (uniChars) 97 return SysAllocStringLen((LPCTSTR)uniChars, CFStringGetLength(str)); 98 99 CFIndex length = CFStringGetLength(str); 100 BSTR bstr = SysAllocStringLen(0, length); 101 if (bstr) { 102 CFStringGetCharacters(str, CFRangeMake(0, length), (UniChar*)bstr); 103 bstr[length] = 0; 104 } 105 return bstr; 94 106 } 95 107 … … 148 160 for (CFIndex i=0; i<size; i++) { 149 161 CFStringRef item = (CFStringRef) CFArrayGetValueAtIndex(inArray, i); 150 BString bstr(item); 151 ::SafeArrayPutElement(sa, &count, bstr); // SafeArrayPutElement() copies the string correctly. 162 BSTR bstr = CFStringRefToBSTR(item); 163 ::SafeArrayPutElement(sa, &count, bstr); 164 SysFreeString(bstr); // SafeArrayPutElement() should make a copy of the string 152 165 count++; 153 166 } … … 220 233 items = new CFStringRef[len]; 221 234 for (; lBound <= uBound; lBound++) { 222 BS tringstr;235 BSTR str; 223 236 hr = ::SafeArrayGetElement(inArray, &lBound, &str); 224 237 items[lBound] = BSTRToCFStringRef(str); 238 SysFreeString(str); 225 239 } 226 240 } -
trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
r128809 r128812 411 411 TimerBase::fireTimersInNestedEventLoop(); 412 412 413 BS tring resultBSTR;413 BSTR resultBSTR = 0; 414 414 if (FAILED(ui->runJavaScriptTextInputPanelWithPrompt(m_webView, BString(message), BString(defaultValue), &resultBSTR))) 415 415 return false; 416 416 417 if (!resultBSTR) 418 return false; 419 420 result = String(resultBSTR, SysStringLen(resultBSTR)); 421 return true; 417 if (resultBSTR) { 418 result = String(resultBSTR, SysStringLen(resultBSTR)); 419 SysFreeString(resultBSTR); 420 return true; 421 } 422 423 return false; 422 424 } 423 425 -
trunk/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp
r128809 r128812 696 696 if (FAILED(detailObj->location(&detail.location))) 697 697 continue; 698 BS tringuserDesc;698 BSTR userDesc; 699 699 if (FAILED(detailObj->userDescription(&userDesc))) 700 700 continue; 701 701 detail.userDescription = String(userDesc, SysStringLen(userDesc)); 702 SysFreeString(userDesc); 702 703 703 704 COMPtr<IEnumSpellingGuesses> enumGuessesObj; … … 705 706 continue; 706 707 while (true) { 707 BS tringguess;708 BSTR guess; 708 709 if (enumGuessesObj->Next(1, &guess, &fetched) != S_OK) 709 710 break; 710 711 detail.guesses.append(String(guess, SysStringLen(guess))); 712 SysFreeString(guess); 711 713 } 712 714 … … 777 779 while (true) { 778 780 ULONG fetched; 779 BS tringguess;781 BSTR guess; 780 782 if (enumGuessesObj->Next(1, &guess, &fetched) != S_OK) 781 783 break; 782 784 guesses.append(String(guess, SysStringLen(guess))); 785 SysFreeString(guess); 783 786 } 784 787 } -
trunk/Source/WebKit/win/WebFrame.cpp
r128809 r128812 1443 1443 hr = dataSource->response(&urlResponse); 1444 1444 if (SUCCEEDED(hr) && urlResponse) { 1445 BS tringmimeTypeBStr;1445 BSTR mimeTypeBStr; 1446 1446 if (SUCCEEDED(urlResponse->MIMEType(&mimeTypeBStr))) { 1447 1447 String mimeType(mimeTypeBStr, SysStringLen(mimeTypeBStr)); 1448 1448 *result = mimeType == "text/html" || WebCore::DOMImplementation::isXMLMIMEType(mimeType); 1449 SysFreeString(mimeTypeBStr); 1449 1450 } 1450 1451 } -
trunk/Source/WebKit/win/WebHistory.cpp
r128809 r128812 37 37 #include "WebPreferences.h" 38 38 #include <CoreFoundation/CoreFoundation.h> 39 #include <WebCore/BString.h>40 39 #include <WebCore/HistoryItem.h> 41 40 #include <WebCore/HistoryPropertyList.h> … … 614 613 { 615 614 HRESULT hr = S_OK; 616 BS tring urlBStr;615 BSTR urlBStr = 0; 617 616 618 617 hr = entry->URLString(&urlBStr); … … 621 620 622 621 RetainPtr<CFStringRef> urlString(AdoptCF, MarshallingHelpers::BSTRToCFStringRef(urlBStr)); 622 SysFreeString(urlBStr); 623 623 624 624 // If this exact object isn't stored, then make no change. … … 647 647 return E_FAIL; 648 648 649 BS tring urlBStr;649 BSTR urlBStr = 0; 650 650 hr = entry->URLString(&urlBStr); 651 651 if (FAILED(hr)) … … 653 653 654 654 RetainPtr<CFStringRef> urlString(AdoptCF, MarshallingHelpers::BSTRToCFStringRef(urlBStr)); 655 SysFreeString(urlBStr); 655 656 656 657 COMPtr<IWebHistoryItem> oldEntry((IWebHistoryItem*) CFDictionaryGetValue( -
trunk/Source/WebKit/win/WebIconDatabase.cpp
r128809 r128812 85 85 iconDatabase().setClient(this); 86 86 87 BS tring prefDatabasePath;87 BSTR prefDatabasePath = 0; 88 88 if (FAILED(standardPrefs->iconDatabaseLocation(&prefDatabasePath))) 89 89 LOG_ERROR("Unable to get icon database location preference"); 90 90 91 91 String databasePath(prefDatabasePath, SysStringLen(prefDatabasePath)); 92 SysFreeString(prefDatabasePath); 92 93 93 94 if (databasePath.isEmpty()) { -
trunk/Source/WebKit/win/WebNotificationCenter.cpp
r128809 r128812 29 29 30 30 #include "WebNotification.h" 31 #include <WebCore/BString.h>32 31 #include <WebCore/COMPtr.h> 33 32 #include <utility> … … 162 161 /* [in] */ IWebNotification* notification) 163 162 { 164 BS tringname;163 BSTR name; 165 164 HRESULT hr = notification->name(&name); 166 165 if (FAILED(hr)) … … 173 172 174 173 postNotificationInternal(notification, name, obj.get()); 174 SysFreeString(name); 175 175 176 176 return hr; -
trunk/Source/WebKit/win/WebPreferences.cpp
r128809 r128812 350 350 void WebPreferences::setStringValue(CFStringRef key, LPCTSTR value) 351 351 { 352 BString val; 353 val.adoptBSTR(stringValueForKey(key)); 352 BSTR val = stringValueForKey(key); 354 353 if (val && !wcscmp(val, value)) 355 354 return; 355 SysFreeString(val); 356 356 357 357 RetainPtr<CFStringRef> valueRef(AdoptCF, -
trunk/Source/WebKit/win/WebView.cpp
r128809 r128812 200 200 } 201 201 202 static inline AtomicString toAtomicString(BSTR bstr)203 {204 return AtomicString(bstr, SysStringLen(bstr));205 }206 207 static inline String toString(BSTR bstr)208 {209 return String(bstr, SysStringLen(bstr));210 }211 212 static inline KURL toKURL(BSTR bstr)213 {214 return KURL(KURL(), toString(bstr));215 }216 217 202 class PreferencesChangedOrRemovedObserver : public IWebNotificationObserver { 218 203 public: … … 261 246 return hr; 262 247 248 BSTR nameBSTR; 249 hr = notification->name(&nameBSTR); 250 if (FAILED(hr)) 251 return hr; 263 252 BString name; 264 hr = notification->name(&name); 265 if (FAILED(hr)) 266 return hr; 253 name.adoptBSTR(nameBSTR); 267 254 268 255 if (wcscmp(name, WebPreferences::webPreferencesChangedNotification()) == 0) … … 740 727 741 728 if (COMPtr<WebPreferences> preferences = m_preferences) { 742 BS tring identifier;729 BSTR identifier = 0; 743 730 preferences->identifier(&identifier); 744 731 … … 747 734 // Make sure we release the reference, since WebPreferences::removeReferenceForIdentifier will check for last reference to WebPreferences 748 735 preferences = 0; 749 if (identifier) 736 if (identifier) { 750 737 WebPreferences::removeReferenceForIdentifier(identifier); 738 SysFreeString(identifier); 739 } 751 740 } 752 741 … … 2525 2514 /* [retval][out] */ BOOL* canShow) 2526 2515 { 2527 String mimeTypeStr = toString(mimeType);2516 String mimeTypeStr(mimeType, SysStringLen(mimeType)); 2528 2517 2529 2518 if (!canShow) … … 2692 2681 provideGeolocationTo(m_page, new WebGeolocationClient(this)); 2693 2682 2694 BString localStoragePath; 2695 if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) 2696 m_page->settings()->setLocalStorageDatabasePath(toString(localStoragePath)); 2683 BSTR localStoragePath; 2684 if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) { 2685 m_page->settings()->setLocalStorageDatabasePath(String(localStoragePath, SysStringLen(localStoragePath))); 2686 SysFreeString(localStoragePath); 2687 } 2697 2688 2698 2689 if (m_uiDelegate) { 2699 BString path; 2700 if (SUCCEEDED(m_uiDelegate->ftpDirectoryTemplatePath(this, &path))) 2701 m_page->settings()->setFTPDirectoryTemplatePath(toString(path)); 2690 BSTR path; 2691 if (SUCCEEDED(m_uiDelegate->ftpDirectoryTemplatePath(this, &path))) { 2692 m_page->settings()->setFTPDirectoryTemplatePath(String(path, SysStringLen(path))); 2693 SysFreeString(path); 2694 } 2702 2695 } 2703 2696 … … 2707 2700 webFrame->Release(); // The WebFrame is owned by the Frame, so release our reference to it. 2708 2701 2709 coreFrame->tree()->setName( toString(frameName));2702 coreFrame->tree()->setName(String(frameName, SysStringLen(frameName))); 2710 2703 coreFrame->init(); 2711 2704 setGroupName(groupName); … … 3065 3058 /* [in] */ BSTR applicationName) 3066 3059 { 3067 m_applicationName = toString(applicationName);3060 m_applicationName = String(applicationName, SysStringLen(applicationName)); 3068 3061 m_userAgentStandard = String(); 3069 3062 return S_OK; … … 3083 3076 { 3084 3077 m_userAgentOverridden = userAgentString; 3085 m_userAgentCustom = toString(userAgentString);3078 m_userAgentCustom = String(userAgentString, SysStringLen(userAgentString)); 3086 3079 return S_OK; 3087 3080 } … … 3104 3097 { 3105 3098 String userAgentString = userAgentForKURL(MarshallingHelpers::BSTRToKURL(url)); 3106 *userAgent = BString(userAgentString).release();3099 *userAgent = SysAllocStringLen(userAgentString.characters(), userAgentString.length()); 3107 3100 if (!*userAgent && userAgentString.length()) 3108 3101 return E_OUTOFMEMORY; … … 3124 3117 3125 3118 HRESULT hr; 3126 BS tringoldEncoding;3119 BSTR oldEncoding; 3127 3120 hr = customTextEncodingName(&oldEncoding); 3128 3121 if (FAILED(hr)) … … 3131 3124 if (oldEncoding != encodingName && (!oldEncoding || !encodingName || wcscmp(oldEncoding, encodingName))) { 3132 3125 if (Frame* coreFrame = core(m_mainFrame)) 3133 coreFrame->loader()->reloadWithOverrideEncoding( toString(encodingName));3126 coreFrame->loader()->reloadWithOverrideEncoding(String(encodingName, SysStringLen(encodingName))); 3134 3127 } 3135 3128 … … 3163 3156 3164 3157 if (!*encodingName) 3165 *encodingName = BString(m_overrideEncoding).release();3158 *encodingName = SysAllocStringLen(m_overrideEncoding.characters(), m_overrideEncoding.length()); 3166 3159 3167 3160 if (!*encodingName && m_overrideEncoding.length()) … … 3238 3231 nc->removeObserver(this, WebPreferences::webPreferencesChangedNotification(), static_cast<IWebPreferences*>(m_preferences.get())); 3239 3232 3240 BS tring identifier;3233 BSTR identifier = 0; 3241 3234 oldPrefs->identifier(&identifier); 3242 3235 oldPrefs->didRemoveFromWebView(); … … 3245 3238 m_preferences = webPrefs; 3246 3239 3247 if (identifier) 3240 if (identifier) { 3248 3241 WebPreferences::removeReferenceForIdentifier(identifier); 3242 SysFreeString(identifier); 3243 } 3249 3244 3250 3245 nc->addObserver(this, WebPreferences::webPreferencesChangedNotification(), static_cast<IWebPreferences*>(m_preferences.get())); … … 3394 3389 return E_INVALIDARG; 3395 3390 3396 *found = m_page->findString( toString(str), caseFlag ? TextCaseSensitive : TextCaseInsensitive, forward ? FindDirectionForward : FindDirectionBackward, wrapFlag);3391 *found = m_page->findString(String(str, SysStringLen(str)), caseFlag ? TextCaseSensitive : TextCaseInsensitive, forward ? FindDirectionForward : FindDirectionBackward, wrapFlag); 3397 3392 return S_OK; 3398 3393 } … … 3424 3419 } 3425 3420 3426 HRESULT STDMETHODCALLTYPE WebView::executeCoreCommandByName(BSTR name, BSTR value) 3427 { 3428 m_page->focusController()->focusedOrMainFrame()->editor()->command(toString(name)).execute(toString(value)); 3421 HRESULT STDMETHODCALLTYPE WebView::executeCoreCommandByName(BSTR bName, BSTR bValue) 3422 { 3423 String name(bName, SysStringLen(bName)); 3424 String value(bValue, SysStringLen(bValue)); 3425 3426 m_page->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value); 3429 3427 3430 3428 return S_OK; … … 3450 3448 return E_INVALIDARG; 3451 3449 3452 *matches = m_page->markAllMatchesForText( toString(str), caseSensitive ? TextCaseSensitive : TextCaseInsensitive, highlight, limit);3450 *matches = m_page->markAllMatchesForText(String(str, SysStringLen(str)), caseSensitive ? TextCaseSensitive : TextCaseInsensitive, highlight, limit); 3453 3451 return S_OK; 3454 3452 } … … 3533 3531 if (!m_page) 3534 3532 return S_OK; 3535 m_page->setGroupName( toString(groupName));3533 m_page->setGroupName(String(groupName, SysStringLen(groupName))); 3536 3534 return S_OK; 3537 3535 } … … 3767 3765 return E_POINTER; 3768 3766 3769 SchemeRegistry::registerURLSchemeAsLocal( toString(scheme));3767 SchemeRegistry::registerURLSchemeAsLocal(String(scheme, ::SysStringLen(scheme))); 3770 3768 3771 3769 return S_OK; … … 4318 4316 /* [in] */ BSTR text) 4319 4317 { 4318 String textString(text, ::SysStringLen(text)); 4320 4319 Position start = m_page->mainFrame()->selection()->selection().start(); 4321 m_page->focusController()->focusedOrMainFrame()->editor()->insertText(t oString(text), 0);4320 m_page->focusController()->focusedOrMainFrame()->editor()->insertText(textString, 0); 4322 4321 m_page->mainFrame()->selection()->setBase(start); 4323 4322 return S_OK; … … 4538 4537 /* [in] */ IWebNotification* notification) 4539 4538 { 4539 BSTR nameBSTR; 4540 HRESULT hr = notification->name(&nameBSTR); 4541 if (FAILED(hr)) 4542 return hr; 4543 4540 4544 BString name; 4541 HRESULT hr = notification->name(&name); 4542 if (FAILED(hr)) 4543 return hr; 4545 name.adoptBSTR(nameBSTR); 4544 4546 4545 4547 if (!wcscmp(name, WebIconDatabase::iconDatabaseDidAddIconNotification())) … … 4567 4569 ASSERT(preferences == m_preferences); 4568 4570 4569 BS tringstr;4571 BSTR str; 4570 4572 int size; 4571 4573 BOOL enabled; … … 4576 4578 if (FAILED(hr)) 4577 4579 return hr; 4578 settings->setCursiveFontFamily( toAtomicString(str));4579 str.clear();4580 settings->setCursiveFontFamily(AtomicString(str, SysStringLen(str))); 4581 SysFreeString(str); 4580 4582 4581 4583 hr = preferences->defaultFixedFontSize(&size); … … 4588 4590 return hr; 4589 4591 settings->setDefaultFontSize(size); 4590 4592 4591 4593 hr = preferences->defaultTextEncodingName(&str); 4592 4594 if (FAILED(hr)) 4593 4595 return hr; 4594 settings->setDefaultTextEncodingName( toString(str));4595 str.clear();4596 settings->setDefaultTextEncodingName(String(str, SysStringLen(str))); 4597 SysFreeString(str); 4596 4598 4597 4599 hr = preferences->fantasyFontFamily(&str); 4598 4600 if (FAILED(hr)) 4599 4601 return hr; 4600 settings->setFantasyFontFamily( toAtomicString(str));4601 str.clear();4602 settings->setFantasyFontFamily(AtomicString(str, SysStringLen(str))); 4603 SysFreeString(str); 4602 4604 4603 4605 hr = preferences->fixedFontFamily(&str); 4604 4606 if (FAILED(hr)) 4605 4607 return hr; 4606 settings->setFixedFontFamily( toAtomicString(str));4607 str.clear();4608 settings->setFixedFontFamily(AtomicString(str, SysStringLen(str))); 4609 SysFreeString(str); 4608 4610 4609 4611 #if ENABLE(VIDEO_TRACK) … … 4629 4631 if (FAILED(hr)) 4630 4632 return hr; 4631 settings->setLocalStorageDatabasePath( toString(str));4632 str.clear();4633 settings->setLocalStorageDatabasePath(String(str, SysStringLen(str))); 4634 SysFreeString(str); 4633 4635 } 4634 4636 … … 4636 4638 if (FAILED(hr)) 4637 4639 return hr; 4638 settings->setPictographFontFamily( toAtomicString(str));4639 str.clear();4640 settings->setPictographFontFamily(AtomicString(str, SysStringLen(str))); 4641 SysFreeString(str); 4640 4642 4641 4643 hr = preferences->isJavaEnabled(&enabled); … … 4682 4684 if (FAILED(hr)) 4683 4685 return hr; 4684 settings->setSansSerifFontFamily( toAtomicString(str));4685 str.clear();4686 settings->setSansSerifFontFamily(AtomicString(str, SysStringLen(str))); 4687 SysFreeString(str); 4686 4688 4687 4689 hr = preferences->serifFontFamily(&str); 4688 4690 if (FAILED(hr)) 4689 4691 return hr; 4690 settings->setSerifFontFamily( toAtomicString(str));4691 str.clear();4692 settings->setSerifFontFamily(AtomicString(str, SysStringLen(str))); 4693 SysFreeString(str); 4692 4694 4693 4695 hr = preferences->standardFontFamily(&str); 4694 4696 if (FAILED(hr)) 4695 4697 return hr; 4696 settings->setStandardFontFamily( toAtomicString(str));4697 str.clear();4698 settings->setStandardFontFamily(AtomicString(str, SysStringLen(str))); 4699 SysFreeString(str); 4698 4700 4699 4701 hr = preferences->loadsImagesAutomatically(&enabled); … … 4710 4712 return hr; 4711 4713 4712 RetainPtr<CFStringRef> urlString(AdoptCF, toString(str).createCFString());4714 RetainPtr<CFStringRef> urlString(AdoptCF, String(str, SysStringLen(str)).createCFString()); 4713 4715 RetainPtr<CFURLRef> url(AdoptCF, CFURLCreateWithString(kCFAllocatorDefault, urlString.get(), 0)); 4714 4716 … … 4728 4730 4729 4731 settings->setUserStyleSheetLocation(url.get()); 4730 str.clear();4731 } else 4732 SysFreeString(str); 4733 } else { 4732 4734 settings->setUserStyleSheetLocation(KURL()); 4735 } 4733 4736 4734 4737 hr = preferences->shouldPrintBackgrounds(&enabled); … … 4976 4979 return E_POINTER; 4977 4980 4978 *mimeType = BString(MIMETypeRegistry::getMIMETypeForExtension(toString(extension))).release(); 4981 String extensionStr(extension, SysStringLen(extension)); 4982 4983 *mimeType = BString(MIMETypeRegistry::getMIMETypeForExtension(extensionStr)).release(); 4979 4984 4980 4985 return S_OK; … … 5224 5229 } 5225 5230 5226 *groupName = BString(standardUserAgentWithApplicationName(toString(applicationName))).release(); 5231 BString applicationNameBString(applicationName); 5232 *groupName = BString(standardUserAgentWithApplicationName(String(applicationNameBString, SysStringLen(applicationNameBString)))).release(); 5227 5233 return S_OK; 5228 5234 } … … 5279 5285 /* [in] */ BSTR directory) 5280 5286 { 5281 PluginDatabase::installedPlugins()->addExtraPluginDirectory( toString(directory));5287 PluginDatabase::installedPlugins()->addExtraPluginDirectory(String(directory, SysStringLen(directory))); 5282 5288 return S_OK; 5283 5289 } … … 6113 6119 m_embeddedViewMIMETypes = adoptPtr(new HashSet<String>); 6114 6120 6115 m_embeddedViewMIMETypes->add( toString(mimeType));6121 m_embeddedViewMIMETypes->add(String(mimeType, ::SysStringLen(mimeType))); 6116 6122 return S_OK; 6117 6123 } … … 6183 6189 m_page->setCanStartMedia(canStartPlugins); 6184 6190 return S_OK; 6191 } 6192 6193 static String toString(BSTR bstr) 6194 { 6195 return String(bstr, SysStringLen(bstr)); 6196 } 6197 6198 static KURL toKURL(BSTR bstr) 6199 { 6200 return KURL(KURL(), toString(bstr)); 6185 6201 } 6186 6202 … … 6400 6416 HRESULT WebView::addOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains) 6401 6417 { 6402 SecurityPolicy::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString( toString(sourceOrigin)), toString(destinationProtocol), toString(destinationHost), allowDestinationSubdomains);6418 SecurityPolicy::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(String(sourceOrigin, SysStringLen(sourceOrigin))), String(destinationProtocol, SysStringLen(destinationProtocol)), String(destinationHost, SysStringLen(destinationHost)), allowDestinationSubdomains); 6403 6419 return S_OK; 6404 6420 } … … 6406 6422 HRESULT WebView::removeOriginAccessWhitelistEntry(BSTR sourceOrigin, BSTR destinationProtocol, BSTR destinationHost, BOOL allowDestinationSubdomains) 6407 6423 { 6408 SecurityPolicy::removeOriginAccessWhitelistEntry(*SecurityOrigin::createFromString( toString(sourceOrigin)), toString(destinationProtocol), toString(destinationHost), allowDestinationSubdomains);6424 SecurityPolicy::removeOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(String(sourceOrigin, SysStringLen(sourceOrigin))), String(destinationProtocol, SysStringLen(destinationProtocol)), String(destinationHost, SysStringLen(destinationHost)), allowDestinationSubdomains); 6409 6425 return S_OK; 6410 6426 } … … 6583 6599 return E_POINTER; 6584 6600 6585 BString description; 6586 if (FAILED(error->localizedDescription(&description))) 6587 return E_FAIL; 6588 6589 RefPtr<GeolocationError> geolocationError = GeolocationError::create(GeolocationError::PositionUnavailable, toString(description)); 6601 BSTR descriptionBSTR; 6602 if (FAILED(error->localizedDescription(&descriptionBSTR))) 6603 return E_FAIL; 6604 String descriptionString(descriptionBSTR, SysStringLen(descriptionBSTR)); 6605 SysFreeString(descriptionBSTR); 6606 6607 RefPtr<GeolocationError> geolocationError = GeolocationError::create(GeolocationError::PositionUnavailable, descriptionString); 6590 6608 GeolocationController::from(m_page)->errorOccurred(geolocationError.get()); 6591 6609 return S_OK; … … 6594 6612 HRESULT WebView::setDomainRelaxationForbiddenForURLScheme(BOOL forbidden, BSTR scheme) 6595 6613 { 6596 SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, toString(scheme));6614 SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, String(scheme, SysStringLen(scheme))); 6597 6615 return S_OK; 6598 6616 } … … 6889 6907 return E_FAIL; 6890 6908 6891 String compositionStr = toString(composition);6909 String compositionStr(composition, SysStringLen(composition)); 6892 6910 6893 6911 Vector<CompositionUnderline> underlines; … … 6921 6939 return E_FAIL; 6922 6940 6923 String compositionStr = toString(composition);6941 String compositionStr(composition, SysStringLen(composition)); 6924 6942 6925 6943 if (compositionStr.isNull())
Note: See TracChangeset
for help on using the changeset viewer.