Restore the beloved COMPtr::operator&
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Apr 2008 22:23:18 +0000 (22:23 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Apr 2008 22:23:18 +0000 (22:23 +0000)
WebCore:

        Restore the beloved COMPtr::operator&

        * platform/win/COMPtr.h: Removed the HashTableDeletedValueType
        constructor and isHashTableDeletedValue and hashTableDeletedValue
        functions.
        (WTF::): Changed constructDeletedValue to play nicely with
        COMPtr::operator&.

WebKit/win:

        Restore the beloved COMPtr::operator&

WebKitTools:

        Restore the beloved COMPtr::operator&

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32704 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
WebCore/ChangeLog
WebCore/page/win/EventHandlerWin.cpp
WebCore/platform/win/COMPtr.h
WebCore/platform/win/ClipboardWin.cpp
WebCore/platform/win/EditorWin.cpp
WebKit/win/ChangeLog
WebKit/win/WebBackForwardList.cpp
WebKit/win/WebCoreSupport/WebChromeClient.cpp
WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
WebKit/win/WebCoreSupport/WebDragClient.cpp
WebKit/win/WebCoreSupport/WebEditorClient.cpp
WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
WebKit/win/WebCoreSupport/WebInspectorClient.cpp
WebKit/win/WebDownload.cpp
WebKit/win/WebFrame.cpp
WebKit/win/WebHTMLRepresentation.cpp
WebKit/win/WebKitDLL.cpp
WebKit/win/WebNotificationCenter.cpp
WebKit/win/WebURLAuthenticationChallenge.cpp
WebKit/win/WebView.cpp
WebKitTools/ChangeLog
WebKitTools/Drosera/win/DebuggerClient.cpp
WebKitTools/Drosera/win/DebuggerDocumentPlatform.cpp
WebKitTools/Drosera/win/Drosera.cpp
WebKitTools/Drosera/win/ServerConnection.cpp
WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
WebKitTools/DumpRenderTree/win/EventSender.cpp
WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp

index 87c0739..f514bdc 100644 (file)
@@ -1,5 +1,15 @@
 2008-04-29  Adam Roben  <aroben@apple.com>
 
+        Restore the beloved COMPtr::operator&
+
+        * platform/win/COMPtr.h: Removed the HashTableDeletedValueType
+        constructor and isHashTableDeletedValue and hashTableDeletedValue
+        functions.
+        (WTF::): Changed constructDeletedValue to play nicely with
+        COMPtr::operator&.
+
+2008-04-29  Adam Roben  <aroben@apple.com>
+
         Fix assertion on launch on Windows
 
         * platform/graphics/win/FontPlatformData.h: Pass
index 1055d81..7a49ccf 100644 (file)
@@ -95,7 +95,7 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const
 Clipboard* EventHandler::createDraggingClipboard() const
 {
     COMPtr<WCDataObject> dataObject;
-    WCDataObject::createInstance(dataObject.adoptionPointer());
+    WCDataObject::createInstance(&dataObject);
     return new ClipboardWin(true, dataObject.get(), ClipboardWritable);
 }
 
index 4674b63..83f31f0 100644 (file)
@@ -66,7 +66,7 @@ public:
     T& operator*() const { return *m_ptr; }
     T* operator->() const { return m_ptr; }
 
-    T** adoptionPointer() { ASSERT(!m_ptr); return &m_ptr; }
+    T** operator&() { ASSERT(!m_ptr); return &m_ptr; }
 
     bool operator!() const { return !m_ptr; }
     
@@ -198,8 +198,8 @@ namespace WTF {
 
     template<typename P> struct HashTraits<COMPtr<P> > : GenericHashTraits<COMPtr<P> > {
         static const bool emptyValueIsZero = true;
-        static void constructDeletedValue(COMPtr<P>* slot) { new (slot) COMPtr<P>(WTF::HashTableDeletedValue); }
-        static bool isDeletedValue(const COMPtr<P>& value) { return value.isHashTableDeletedValue(); }
+        static void constructDeletedValue(P** slot) { *slot = reinterpret_cast<P*>(-1); }
+        static bool isDeletedValue(const COMPtr<P>& value) { value == reinterpret_cast<P*>(-1); }
     };
 
     template<typename P> struct PtrHash<COMPtr<P> > : PtrHash<P*> {
index 3cd11d4..129d881 100644 (file)
@@ -485,7 +485,7 @@ void ClipboardWin::clearAllData()
         return;
     
     m_writableDataObject = 0;
-    WCDataObject::createInstance(m_writableDataObject.adoptionPointer());
+    WCDataObject::createInstance(&m_writableDataObject);
     m_dataObject = m_writableDataObject;
 }
 
@@ -560,7 +560,7 @@ HashSet<String> ClipboardWin::types() const
 
     COMPtr<IEnumFORMATETC> itr;
 
-    if (FAILED(m_dataObject->EnumFormatEtc(0, itr.adoptionPointer())))
+    if (FAILED(m_dataObject->EnumFormatEtc(0, &itr)))
         return results;
 
     if (!itr)
@@ -748,7 +748,7 @@ bool ClipboardWin::hasData()
         return false;
 
     COMPtr<IEnumFORMATETC> itr;
-    if (FAILED(m_dataObject->EnumFormatEtc(0, itr.adoptionPointer())))
+    if (FAILED(m_dataObject->EnumFormatEtc(0, &itr)))
         return false;
 
     if (!itr)
index 8258a5a..5738a64 100644 (file)
@@ -42,7 +42,7 @@ namespace WebCore {
 PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
 {
     COMPtr<IDataObject> clipboardData;
-    if (!SUCCEEDED(OleGetClipboard(clipboardData.adoptionPointer())))
+    if (!SUCCEEDED(OleGetClipboard(&clipboardData)))
         clipboardData = 0;
 
     return new ClipboardWin(false, clipboardData.get(), policy);
index 0f88fad..b48fbcd 100644 (file)
@@ -1,5 +1,9 @@
 2008-04-29  Adam Roben  <aroben@apple.com>
 
+        Restore the beloved COMPtr::operator&
+
+2008-04-29  Adam Roben  <aroben@apple.com>
+
         Windows build fix
 
         Replaced uses of COMPtr::operator& with COMPtr::adoptionPointer.
index fd7b791..3c08b9a 100644 (file)
@@ -118,7 +118,7 @@ HRESULT STDMETHODCALLTYPE WebBackForwardList::addItem(
 {
     COMPtr<WebHistoryItem> webHistoryItem;
  
-    if (!item || FAILED(item->QueryInterface(webHistoryItem.adoptionPointer())))
+    if (!item || FAILED(item->QueryInterface(&webHistoryItem)))
         return E_FAIL;
  
     m_backForwardList->addItem(webHistoryItem->historyItem());
@@ -142,7 +142,7 @@ HRESULT STDMETHODCALLTYPE WebBackForwardList::goToItem(
 {
     COMPtr<WebHistoryItem> webHistoryItem;
  
-    if (!item || FAILED(item->QueryInterface(webHistoryItem.adoptionPointer())))
+    if (!item || FAILED(item->QueryInterface(&webHistoryItem)))
         return E_FAIL;
 
     m_backForwardList->goToItem(webHistoryItem->historyItem());
@@ -265,7 +265,7 @@ HRESULT STDMETHODCALLTYPE WebBackForwardList::containsItem(
 {
     COMPtr<WebHistoryItem> webHistoryItem;
 
-    if (!item || FAILED(item->QueryInterface(webHistoryItem.adoptionPointer())))
+    if (!item || FAILED(item->QueryInterface(&webHistoryItem)))
         return E_FAIL;
 
     *result = m_backForwardList->containsItem(webHistoryItem->historyItem());
@@ -295,7 +295,7 @@ HRESULT STDMETHODCALLTYPE WebBackForwardList::removeItem(
 {
     COMPtr<WebHistoryItem> webHistoryItem;
  
-    if (!item || FAILED(item->QueryInterface(webHistoryItem.adoptionPointer())))
+    if (!item || FAILED(item->QueryInterface(&webHistoryItem)))
         return E_FAIL;
  
     m_backForwardList->removeItem(webHistoryItem->historyItem());
index cf4cd3c..a053623 100644 (file)
@@ -144,7 +144,7 @@ Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& frameLoadReq
             return 0;
         COMPtr<IWebMutableURLRequest> request(AdoptCOM, WebMutableURLRequest::createInstance(frameLoadRequest.resourceRequest()));
         COMPtr<IWebView> dialog;
-        if (FAILED(delegate->createModalDialog(m_webView, request.get(), dialog.adoptionPointer())))
+        if (FAILED(delegate->createModalDialog(m_webView, request.get(), &dialog)))
             return 0;
         return core(dialog.get());
     }
@@ -282,7 +282,7 @@ void WebChromeClient::setResizable(bool resizable)
 void WebChromeClient::addMessageToConsole(const String& message, unsigned line, const String& url)
 {
     COMPtr<IWebUIDelegate> uiDelegate;
-    if (SUCCEEDED(m_webView->uiDelegate(uiDelegate.adoptionPointer()))) {
+    if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
         COMPtr<IWebUIDelegatePrivate> uiPrivate;
         if (SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**)&uiPrivate)))
             uiPrivate->webViewAddMessageToConsole(m_webView, BString(message), line, BString(url), true);
@@ -334,7 +334,7 @@ void WebChromeClient::closeWindowSoon()
 void WebChromeClient::runJavaScriptAlert(Frame*, const String& message)
 {
     COMPtr<IWebUIDelegate> ui;
-    if (SUCCEEDED(m_webView->uiDelegate(ui.adoptionPointer())))
+    if (SUCCEEDED(m_webView->uiDelegate(&ui)))
         ui->runJavaScriptAlertPanelWithMessage(m_webView, BString(message));
 }
 
@@ -342,7 +342,7 @@ bool WebChromeClient::runJavaScriptConfirm(Frame*, const String& message)
 {
     BOOL result = FALSE;
     COMPtr<IWebUIDelegate> ui;
-    if (SUCCEEDED(m_webView->uiDelegate(ui.adoptionPointer())))
+    if (SUCCEEDED(m_webView->uiDelegate(&ui)))
         ui->runJavaScriptConfirmPanelWithMessage(m_webView, BString(message), &result);
     return !!result;
 }
@@ -350,7 +350,7 @@ bool WebChromeClient::runJavaScriptConfirm(Frame*, const String& message)
 bool WebChromeClient::runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result)
 {
     COMPtr<IWebUIDelegate> ui;
-    if (FAILED(m_webView->uiDelegate(ui.adoptionPointer())))
+    if (FAILED(m_webView->uiDelegate(&ui)))
         return false;
 
     TimerBase::fireTimersInNestedEventLoop();
@@ -371,7 +371,7 @@ bool WebChromeClient::runJavaScriptPrompt(Frame*, const String& message, const S
 void WebChromeClient::setStatusbarText(const String& statusText)
 {
     COMPtr<IWebUIDelegate> uiDelegate;
-    if (SUCCEEDED(m_webView->uiDelegate(uiDelegate.adoptionPointer()))) {
+    if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
         uiDelegate->setStatusText(m_webView, BString(statusText));
     }
 }
@@ -379,7 +379,7 @@ void WebChromeClient::setStatusbarText(const String& statusText)
 bool WebChromeClient::shouldInterruptJavaScript()
 {
     COMPtr<IWebUIDelegate> uiDelegate;
-    if (SUCCEEDED(m_webView->uiDelegate(uiDelegate.adoptionPointer()))) {
+    if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
         COMPtr<IWebUIDelegatePrivate> uiPrivate;
         if (SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**)&uiPrivate))) {
             BOOL result;
@@ -440,7 +440,7 @@ void WebChromeClient::updateBackingStore()
 void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
 {
     COMPtr<IWebUIDelegate> uiDelegate;
-    if (FAILED(m_webView->uiDelegate(uiDelegate.adoptionPointer())))
+    if (FAILED(m_webView->uiDelegate(&uiDelegate)))
         return;
 
     COMPtr<WebElementPropertyBag> element;
@@ -458,7 +458,7 @@ void WebChromeClient::print(Frame* frame)
 {
     COMPtr<IWebUIDelegate> uiDelegate;
     COMPtr<IWebUIDelegate2> uiDelegate2;
-    if (SUCCEEDED(m_webView->uiDelegate(uiDelegate.adoptionPointer())))
+    if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate)))
         if (SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegate2, (void**)&uiDelegate2)))
             uiDelegate2->printFrame(m_webView, kit(frame));
 }
@@ -467,7 +467,7 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database
 {
     COMPtr<WebSecurityOrigin> origin(AdoptCOM, WebSecurityOrigin::createInstance(frame->document()->securityOrigin()));
     COMPtr<IWebUIDelegate> uiDelegate;
-    if (SUCCEEDED(m_webView->uiDelegate(uiDelegate.adoptionPointer()))) {
+    if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
         COMPtr<IWebUIDelegatePrivate3> uiDelegatePrivate3(Query, uiDelegate);
         if (uiDelegatePrivate3)
             uiDelegatePrivate3->exceededDatabaseQuota(m_webView, kit(frame), origin.get(), BString(databaseIdentifier));
@@ -509,7 +509,7 @@ void WebChromeClient::populateVisitedLinks()
 COMPtr<IWebUIDelegate> WebChromeClient::uiDelegate()
 {
     COMPtr<IWebUIDelegate> delegate;
-    m_webView->uiDelegate(delegate.adoptionPointer());
+    m_webView->uiDelegate(&delegate);
     return delegate;
 }
 
index 5887496..349d1b3 100644 (file)
@@ -100,7 +100,7 @@ static HMENU fixMenuReceivedFromOldSafari(IWebUIDelegate* uiDelegate, ContextMen
 HMENU WebContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu* menu)
 {
     COMPtr<IWebUIDelegate> uiDelegate;
-    if (FAILED(m_webView->uiDelegate(uiDelegate.adoptionPointer())))
+    if (FAILED(m_webView->uiDelegate(&uiDelegate)))
         return menu->platformDescription();
 
     ASSERT(uiDelegate);
@@ -119,7 +119,7 @@ void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem* item, const
     ASSERT(item->type() == ActionType || item->type() == CheckableActionType);
 
     COMPtr<IWebUIDelegate> uiDelegate;
-    if (FAILED(m_webView->uiDelegate(uiDelegate.adoptionPointer())))
+    if (FAILED(m_webView->uiDelegate(&uiDelegate)))
         return;
 
     ASSERT(uiDelegate);
@@ -133,7 +133,7 @@ void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem* item, const
 void WebContextMenuClient::downloadURL(const KURL& url)
 {
     COMPtr<IWebDownloadDelegate> downloadDelegate;
-    if (FAILED(m_webView->downloadDelegate(downloadDelegate.adoptionPointer()))) {
+    if (FAILED(m_webView->downloadDelegate(&downloadDelegate))) {
         // If the WebView doesn't successfully provide a download delegate we'll pass a null one
         // into the WebDownload - which may or may not decide to use a DefaultDownloadDelegate
         LOG_ERROR("Failed to get downloadDelegate from WebView");
index 823f4ee..c35991f 100644 (file)
@@ -79,7 +79,7 @@ DragDestinationAction WebDragClient::actionMaskForDrag(DragData* dragData)
     //Default behaviour (eg. no delegate, or callback not implemented) is to allow
     //any action
     WebDragDestinationAction mask = WebDragDestinationActionAny;
-    if (SUCCEEDED(m_webView->uiDelegate(delegateRef.adoptionPointer())))
+    if (SUCCEEDED(m_webView->uiDelegate(&delegateRef)))
         delegateRef->dragDestinationActionMaskForDraggingInfo(m_webView, dragData->platformData(), &mask);
 
     return (DragDestinationAction)mask;
@@ -90,7 +90,7 @@ void WebDragClient::willPerformDragDestinationAction(DragDestinationAction actio
     //Default delegate for willPerformDragDestinationAction has no side effects
     //so we just call the delegate, and don't worry about whether it's implemented
     COMPtr<IWebUIDelegate> delegateRef = 0;
-    if (SUCCEEDED(m_webView->uiDelegate(delegateRef.adoptionPointer())))
+    if (SUCCEEDED(m_webView->uiDelegate(&delegateRef)))
         delegateRef->willPerformDragDestinationAction(m_webView, (WebDragDestinationAction)action, dragData->platformData());
 }
 
@@ -99,7 +99,7 @@ DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& win
    COMPtr<IWebUIDelegate> delegateRef = 0;
    WebDragSourceAction action = WebDragSourceActionAny;
    POINT localpt = core(m_webView)->mainFrame()->view()->windowToContents(windowPoint);
-   if (SUCCEEDED(m_webView->uiDelegate(delegateRef.adoptionPointer())))
+   if (SUCCEEDED(m_webView->uiDelegate(&delegateRef)))
        delegateRef->dragSourceActionMaskForPoint(m_webView, &localpt, &action);
    return (DragSourceAction)action;
 }
@@ -118,7 +118,7 @@ void WebDragClient::startDrag(DragImageRef image, const IntPoint& imageOrigin, c
     COMPtr<IDataObject> dataObject;
     COMPtr<WebView> viewProtector = m_webView;
     COMPtr<IDropSource> source;
-    if (FAILED(WebDropSource::createInstance(m_webView, source.adoptionPointer())))
+    if (FAILED(WebDropSource::createInstance(m_webView, &source)))
         return;
 
     dataObject = static_cast<ClipboardWin*>(clipboard)->dataObject();
@@ -146,7 +146,7 @@ void WebDragClient::startDrag(DragImageRef image, const IntPoint& imageOrigin, c
         DWORD okEffect = DROPEFFECT_COPY | DROPEFFECT_LINK | DROPEFFECT_MOVE;
         DWORD effect;
         COMPtr<IWebUIDelegate> ui;
-        if (SUCCEEDED(m_webView->uiDelegate(ui.adoptionPointer()))) {
+        if (SUCCEEDED(m_webView->uiDelegate(&ui))) {
             COMPtr<IWebUIDelegatePrivate> uiPrivate;
             if (SUCCEEDED(ui->QueryInterface(IID_IWebUIDelegatePrivate, (void**)&uiPrivate)))
                 if (SUCCEEDED(uiPrivate->doDragDrop(m_webView, dataObject.get(), source.get(), okEffect, &effect)))
index cb1e10e..e38cd0d 100644 (file)
@@ -610,7 +610,7 @@ bool WebEditorClient::isEditable()
 void WebEditorClient::ignoreWordInSpellDocument(const String& word)
 {
     COMPtr<IWebEditingDelegate> ed;
-    if (FAILED(m_webView->editingDelegate(ed.adoptionPointer())) || !ed.get())
+    if (FAILED(m_webView->editingDelegate(&ed)) || !ed.get())
         return;
 
     initViewSpecificSpelling(m_webView);
@@ -620,7 +620,7 @@ void WebEditorClient::ignoreWordInSpellDocument(const String& word)
 void WebEditorClient::learnWord(const String& word)
 {
     COMPtr<IWebEditingDelegate> ed;
-    if (FAILED(m_webView->editingDelegate(ed.adoptionPointer())) || !ed.get())
+    if (FAILED(m_webView->editingDelegate(&ed)) || !ed.get())
         return;
 
     ed->learnWord(BString(word));
@@ -632,7 +632,7 @@ void WebEditorClient::checkSpellingOfString(const UChar* text, int length, int*
     *misspellingLength = 0;
 
     COMPtr<IWebEditingDelegate> ed;
-    if (FAILED(m_webView->editingDelegate(ed.adoptionPointer())) || !ed.get())
+    if (FAILED(m_webView->editingDelegate(&ed)) || !ed.get())
         return;
 
     initViewSpecificSpelling(m_webView);
@@ -646,18 +646,18 @@ void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector
     *badGrammarLength = 0;
 
     COMPtr<IWebEditingDelegate> ed;
-    if (FAILED(m_webView->editingDelegate(ed.adoptionPointer())) || !ed.get())
+    if (FAILED(m_webView->editingDelegate(&ed)) || !ed.get())
         return;
 
     initViewSpecificSpelling(m_webView);
     COMPtr<IEnumWebGrammarDetails> enumDetailsObj;
-    if (FAILED(ed->checkGrammarOfString(m_webView, text, length, enumDetailsObj.adoptionPointer(), badGrammarLocation, badGrammarLength)))
+    if (FAILED(ed->checkGrammarOfString(m_webView, text, length, &enumDetailsObj, badGrammarLocation, badGrammarLength)))
         return;
 
     while (true) {
         ULONG fetched;
         COMPtr<IWebGrammarDetail> detailObj;
-        if (enumDetailsObj->Next(1, detailObj.adoptionPointer(), &fetched) != S_OK)
+        if (enumDetailsObj->Next(1, &detailObj, &fetched) != S_OK)
             break;
 
         GrammarDetail detail;
@@ -672,7 +672,7 @@ void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector
         SysFreeString(userDesc);
 
         COMPtr<IEnumSpellingGuesses> enumGuessesObj;
-        if (FAILED(detailObj->guesses(enumGuessesObj.adoptionPointer())))
+        if (FAILED(detailObj->guesses(&enumGuessesObj)))
             continue;
         while (true) {
             BSTR guess;
@@ -689,7 +689,7 @@ void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector
 void WebEditorClient::updateSpellingUIWithGrammarString(const String& string, const WebCore::GrammarDetail& detail)
 {
     COMPtr<IWebEditingDelegate> ed;
-    if (FAILED(m_webView->editingDelegate(ed.adoptionPointer())) || !ed.get())
+    if (FAILED(m_webView->editingDelegate(&ed)) || !ed.get())
         return;
 
     Vector<BSTR> guessesBSTRs;
@@ -706,7 +706,7 @@ void WebEditorClient::updateSpellingUIWithGrammarString(const String& string, co
 void WebEditorClient::updateSpellingUIWithMisspelledWord(const String& word)
 {
     COMPtr<IWebEditingDelegate> ed;
-    if (FAILED(m_webView->editingDelegate(ed.adoptionPointer())) || !ed.get())
+    if (FAILED(m_webView->editingDelegate(&ed)) || !ed.get())
         return;
 
     ed->updateSpellingUIWithMisspelledWord(BString(word));
@@ -715,7 +715,7 @@ void WebEditorClient::updateSpellingUIWithMisspelledWord(const String& word)
 void WebEditorClient::showSpellingUI(bool show)
 {
     COMPtr<IWebEditingDelegate> ed;
-    if (FAILED(m_webView->editingDelegate(ed.adoptionPointer())) || !ed.get())
+    if (FAILED(m_webView->editingDelegate(&ed)) || !ed.get())
         return;
     
     ed->showSpellingUI(show);
@@ -724,7 +724,7 @@ void WebEditorClient::showSpellingUI(bool show)
 bool WebEditorClient::spellingUIIsShowing()
 {
     COMPtr<IWebEditingDelegate> ed;
-    if (FAILED(m_webView->editingDelegate(ed.adoptionPointer())) || !ed.get())
+    if (FAILED(m_webView->editingDelegate(&ed)) || !ed.get())
         return false;
 
     BOOL showing;
@@ -739,11 +739,11 @@ void WebEditorClient::getGuessesForWord(const String& word, Vector<String>& gues
     guesses.clear();
 
     COMPtr<IWebEditingDelegate> ed;
-    if (FAILED(m_webView->editingDelegate(ed.adoptionPointer())) || !ed.get())
+    if (FAILED(m_webView->editingDelegate(&ed)) || !ed.get())
         return;
 
     COMPtr<IEnumSpellingGuesses> enumGuessesObj;
-    if (FAILED(ed->guessesForWord(BString(word), enumGuessesObj.adoptionPointer())))
+    if (FAILED(ed->guessesForWord(BString(word), &enumGuessesObj)))
         return;
 
     while (true) {
index e1b31d5..f52caf0 100644 (file)
@@ -98,7 +98,7 @@ void WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identi
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (FAILED(webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer())))
+    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
         return;
 
     COMPtr<WebMutableURLRequest> webURLRequest(AdoptCOM, WebMutableURLRequest::createInstance(request));
@@ -111,7 +111,7 @@ void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoa
 
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (SUCCEEDED(webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer()))) {
+    if (SUCCEEDED(webView->resourceLoadDelegate(&resourceLoadDelegate))) {
         COMPtr<WebURLAuthenticationChallenge> webChallenge(AdoptCOM, WebURLAuthenticationChallenge::createInstance(challenge));
         if (SUCCEEDED(resourceLoadDelegate->didReceiveAuthenticationChallenge(webView, identifier, webChallenge.get(), getWebDataSource(loader))))
             return;
@@ -126,7 +126,7 @@ void WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge(DocumentLoad
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (FAILED(webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer())))
+    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
         return;
 
     COMPtr<WebURLAuthenticationChallenge> webChallenge(AdoptCOM, WebURLAuthenticationChallenge::createInstance(challenge));
@@ -137,14 +137,14 @@ void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, unsig
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (FAILED(webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer())))
+    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
         return;
 
     COMPtr<WebMutableURLRequest> webURLRequest(AdoptCOM, WebMutableURLRequest::createInstance(request));
     COMPtr<WebURLResponse> webURLRedirectResponse(AdoptCOM, WebURLResponse::createInstance(redirectResponse));
 
     COMPtr<IWebURLRequest> newWebURLRequest;
-    if (FAILED(resourceLoadDelegate->willSendRequest(webView, identifier, webURLRequest.get(), webURLRedirectResponse.get(), getWebDataSource(loader), newWebURLRequest.adoptionPointer())))
+    if (FAILED(resourceLoadDelegate->willSendRequest(webView, identifier, webURLRequest.get(), webURLRedirectResponse.get(), getWebDataSource(loader), &newWebURLRequest)))
         return;
 
     if (webURLRequest == newWebURLRequest)
@@ -161,7 +161,7 @@ void WebFrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader* loader, un
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (FAILED(webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer())))
+    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
         return;
 
     COMPtr<WebURLResponse> webURLResponse(AdoptCOM, WebURLResponse::createInstance(response));
@@ -172,7 +172,7 @@ void WebFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader* loade
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (FAILED(webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer())))
+    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
         return;
 
     resourceLoadDelegate->didReceiveContentLength(webView, identifier, length, getWebDataSource(loader));
@@ -182,7 +182,7 @@ void WebFrameLoaderClient::dispatchDidFinishLoading(DocumentLoader* loader, unsi
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (FAILED(webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer())))
+    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
         return;
 
     resourceLoadDelegate->didFinishLoadingFromDataSource(webView, identifier, getWebDataSource(loader));
@@ -192,7 +192,7 @@ void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, unsign
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (FAILED(webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer())))
+    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
         return;
 
     COMPtr<WebError> webError(AdoptCOM, WebError::createInstance(error));
@@ -203,7 +203,7 @@ void WebFrameLoaderClient::dispatchDidHandleOnloadEvents()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegatePrivate> frameLoadDelegatePriv;
-    if (SUCCEEDED(webView->frameLoadDelegatePrivate(frameLoadDelegatePriv.adoptionPointer())) && frameLoadDelegatePriv)
+    if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePriv)) && frameLoadDelegatePriv)
         frameLoadDelegatePriv->didHandleOnloadEventsForFrame(webView, m_webFrame);
 }
 
@@ -211,7 +211,7 @@ void WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer())))
+    if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
         frameLoadDelegate->didReceiveServerRedirectForProvisionalLoadForFrame(webView, m_webFrame);
 }
 
@@ -219,7 +219,7 @@ void WebFrameLoaderClient::dispatchDidCancelClientRedirect()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer())))
+    if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
         frameLoadDelegate->didCancelClientRedirectForFrame(webView, m_webFrame);
 }
 
@@ -227,7 +227,7 @@ void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const KURL& url, do
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer())))
+    if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
         frameLoadDelegate->willPerformClientRedirectToURL(webView, BString(url.string()), delay, MarshallingHelpers::CFAbsoluteTimeToDATE(fireDate), m_webFrame);
 }
 
@@ -235,7 +235,7 @@ void WebFrameLoaderClient::dispatchDidChangeLocationWithinPage()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer())))
+    if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
         frameLoadDelegate->didChangeLocationWithinPageForFrame(webView, m_webFrame);
 }
 
@@ -243,7 +243,7 @@ void WebFrameLoaderClient::dispatchWillClose()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer())))
+    if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
         frameLoadDelegate->willCloseFrame(webView, m_webFrame);
 }
 
@@ -256,7 +256,7 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer())))
+    if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
         frameLoadDelegate->didStartProvisionalLoadForFrame(webView, m_webFrame);
 }
 
@@ -264,7 +264,7 @@ void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title)
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer())))
+    if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
         frameLoadDelegate->didReceiveTitle(webView, BString(title), m_webFrame);
 }
 
@@ -272,7 +272,7 @@ void WebFrameLoaderClient::dispatchDidCommitLoad()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer())))
+    if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
         frameLoadDelegate->didCommitLoadForFrame(webView, m_webFrame);
 }
 
@@ -280,7 +280,7 @@ void WebFrameLoaderClient::dispatchDidFinishDocumentLoad()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegatePrivate> frameLoadDelegatePriv;
-    if (SUCCEEDED(webView->frameLoadDelegatePrivate(frameLoadDelegatePriv.adoptionPointer())) && frameLoadDelegatePriv)
+    if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePriv)) && frameLoadDelegatePriv)
         frameLoadDelegatePriv->didFinishDocumentLoadForFrame(webView, m_webFrame);
 }
 
@@ -288,7 +288,7 @@ void WebFrameLoaderClient::dispatchDidFinishLoad()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer())))
+    if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate)))
         frameLoadDelegate->didFinishLoadForFrame(webView, m_webFrame);
 }
 
@@ -296,7 +296,7 @@ void WebFrameLoaderClient::dispatchDidFirstLayout()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegatePrivate> frameLoadDelegatePriv;
-    if (SUCCEEDED(webView->frameLoadDelegatePrivate(frameLoadDelegatePriv.adoptionPointer())) && frameLoadDelegatePriv)
+    if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePriv)) && frameLoadDelegatePriv)
         frameLoadDelegatePriv->didFirstLayoutInFrame(webView, m_webFrame);
 }
 
@@ -305,15 +305,15 @@ Frame* WebFrameLoaderClient::dispatchCreatePage()
     WebView* webView = m_webFrame->webView();
 
     COMPtr<IWebUIDelegate> ui;
-    if (FAILED(webView->uiDelegate(ui.adoptionPointer())))
+    if (FAILED(webView->uiDelegate(&ui)))
         return 0;
 
     COMPtr<IWebView> newWebView;
-    if (FAILED(ui->createWebViewWithRequest(webView, 0, newWebView.adoptionPointer())))
+    if (FAILED(ui->createWebViewWithRequest(webView, 0, &newWebView)))
         return 0;
 
     COMPtr<IWebFrame> mainFrame;
-    if (FAILED(newWebView->mainFrame(mainFrame.adoptionPointer())))
+    if (FAILED(newWebView->mainFrame(&mainFrame)))
         return 0;
 
     COMPtr<WebFrame> mainFrameImpl(Query, mainFrame);
@@ -324,7 +324,7 @@ void WebFrameLoaderClient::dispatchShow()
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebUIDelegate> ui;
-    if (SUCCEEDED(webView->uiDelegate(ui.adoptionPointer())))
+    if (SUCCEEDED(webView->uiDelegate(&ui)))
         ui->webViewShow(webView);
 }
 
@@ -454,7 +454,7 @@ void WebFrameLoaderClient::setTitle(const String& title, const KURL& url)
 {
     BOOL privateBrowsingEnabled = FALSE;
     COMPtr<IWebPreferences> preferences;
-    if (SUCCEEDED(m_webFrame->webView()->preferences(preferences.adoptionPointer())))
+    if (SUCCEEDED(m_webFrame->webView()->preferences(&preferences)))
         preferences->privateBrowsingEnabled(&privateBrowsingEnabled);
     if (privateBrowsingEnabled)
         return;
@@ -465,7 +465,7 @@ void WebFrameLoaderClient::setTitle(const String& title, const KURL& url)
         return;
 
     COMPtr<IWebHistoryItem> item;
-    if (FAILED(history->itemForURL(BString(url.string()), item.adoptionPointer())))
+    if (FAILED(history->itemForURL(BString(url.string()), &item)))
         return;
 
     COMPtr<IWebHistoryItemPrivate> itemPrivate(Query, item);
@@ -637,7 +637,7 @@ Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, Element* e
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
 
     WebView* webView = m_webFrame->webView();
-    if (FAILED(webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer())))
+    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
         return pluginView;
 
     RetainPtr<CFMutableDictionaryRef> userInfo(AdoptCF, CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
index 43d3350..15645cb 100644 (file)
@@ -135,7 +135,7 @@ Page* WebInspectorClient::createPage()
     // clients as well.
     COMPtr<WebPreferences> tempPreferences(AdoptCOM, WebPreferences::createInstance());
     COMPtr<IWebPreferences> iPreferences;
-    if (FAILED(tempPreferences->initWithIdentifier(BString(L"WebInspectorPreferences"), iPreferences.adoptionPointer())))
+    if (FAILED(tempPreferences->initWithIdentifier(BString(L"WebInspectorPreferences"), &iPreferences)))
         return 0;
     COMPtr<WebPreferences> preferences(Query, iPreferences);
     if (!preferences)
index 73619d5..484f7a1 100644 (file)
@@ -205,7 +205,7 @@ HRESULT STDMETHODCALLTYPE WebDownload::initWithRequest(
         /* [in] */ IWebDownloadDelegate* delegate)
 {
     COMPtr<WebMutableURLRequest> webRequest;
-    if (!request || FAILED(request->QueryInterface(webRequest.adoptionPointer()))) {
+    if (!request || FAILED(request->QueryInterface(&webRequest))) {
         LOG(Download, "WebDownload - initWithRequest failed - not a WebMutableURLRequest");    
         return E_FAIL;
     }
@@ -482,7 +482,7 @@ CFURLRequestRef WebDownload::willSendRequest(CFURLRequestRef request, CFURLRespo
     COMPtr<WebURLResponse> webResponse(AdoptCOM, WebURLResponse::createInstance(ResourceResponse(response)));
     COMPtr<IWebMutableURLRequest> finalRequest;
 
-    if (FAILED(m_delegate->willSendRequest(this, webRequest.get(), webResponse.get(), finalRequest.adoptionPointer())))
+    if (FAILED(m_delegate->willSendRequest(this, webRequest.get(), webResponse.get(), &finalRequest)))
         LOG_ERROR("DownloadDelegate->willSendRequest failed");
     
     if (!finalRequest)
index d08d80a..47e7a90 100644 (file)
@@ -399,7 +399,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::loadRequest(
 {
     COMPtr<WebMutableURLRequest> requestImpl;
 
-    HRESULT hr = request->QueryInterface(requestImpl.adoptionPointer());
+    HRESULT hr = request->QueryInterface(&requestImpl);
     if (FAILED(hr))
         return hr;
  
@@ -1043,12 +1043,12 @@ HRESULT WebFrame::canProvideDocumentSource(bool* result)
     *result = false;
 
     COMPtr<IWebDataSource> dataSource;
-    hr = WebFrame::dataSource(dataSource.adoptionPointer());
+    hr = WebFrame::dataSource(&dataSource);
     if (FAILED(hr))
         return hr;
 
     COMPtr<IWebURLResponse> urlResponse;
-    hr = dataSource->response(urlResponse.adoptionPointer());
+    hr = dataSource->response(&urlResponse);
     if (SUCCEEDED(hr) && urlResponse) {
         BSTR mimeTypeBStr;
         if (SUCCEEDED(urlResponse->MIMEType(&mimeTypeBStr))) {
@@ -1116,7 +1116,7 @@ void WebFrame::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<F
 
     COMPtr<IWebFormDelegate> formDelegate;
 
-    if (FAILED(d->webView->formDelegate(formDelegate.adoptionPointer()))) {
+    if (FAILED(d->webView->formDelegate(&formDelegate))) {
         (coreFrame->loader()->*function)(PolicyUse);
         return;
     }
@@ -1307,7 +1307,7 @@ void WebFrame::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, con
     ASSERT(coreFrame);
 
     COMPtr<IWebPolicyDelegate> policyDelegate;
-    if (FAILED(d->webView->policyDelegate(policyDelegate.adoptionPointer())))
+    if (FAILED(d->webView->policyDelegate(&policyDelegate)))
         policyDelegate = DefaultPolicyDelegate::sharedInstance();
 
     COMPtr<IWebURLRequest> urlRequest(AdoptCOM, WebMutableURLRequest::createInstance(request));
@@ -1324,7 +1324,7 @@ void WebFrame::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction functi
     ASSERT(coreFrame);
 
     COMPtr<IWebPolicyDelegate> policyDelegate;
-    if (FAILED(d->webView->policyDelegate(policyDelegate.adoptionPointer())))
+    if (FAILED(d->webView->policyDelegate(&policyDelegate)))
         policyDelegate = DefaultPolicyDelegate::sharedInstance();
 
     COMPtr<IWebURLRequest> urlRequest(AdoptCOM, WebMutableURLRequest::createInstance(request));
@@ -1342,7 +1342,7 @@ void WebFrame::dispatchDecidePolicyForNavigationAction(FramePolicyFunction funct
     ASSERT(coreFrame);
 
     COMPtr<IWebPolicyDelegate> policyDelegate;
-    if (FAILED(d->webView->policyDelegate(policyDelegate.adoptionPointer())))
+    if (FAILED(d->webView->policyDelegate(&policyDelegate)))
         policyDelegate = DefaultPolicyDelegate::sharedInstance();
 
     COMPtr<IWebURLRequest> urlRequest(AdoptCOM, WebMutableURLRequest::createInstance(request));
@@ -1357,7 +1357,7 @@ void WebFrame::dispatchDecidePolicyForNavigationAction(FramePolicyFunction funct
 void WebFrame::dispatchUnableToImplementPolicy(const ResourceError& error)
 {
     COMPtr<IWebPolicyDelegate> policyDelegate;
-    if (FAILED(d->webView->policyDelegate(policyDelegate.adoptionPointer())))
+    if (FAILED(d->webView->policyDelegate(&policyDelegate)))
         policyDelegate = DefaultPolicyDelegate::sharedInstance();
 
     COMPtr<IWebError> webError(AdoptCOM, WebError::createInstance(error));
@@ -1368,8 +1368,8 @@ void WebFrame::download(ResourceHandle* handle, const ResourceRequest& request,
 {
     COMPtr<IWebDownloadDelegate> downloadDelegate;
     COMPtr<IWebView> webView;
-    if (SUCCEEDED(this->webView(webView.adoptionPointer()))) {
-        if (FAILED(webView->downloadDelegate(downloadDelegate.adoptionPointer()))) {
+    if (SUCCEEDED(this->webView(&webView))) {
+        if (FAILED(webView->downloadDelegate(&downloadDelegate))) {
             // If the WebView doesn't successfully provide a download delegate we'll pass a null one
             // into the WebDownload - which may or may not decide to use a DefaultDownloadDelegate
             LOG_ERROR("Failed to get downloadDelegate from WebView");
@@ -1392,7 +1392,7 @@ bool WebFrame::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const Res
 void WebFrame::dispatchDidFailProvisionalLoad(const ResourceError& error)
 {
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(d->webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer()))) {
+    if (SUCCEEDED(d->webView->frameLoadDelegate(&frameLoadDelegate))) {
         COMPtr<IWebError> webError;
         webError.adoptRef(WebError::createInstance(error));
         frameLoadDelegate->didFailProvisionalLoadWithError(d->webView, webError.get(), this);
@@ -1402,7 +1402,7 @@ void WebFrame::dispatchDidFailProvisionalLoad(const ResourceError& error)
 void WebFrame::dispatchDidFailLoad(const ResourceError& error)
 {
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(d->webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer()))) {
+    if (SUCCEEDED(d->webView->frameLoadDelegate(&frameLoadDelegate))) {
         COMPtr<IWebError> webError;
         webError.adoptRef(WebError::createInstance(error));
         frameLoadDelegate->didFailLoadWithError(d->webView, webError.get(), this);
@@ -1423,7 +1423,7 @@ Widget* WebFrame::createJavaAppletWidget(const IntSize& pluginSize, Element* ele
         return pluginView;
 
     COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (FAILED(d->webView->resourceLoadDelegate(resourceLoadDelegate.adoptionPointer())))
+    if (FAILED(d->webView->resourceLoadDelegate(&resourceLoadDelegate)))
         return pluginView;
 
     COMPtr<CFDictionaryPropertyBag> userInfoBag(AdoptCOM, CFDictionaryPropertyBag::createInstance());
@@ -1473,7 +1473,7 @@ void WebFrame::windowObjectCleared()
         return;
 
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
-    if (SUCCEEDED(d->webView->frameLoadDelegate(frameLoadDelegate.adoptionPointer()))) {
+    if (SUCCEEDED(d->webView->frameLoadDelegate(&frameLoadDelegate))) {
         COMPtr<IWebFrameLoadDelegate2> frameLoadDelegate2(Query, frameLoadDelegate);
 
         JSContextRef context = toRef(coreFrame->scriptProxy()->globalObject()->globalExec());
@@ -1489,7 +1489,7 @@ void WebFrame::windowObjectCleared()
 void WebFrame::didPerformFirstNavigation() const
 {
     COMPtr<IWebPreferences> preferences;
-    if (FAILED(d->webView->preferences(preferences.adoptionPointer())))
+    if (FAILED(d->webView->preferences(&preferences)))
         return;
 
     COMPtr<IWebPreferencesPrivate> preferencesPrivate(Query, preferences);
@@ -1572,7 +1572,7 @@ void WebFrame::headerAndFooterHeights(float* headerHeight, float* footerHeight)
         *footerHeight = 0;
     float height = 0;
     COMPtr<IWebUIDelegate> ui;
-    if (FAILED(d->webView->uiDelegate(ui.adoptionPointer())))
+    if (FAILED(d->webView->uiDelegate(&ui)))
         return;
     COMPtr<IWebUIDelegate2> ui2;
     if (FAILED(ui->QueryInterface(IID_IWebUIDelegate2, (void**) &ui2)))
@@ -1588,7 +1588,7 @@ IntRect WebFrame::printerMarginRect(HDC printDC)
     IntRect emptyRect(0, 0, 0, 0);
 
     COMPtr<IWebUIDelegate> ui;
-    if (FAILED(d->webView->uiDelegate(ui.adoptionPointer())))
+    if (FAILED(d->webView->uiDelegate(&ui)))
         return emptyRect;
     COMPtr<IWebUIDelegate2> ui2;
     if (FAILED(ui->QueryInterface(IID_IWebUIDelegate2, (void**) &ui2)))
@@ -1694,7 +1694,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::spoolPages(
         endPage = pageCount;
 
     COMPtr<IWebUIDelegate> ui;
-    if (FAILED(d->webView->uiDelegate(ui.adoptionPointer())))
+    if (FAILED(d->webView->uiDelegate(&ui)))
         return E_FAIL;
     // FIXME: we can return early after the updated app is released
     COMPtr<IWebUIDelegate2> ui2;
index e53158c..2d541ff 100644 (file)
@@ -265,12 +265,12 @@ HRESULT STDMETHODCALLTYPE WebHTMLRepresentation::documentSource(
     HRESULT hr = S_OK;
 
     COMPtr<IWebDataSource> dataSource;
-    hr = m_frame->dataSource(dataSource.adoptionPointer());
+    hr = m_frame->dataSource(&dataSource);
     if (FAILED(hr))
         return hr;
 
     COMPtr<IStream> data;
-    hr = dataSource->data(data.adoptionPointer());
+    hr = dataSource->data(&data);
     if (FAILED(hr))
         return hr;
 
index 39e2916..3efc94f 100644 (file)
@@ -214,7 +214,7 @@ STDAPI DllRegisterServer(void)
 
     typedef HRESULT (WINAPI *RegisterTypeLibForUserPtr)(ITypeLib*, OLECHAR*, OLECHAR*);
     COMPtr<ITypeLib> typeLib;
-    LoadTypeLibEx(szFileName, REGKIND_NONE, typeLib.adoptionPointer());
+    LoadTypeLibEx(szFileName, REGKIND_NONE, &typeLib);
     if (RegisterTypeLibForUserPtr registerTypeLibForUser = reinterpret_cast<RegisterTypeLibForUserPtr>(GetProcAddress(GetModuleHandle(TEXT("oleaut32.dll")), "RegisterTypeLibForUser")))
         registerTypeLibForUser(typeLib.get(), szFileName, 0);
     else
index 09b8687..cc27795 100644 (file)
@@ -167,7 +167,7 @@ HRESULT STDMETHODCALLTYPE WebNotificationCenter::postNotification(
         return hr;
 
     COMPtr<IUnknown> obj;
-    hr = notification->getObject(obj.adoptionPointer());
+    hr = notification->getObject(&obj);
     if (FAILED(hr))
         return hr;
 
index 4348802..17ee6e7 100644 (file)
@@ -123,7 +123,7 @@ HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallenge::initWithProtectionSpace
 
     HRESULT hr = S_OK;
     COMPtr<WebURLProtectionSpace> webSpace;
-    hr = space->QueryInterface(webSpace.adoptionPointer());
+    hr = space->QueryInterface(&webSpace);
     if (FAILED(hr))
         return hr;
 
@@ -132,7 +132,7 @@ HRESULT STDMETHODCALLTYPE WebURLAuthenticationChallenge::initWithProtectionSpace
         return E_NOINTERFACE;
 
     COMPtr<WebURLResponse> webResponse;
-    hr = failureResponse->QueryInterface(webResponse.adoptionPointer());
+    hr = failureResponse->QueryInterface(&webResponse);
     if (FAILED(hr))
         return hr;
 
index b269e4b..c254d4e 100644 (file)
@@ -153,7 +153,7 @@ HRESULT PreferencesChangedOrRemovedObserver::onNotify(IWebNotification* notifica
     HRESULT hr = S_OK;
 
     COMPtr<IUnknown> unkPrefs;
-    hr = notification->getObject(unkPrefs.adoptionPointer());
+    hr = notification->getObject(&unkPrefs);
     if (FAILED(hr))
         return hr;
 
@@ -565,7 +565,7 @@ WebCacheModel WebView::maxCacheModelInAnyInstance()
     HashSet<WebView*>::iterator end = allWebViewsSet().end();
     for (HashSet<WebView*>::iterator it = allWebViewsSet().begin(); it != end; ++it) {
         COMPtr<IWebPreferences> pref;
-        if (FAILED((*it)->preferences(pref.adoptionPointer())))
+        if (FAILED((*it)->preferences(&pref)))
             continue;
         WebCacheModel prefCacheModel = WebCacheModelDocumentViewer;
         if (FAILED(pref->cacheModel(&prefCacheModel)))
@@ -882,7 +882,7 @@ void WebView::paint(HDC dc, LPARAM options)
 
     // Paint the gripper.
     COMPtr<IWebUIDelegate> ui;
-    if (SUCCEEDED(uiDelegate(ui.adoptionPointer()))) {
+    if (SUCCEEDED(uiDelegate(&ui))) {
         COMPtr<IWebUIDelegatePrivate> uiPrivate;
         if (SUCCEEDED(ui->QueryInterface(IID_IWebUIDelegatePrivate, (void**)&uiPrivate))) {
             RECT r;
@@ -973,7 +973,7 @@ void WebView::closeWindow()
     }
 
     COMPtr<IWebUIDelegate> ui;
-    if (SUCCEEDED(uiDelegate(ui.adoptionPointer())))
+    if (SUCCEEDED(uiDelegate(&ui)))
         ui->webViewClose(this);
 }
 
@@ -1716,7 +1716,7 @@ static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, L
         case WM_SETFOCUS: {
             COMPtr<IWebUIDelegate> uiDelegate;
             COMPtr<IWebUIDelegatePrivate> uiDelegatePrivate;
-            if (SUCCEEDED(webView->uiDelegate(uiDelegate.adoptionPointer())) && uiDelegate &&
+            if (SUCCEEDED(webView->uiDelegate(&uiDelegate)) && uiDelegate &&
                 SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate)
                 uiDelegatePrivate->webViewReceivedFocus(webView);
 
@@ -1734,7 +1734,7 @@ static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, L
             COMPtr<IWebUIDelegate> uiDelegate;
             COMPtr<IWebUIDelegatePrivate> uiDelegatePrivate;
             HWND newFocusWnd = reinterpret_cast<HWND>(wParam);
-            if (SUCCEEDED(webView->uiDelegate(uiDelegate.adoptionPointer())) && uiDelegate &&
+            if (SUCCEEDED(webView->uiDelegate(&uiDelegate)) && uiDelegate &&
                 SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate)
                 uiDelegatePrivate->webViewLostFocus(webView, (OLE_HANDLE)(ULONG64)newFocusWnd);
 
@@ -1806,7 +1806,7 @@ static LRESULT CALLBACK WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, L
                 if (lpMsg->message == WM_KEYDOWN)
                     keyCode = (UINT) lpMsg->wParam;
             }
-            if (SUCCEEDED(webView->uiDelegate(uiDelegate.adoptionPointer())) && uiDelegate &&
+            if (SUCCEEDED(webView->uiDelegate(&uiDelegate)) && uiDelegate &&
                 SUCCEEDED(uiDelegate->QueryInterface(IID_IWebUIDelegatePrivate, (void**) &uiDelegatePrivate)) && uiDelegatePrivate &&
                 SUCCEEDED(uiDelegatePrivate->webViewGetDlgCode(webView, keyCode, &dlgCode)))
                 return dlgCode;
@@ -2191,14 +2191,14 @@ void WebView::setToolTip(const String& toolTip)
 HRESULT WebView::notifyDidAddIcon(IWebNotification* notification)
 {
     COMPtr<IPropertyBag> propertyBag;
-    HRESULT hr = notification->userInfo(propertyBag.adoptionPointer());
+    HRESULT hr = notification->userInfo(&propertyBag);
     if (FAILED(hr))
         return hr;
     if (!propertyBag)
         return E_FAIL;
 
     COMPtr<CFDictionaryPropertyBag> dictionaryPropertyBag;
-    hr = propertyBag->QueryInterface(dictionaryPropertyBag.adoptionPointer());
+    hr = propertyBag->QueryInterface(&dictionaryPropertyBag);
     if (FAILED(hr))
         return hr;
 
@@ -2402,7 +2402,7 @@ HRESULT STDMETHODCALLTYPE WebView::goToBackForwardItem(
     *succeeded = FALSE;
 
     COMPtr<WebHistoryItem> webHistoryItem;
-    HRESULT hr = item->QueryInterface(webHistoryItem.adoptionPointer());
+    HRESULT hr = item->QueryInterface(&webHistoryItem);
     if (FAILED(hr))
         return hr;
 
@@ -2546,8 +2546,8 @@ HRESULT STDMETHODCALLTYPE WebView::customTextEncodingName(
     if (!m_mainFrame)
         return E_FAIL;
 
-    if (FAILED(m_mainFrame->provisionalDataSource(dataSource.adoptionPointer())) || !dataSource) {
-        hr = m_mainFrame->dataSource(dataSource.adoptionPointer());
+    if (FAILED(m_mainFrame->provisionalDataSource(&dataSource)) || !dataSource) {
+        hr = m_mainFrame->dataSource(&dataSource);
         if (FAILED(hr) || !dataSource)
             return hr;
     }
@@ -2922,13 +2922,13 @@ HRESULT STDMETHODCALLTYPE WebView::isLoading(
 
     *isLoading = FALSE;
 
-    if (SUCCEEDED(m_mainFrame->dataSource(dataSource.adoptionPointer())))
+    if (SUCCEEDED(m_mainFrame->dataSource(&dataSource)))
         dataSource->isLoading(isLoading);
 
     if (*isLoading)
         return S_OK;
 
-    if (SUCCEEDED(m_mainFrame->provisionalDataSource(provisionalDataSource.adoptionPointer())))
+    if (SUCCEEDED(m_mainFrame->provisionalDataSource(&provisionalDataSource)))
         provisionalDataSource->isLoading(isLoading);
     return S_OK;
 }
@@ -3413,7 +3413,7 @@ HRESULT STDMETHODCALLTYPE WebView::setContinuousSpellCheckingEnabled(
     if (continuousSpellCheckingEnabled != !!flag) {
         continuousSpellCheckingEnabled = !!flag;
         COMPtr<IWebPreferences> prefs;
-        if (SUCCEEDED(preferences(prefs.adoptionPointer())))
+        if (SUCCEEDED(preferences(&prefs)))
             prefs->setContinuousSpellCheckingEnabled(flag);
     }
     
@@ -3477,7 +3477,7 @@ bool WebView::continuousCheckingAllowed()
     static bool readAllowContinuousSpellCheckingDefault = false;
     if (!readAllowContinuousSpellCheckingDefault) {
         COMPtr<IWebPreferences> prefs;
-        if (SUCCEEDED(preferences(prefs.adoptionPointer()))) {
+        if (SUCCEEDED(preferences(&prefs))) {
             BOOL allowed;
             prefs->allowContinuousSpellChecking(&allowed);
             allowContinuousSpellChecking = !!allowed;
@@ -3590,7 +3590,7 @@ HRESULT STDMETHODCALLTYPE WebView::setGrammarCheckingEnabled(
     
     grammarCheckingEnabled = !!enabled;
     COMPtr<IWebPreferences> prefs;
-    if (SUCCEEDED(preferences(prefs.adoptionPointer())))
+    if (SUCCEEDED(preferences(&prefs)))
         prefs->setGrammarCheckingEnabled(enabled);
     
     m_editingDelegate->updateGrammar();
@@ -3861,7 +3861,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
     HRESULT hr;
 
     COMPtr<IUnknown> unkPrefs;
-    hr = notification->getObject(unkPrefs.adoptionPointer());
+    hr = notification->getObject(&unkPrefs);
     if (FAILED(hr))
         return hr;
 
@@ -4276,7 +4276,7 @@ HRESULT STDMETHODCALLTYPE WebView::canHandleRequest(
 {
     COMPtr<WebMutableURLRequest> requestImpl;
 
-    HRESULT hr = request->QueryInterface(requestImpl.adoptionPointer());
+    HRESULT hr = request->QueryInterface(&requestImpl);
     if (FAILED(hr))
         return hr;
 
@@ -4352,7 +4352,7 @@ HRESULT STDMETHODCALLTYPE WebView::loadBackForwardListFromOtherView(
     ASSERT(!backForwardList->currentItem()); // destination list should be empty
 
     COMPtr<WebView> otherWebView;
-    if (FAILED(otherView->QueryInterface(otherWebView.adoptionPointer())))
+    if (FAILED(otherView->QueryInterface(&otherWebView)))
         return E_FAIL;
     BackForwardList* otherBackForwardList = otherWebView->m_page->backForwardList();
     if (!otherBackForwardList->currentItem())
@@ -4901,7 +4901,7 @@ Page* core(IWebView* iWebView)
     Page* page = 0;
 
     COMPtr<WebView> webView;
-    if (SUCCEEDED(iWebView->QueryInterface(webView.adoptionPointer())) && webView)
+    if (SUCCEEDED(iWebView->QueryInterface(&webView)) && webView)
         page = webView->page();
 
     return page;
index 62eb890..31cfa99 100644 (file)
@@ -1,5 +1,9 @@
 2008-04-29  Adam Roben  <aroben@apple.com>
 
+        Restore the beloved COMPtr::operator&
+
+2008-04-29  Adam Roben  <aroben@apple.com>
+
         Windows build fixes
 
         Replace COMPtr::operator& with COMPtr::adoptionPointer.
index 49abb8d..77b689c 100644 (file)
@@ -160,7 +160,7 @@ HRESULT STDMETHODCALLTYPE DebuggerClient::didFinishLoadForFrame(
     m_webViewLoaded = true;
 
     COMPtr<IWebFrame> mainFrame;
-    ret = webView->mainFrame(mainFrame.adoptionPointer());
+    ret = webView->mainFrame(&mainFrame);
     if (FAILED(ret))
         return ret;
 
@@ -261,7 +261,7 @@ HRESULT STDMETHODCALLTYPE DebuggerClient::createWebViewWithRequest(
 
         if (!requestIsEmpty) {
             COMPtr<IWebFrame> mainFrame;
-            ret = view->mainFrame(mainFrame.adoptionPointer());
+            ret = view->mainFrame(&mainFrame);
             if (FAILED(ret))
                 return ret;
 
index 851efd8..f23daf7 100644 (file)
@@ -91,7 +91,7 @@ void DebuggerDocument::getPlatformCurrentFunctionStack(JSContextRef context, Vec
         if (FAILED(frame->functionName(&function)))
             return;
 
-        if (FAILED(frame->caller(caller.adoptionPointer())))
+        if (FAILED(frame->caller(&caller)))
             return;
 
         if (!function) {
@@ -118,7 +118,7 @@ void DebuggerDocument::getPlatformLocalScopeVariableNamesForCallFrame(JSContextR
     VariantInit(&var);
 
     COMPtr<IEnumVARIANT> localScopeVariableNames;
-    if (FAILED(cframe->variableNames(localScopeVariableNames.adoptionPointer())))
+    if (FAILED(cframe->variableNames(&localScopeVariableNames)))
         return;
 
     while (localScopeVariableNames->Next(1, &var, 0) == S_OK) {
index 2beb942..820054f 100644 (file)
@@ -350,7 +350,7 @@ HRESULT Drosera::attach()
         return ret;
 
     COMPtr<IWebFrame> mainFrame;
-    ret = m_webView->mainFrame(mainFrame.adoptionPointer());
+    ret = m_webView->mainFrame(&mainFrame);
     if (FAILED(ret))
         return ret;
 
index 03465e4..de2b416 100644 (file)
@@ -69,7 +69,7 @@ void ServerConnection::attemptToCreateServerConnection(JSGlobalContextRef global
     if (FAILED(CoCreateInstance(clsid, 0, CLSCTX_LOCAL_SERVER, IID_IWebScriptDebugServer, (void**)&tempServer)))
         return;
 
-    if (FAILED(tempServer->sharedWebScriptDebugServer(m_server.adoptionPointer())))
+    if (FAILED(tempServer->sharedWebScriptDebugServer(&m_server)))
         return;
 
     if (FAILED(m_server->addListener(this))) {
@@ -145,7 +145,7 @@ HRESULT STDMETHODCALLTYPE ServerConnection::didLoadMainResourceForDataSource(
 
     // Get document source
     COMPtr<IWebDocumentRepresentation> rep;
-    ret = dataSource->representation(rep.adoptionPointer());
+    ret = dataSource->representation(&rep);
     if (FAILED(ret))
         return ret;
 
@@ -166,7 +166,7 @@ HRESULT STDMETHODCALLTYPE ServerConnection::didLoadMainResourceForDataSource(
 
     // Get URL
     COMPtr<IWebURLResponse> response;
-    ret = dataSource->response(response.adoptionPointer());
+    ret = dataSource->response(&response);
     if (FAILED(ret))
         return ret;
 
@@ -196,12 +196,12 @@ HRESULT STDMETHODCALLTYPE ServerConnection::didParseSource(
         return ret;
 
     COMPtr<IWebDataSource> dataSource;
-    ret = webFrame->dataSource(dataSource.adoptionPointer());
+    ret = webFrame->dataSource(&dataSource);
     if (FAILED(ret))
         return ret;
 
     COMPtr<IWebURLResponse> response;
-    ret = dataSource->response(response.adoptionPointer());
+    ret = dataSource->response(&response);
     if (FAILED(ret))
         return ret;
 
@@ -213,7 +213,7 @@ HRESULT STDMETHODCALLTYPE ServerConnection::didParseSource(
     BSTR documentSource = 0;
     if (!url || !wcscmp(responseURL, url)) {
         COMPtr<IWebDocumentRepresentation> rep;
-        ret = dataSource->representation(rep.adoptionPointer());
+        ret = dataSource->representation(&rep);
         if (FAILED(ret))
             return ret;
 
@@ -358,7 +358,7 @@ COMPtr<IWebScriptCallFrame> ServerConnection::getCallerFrame(int callFrame) cons
     COMPtr<IWebScriptCallFrame> cframe = currentFrame();
     for (int count = 0; count < callFrame; count++) {
         COMPtr<IWebScriptCallFrame> callerFrame;
-        if (FAILED(cframe->caller(callerFrame.adoptionPointer())))
+        if (FAILED(cframe->caller(&callerFrame)))
             return 0;
 
         cframe = callerFrame;
index c4575a8..f4c66fd 100644 (file)
@@ -255,7 +255,7 @@ void dumpFrameScrollPosition(IWebFrame* frame)
         return;
 
     COMPtr<IWebFramePrivate> framePrivate;
-    if (FAILED(frame->QueryInterface(framePrivate.adoptionPointer())))
+    if (FAILED(frame->QueryInterface(&framePrivate)))
         return;
 
     SIZE scrollPosition;
@@ -264,7 +264,7 @@ void dumpFrameScrollPosition(IWebFrame* frame)
 
     if (abs(scrollPosition.cx) > 0.00000001 || abs(scrollPosition.cy) > 0.00000001) {
         COMPtr<IWebFrame> parent;
-        if (FAILED(frame->parentFrame(parent.adoptionPointer())))
+        if (FAILED(frame->parentFrame(&parent)))
             return;
         if (parent) {
             BSTR name;
@@ -278,7 +278,7 @@ void dumpFrameScrollPosition(IWebFrame* frame)
 
     if (::layoutTestController->dumpChildFrameScrollPositions()) {
         COMPtr<IEnumVARIANT> enumKids;
-        if (FAILED(frame->childFrames(enumKids.adoptionPointer())))
+        if (FAILED(frame->childFrames(&enumKids)))
             return;
         VARIANT var;
         VariantInit(&var);
@@ -298,18 +298,18 @@ static wstring dumpFramesAsText(IWebFrame* frame)
         return L"";
 
     COMPtr<IDOMDocument> document;
-    if (FAILED(frame->DOMDocument(document.adoptionPointer())))
+    if (FAILED(frame->DOMDocument(&document)))
         return L"";
 
     COMPtr<IDOMElement> documentElement;
-    if (FAILED(document->documentElement(documentElement.adoptionPointer())))
+    if (FAILED(document->documentElement(&documentElement)))
         return L"";
 
     wstring result;
 
     // Add header for all but the main frame.
     COMPtr<IWebFrame> parent;
-    if (FAILED(frame->parentFrame(parent.adoptionPointer())))
+    if (FAILED(frame->parentFrame(&parent)))
         return L"";
     if (parent) {
         BSTR name = L"";
@@ -325,7 +325,7 @@ static wstring dumpFramesAsText(IWebFrame* frame)
 
     BSTR innerText = 0;
     COMPtr<IDOMElementPrivate> docPrivate;
-    if (SUCCEEDED(documentElement->QueryInterface(docPrivate.adoptionPointer())))
+    if (SUCCEEDED(documentElement->QueryInterface(&docPrivate)))
         docPrivate->innerText(&innerText);
 
     result.append(innerText ? innerText : L"", SysStringLen(innerText));
@@ -335,7 +335,7 @@ static wstring dumpFramesAsText(IWebFrame* frame)
 
     if (::layoutTestController->dumpChildFramesAsText()) {
         COMPtr<IEnumVARIANT> enumKids;
-        if (FAILED(frame->childFrames(enumKids.adoptionPointer())))
+        if (FAILED(frame->childFrames(&enumKids)))
             return L"";
         VARIANT var;
         VariantInit(&var);
@@ -354,11 +354,11 @@ static wstring dumpFramesAsText(IWebFrame* frame)
 static int compareHistoryItems(const void* item1, const void* item2)
 {
     COMPtr<IWebHistoryItemPrivate> itemA;
-    if (FAILED((*(COMPtr<IUnknown>*)item1)->QueryInterface(itemA.adoptionPointer())))
+    if (FAILED((*(COMPtr<IUnknown>*)item1)->QueryInterface(&itemA)))
         return 0;
 
     COMPtr<IWebHistoryItemPrivate> itemB;
-    if (FAILED((*(COMPtr<IUnknown>*)item2)->QueryInterface(itemB.adoptionPointer())))
+    if (FAILED((*(COMPtr<IUnknown>*)item2)->QueryInterface(&itemB)))
         return 0;
 
     BSTR targetA;
@@ -396,7 +396,7 @@ static void dumpHistoryItem(IWebHistoryItem* item, int indent, bool current)
     SysFreeString(url);
 
     COMPtr<IWebHistoryItemPrivate> itemPrivate;
-    if (FAILED(item->QueryInterface(itemPrivate.adoptionPointer())))
+    if (FAILED(item->QueryInterface(&itemPrivate)))
         return;
 
     BSTR target;
@@ -445,7 +445,7 @@ static void dumpHistoryItem(IWebHistoryItem* item, int indent, bool current)
 
     for (unsigned i = 0; i < kidsCount; ++i) {
         COMPtr<IWebHistoryItem> item;
-        kidsVector[i]->QueryInterface(item.adoptionPointer());
+        kidsVector[i]->QueryInterface(&item);
         dumpHistoryItem(item.get(), indent + 4, false);
     }
 
@@ -461,7 +461,7 @@ static void dumpBackForwardList(IWebView* webView)
     printf("\n============== Back Forward List ==============\n");
 
     COMPtr<IWebBackForwardList> bfList;
-    if (FAILED(webView->backForwardList(bfList.adoptionPointer())))
+    if (FAILED(webView->backForwardList(&bfList)))
         return;
 
     // Print out all items in the list after prevTestBFItem, which was from the previous test
@@ -475,22 +475,22 @@ static void dumpBackForwardList(IWebView* webView)
 
     for (int i = forwardListCount; i > 0; --i) {
         COMPtr<IWebHistoryItem> item;
-        if (FAILED(bfList->itemAtIndex(i, item.adoptionPointer())))
+        if (FAILED(bfList->itemAtIndex(i, &item)))
             return;
         // something is wrong if the item from the last test is in the forward part of the b/f list
         assert(item != prevTestBFItem);
         COMPtr<IUnknown> itemUnknown;
-        item->QueryInterface(itemUnknown.adoptionPointer());
+        item->QueryInterface(&itemUnknown);
         itemsToPrint.append(itemUnknown);
     }
     
     COMPtr<IWebHistoryItem> currentItem;
-    if (FAILED(bfList->currentItem(currentItem.adoptionPointer())))
+    if (FAILED(bfList->currentItem(&currentItem)))
         return;
 
     assert(currentItem != prevTestBFItem);
     COMPtr<IUnknown> currentItemUnknown;
-    currentItem->QueryInterface(currentItemUnknown.adoptionPointer());
+    currentItem->QueryInterface(&currentItemUnknown);
     itemsToPrint.append(currentItemUnknown);
     int currentItemIndex = itemsToPrint.size() - 1;
 
@@ -500,18 +500,18 @@ static void dumpBackForwardList(IWebView* webView)
 
     for (int i = -1; i >= -backListCount; --i) {
         COMPtr<IWebHistoryItem> item;
-        if (FAILED(bfList->itemAtIndex(i, item.adoptionPointer())))
+        if (FAILED(bfList->itemAtIndex(i, &item)))
             return;
         if (item == prevTestBFItem)
             break;
         COMPtr<IUnknown> itemUnknown;
-        item->QueryInterface(itemUnknown.adoptionPointer());
+        item->QueryInterface(&itemUnknown);
         itemsToPrint.append(itemUnknown);
     }
 
     for (int i = itemsToPrint.size() - 1; i >= 0; --i) {
         COMPtr<IWebHistoryItem> historyItemToPrint;
-        itemsToPrint[i]->QueryInterface(historyItemToPrint.adoptionPointer());
+        itemsToPrint[i]->QueryInterface(&historyItemToPrint);
         dumpHistoryItem(historyItemToPrint.get(), 8, i == currentItemIndex);
     }
 
@@ -531,9 +531,9 @@ static void dumpBackForwardListForAllWindows()
 void dump()
 {
     COMPtr<IWebDataSource> dataSource;
-    if (SUCCEEDED(frame->dataSource(dataSource.adoptionPointer()))) {
+    if (SUCCEEDED(frame->dataSource(&dataSource))) {
         COMPtr<IWebURLResponse> response;
-        if (SUCCEEDED(dataSource->response(response.adoptionPointer())) && response) {
+        if (SUCCEEDED(dataSource->response(&response)) && response) {
             BSTR mimeType;
             if (SUCCEEDED(response->MIMEType(&mimeType)))
                 ::layoutTestController->setDumpAsText(::layoutTestController->dumpAsText() | !_tcscmp(mimeType, TEXT("text/plain")));
@@ -566,7 +566,7 @@ void dump()
             ::SendMessage(webViewWindow, WM_PAINT, 0, 0);
 
             COMPtr<IWebFramePrivate> framePrivate;
-            if (FAILED(frame->QueryInterface(framePrivate.adoptionPointer())))
+            if (FAILED(frame->QueryInterface(&framePrivate)))
                 goto fail;
             framePrivate->renderTreeAsExternalRepresentation(&resultString);
         }
@@ -617,7 +617,7 @@ static bool shouldLogFrameLoadDelegates(const char* pathOrURL)
 static void resetWebViewToConsistentStateBeforeTesting()
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer()))) 
+    if (FAILED(frame->webView(&webView))) 
         return;
 
     webView->setPolicyDelegate(0);
@@ -629,7 +629,7 @@ static void resetWebViewToConsistentStateBeforeTesting()
     }
 
     COMPtr<IWebPreferences> preferences;
-    if (SUCCEEDED(webView->preferences(preferences.adoptionPointer()))) {
+    if (SUCCEEDED(webView->preferences(&preferences))) {
         preferences->setPrivateBrowsingEnabled(FALSE);
         preferences->setJavaScriptCanOpenWindowsAutomatically(TRUE);
 
@@ -700,10 +700,10 @@ static void runTest(const char* pathOrURL)
 
     prevTestBFItem = 0;
     COMPtr<IWebView> webView;
-    if (SUCCEEDED(frame->webView(webView.adoptionPointer()))) {
+    if (SUCCEEDED(frame->webView(&webView))) {
         COMPtr<IWebBackForwardList> bfList;
-        if (SUCCEEDED(webView->backForwardList(bfList.adoptionPointer())))
-            bfList->currentItem(prevTestBFItem.adoptionPointer());
+        if (SUCCEEDED(webView->backForwardList(&bfList)))
+            bfList->currentItem(&prevTestBFItem);
     }
 
     WorkQueue::shared()->clear();
@@ -936,7 +936,7 @@ IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow)
         return 0;
 
     COMPtr<IWebViewPrivate> viewPrivate;
-    if (FAILED(webView->QueryInterface(viewPrivate.adoptionPointer())))
+    if (FAILED(webView->QueryInterface(&viewPrivate)))
         return 0;
 
     viewPrivate->setShouldApplyMacFontAscentHack(TRUE);
@@ -968,7 +968,7 @@ IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow)
         return 0;
 
     COMPtr<IWebViewEditing> viewEditing;
-    if (FAILED(webView->QueryInterface(viewEditing.adoptionPointer())))
+    if (FAILED(webView->QueryInterface(&viewEditing)))
         return 0;
 
     if (FAILED(viewEditing->setEditingDelegate(sharedEditingDelegate.get())))
@@ -978,7 +978,7 @@ IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow)
         return 0;
 
     COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(preferences.adoptionPointer())))
+    if (FAILED(webView->preferences(&preferences)))
         return 0;
 
     initializePreferences(preferences.get());
@@ -1032,7 +1032,7 @@ int main(int argc, char* argv[])
     COMPtr<IWebIconDatabase> tmpIconDatabase;
     if (FAILED(CoCreateInstance(CLSID_WebIconDatabase, 0, CLSCTX_ALL, IID_IWebIconDatabase, (void**)&tmpIconDatabase)))
         return -1;
-    if (FAILED(tmpIconDatabase->sharedIconDatabase(iconDatabase.adoptionPointer())))
+    if (FAILED(tmpIconDatabase->sharedIconDatabase(&iconDatabase)))
         return -1;
         
     if (FAILED(webView->mainFrame(&frame)))
index 52d4d90..7add64e 100644 (file)
@@ -86,7 +86,7 @@ static wstring dumpPath(IDOMNode* node)
     SysFreeString(name);
 
     COMPtr<IDOMNode> parent;
-    if (SUCCEEDED(node->parentNode(parent.adoptionPointer())))
+    if (SUCCEEDED(node->parentNode(&parent)))
         result += TEXT(" > ") + dumpPath(parent.get());
 
     return result;
@@ -105,11 +105,11 @@ static wstring dump(IDOMRange* range)
         return 0;
 
     COMPtr<IDOMNode> startContainer;
-    if (FAILED(range->startContainer(startContainer.adoptionPointer())))
+    if (FAILED(range->startContainer(&startContainer)))
         return 0;
 
     COMPtr<IDOMNode> endContainer;
-    if (FAILED(range->endContainer(endContainer.adoptionPointer())))
+    if (FAILED(range->endContainer(&endContainer)))
         return 0;
 
     wchar_t buffer[1024];
index caee293..15539cc 100644 (file)
@@ -130,7 +130,7 @@ static LRESULT dispatchMessage(const MSG* msg)
 static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     COMPtr<IWebFramePrivate> framePrivate;
-    if (SUCCEEDED(frame->QueryInterface(framePrivate.adoptionPointer())))
+    if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
         framePrivate->layout();
 
     down = true;
@@ -146,7 +146,7 @@ static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef functio
 static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     COMPtr<IWebFramePrivate> framePrivate;
-    if (SUCCEEDED(frame->QueryInterface(framePrivate.adoptionPointer())))
+    if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
         framePrivate->layout();
 
     down = true;
@@ -173,7 +173,7 @@ static inline POINTL pointl(const POINT& point)
 static void doMouseUp(MSG msg)
 {
     COMPtr<IWebFramePrivate> framePrivate;
-    if (SUCCEEDED(frame->QueryInterface(framePrivate.adoptionPointer())))
+    if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
         framePrivate->layout();
 
     dispatchMessage(&msg);
@@ -182,7 +182,7 @@ static void doMouseUp(MSG msg)
     if (draggingInfo) {
         COMPtr<IWebView> webView;
         COMPtr<IDropTarget> webViewDropTarget;
-        if (SUCCEEDED(frame->webView(webView.adoptionPointer())) && SUCCEEDED(webView->QueryInterface(IID_IDropTarget, (void**)&webViewDropTarget))) {
+        if (SUCCEEDED(frame->webView(&webView)) && SUCCEEDED(webView->QueryInterface(IID_IDropTarget, (void**)&webViewDropTarget))) {
             POINT screenPoint = msg.pt;
             DWORD effect = 0;
             ::ClientToScreen(webViewWindow, &screenPoint);
@@ -220,7 +220,7 @@ static JSValueRef mouseUpCallback(JSContextRef context, JSObjectRef function, JS
 static void doMouseMove(MSG msg)
 {
     COMPtr<IWebFramePrivate> framePrivate;
-    if (SUCCEEDED(frame->QueryInterface(framePrivate.adoptionPointer())))
+    if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
         framePrivate->layout();
 
     dispatchMessage(&msg);
@@ -348,7 +348,7 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
     static const JSStringRef lengthProperty = JSStringCreateWithUTF8CString("length");
 
     COMPtr<IWebFramePrivate> framePrivate;
-    if (SUCCEEDED(frame->QueryInterface(framePrivate.adoptionPointer())))
+    if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
         framePrivate->layout();
     
     JSStringRef character = JSValueToStringCopy(context, arguments[0], exception);
@@ -448,7 +448,7 @@ static JSValueRef dispatchMessageCallback(JSContextRef context, JSObjectRef func
         return JSValueMakeUndefined(context);
 
     COMPtr<IWebFramePrivate> framePrivate;
-    if (SUCCEEDED(frame->QueryInterface(framePrivate.adoptionPointer())))
+    if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
         framePrivate->layout();
     
     MSG msg = {};
@@ -481,7 +481,7 @@ static JSValueRef dispatchMessageCallback(JSContextRef context, JSObjectRef func
 static JSValueRef textZoomInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return JSValueMakeUndefined(context);
 
     COMPtr<IWebIBActions> webIBActions(Query, webView);
@@ -495,7 +495,7 @@ static JSValueRef textZoomInCallback(JSContextRef context, JSObjectRef function,
 static JSValueRef textZoomOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return JSValueMakeUndefined(context);
 
     COMPtr<IWebIBActions> webIBActions(Query, webView);
@@ -509,7 +509,7 @@ static JSValueRef textZoomOutCallback(JSContextRef context, JSObjectRef function
 static JSValueRef zoomPageInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return JSValueMakeUndefined(context);
 
     COMPtr<IWebIBActions> webIBActions(Query, webView);
@@ -523,7 +523,7 @@ static JSValueRef zoomPageInCallback(JSContextRef context, JSObjectRef function,
 static JSValueRef zoomPageOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return JSValueMakeUndefined(context);
 
     COMPtr<IWebIBActions> webIBActions(Query, webView);
index 1a63be1..b21d34e 100644 (file)
@@ -60,11 +60,11 @@ string BSTRtoString(BSTR bstr)
 string descriptionSuitableForTestResult(IWebFrame* webFrame)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(webFrame->webView(webView.adoptionPointer())))
+    if (FAILED(webFrame->webView(&webView)))
         return string();
 
     COMPtr<IWebFrame> mainFrame;
-    if (FAILED(webView->mainFrame(mainFrame.adoptionPointer())))
+    if (FAILED(webView->mainFrame(&mainFrame)))
         return string();
 
     if (webFrame == mainFrame)
@@ -156,7 +156,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didCommitLoadForFrame(
     /* [in] */ IWebFrame *frame)
 {
     COMPtr<IWebViewPrivate> webViewPrivate;
-    HRESULT hr = webView->QueryInterface(webViewPrivate.adoptionPointer());
+    HRESULT hr = webView->QueryInterface(&webViewPrivate);
     if (FAILED(hr))
         return hr;
     webViewPrivate->updateFocusedAndActiveState();
index 39b55f7..373091b 100644 (file)
@@ -55,20 +55,20 @@ static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath);
 LayoutTestController::~LayoutTestController()
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     // reset webview-related states back to default values in preparation for next test
 
     COMPtr<IWebViewPrivate> viewPrivate;
-    if (SUCCEEDED(webView->QueryInterface(viewPrivate.adoptionPointer())))
+    if (SUCCEEDED(webView->QueryInterface(&viewPrivate)))
         viewPrivate->setTabKeyCyclesThroughElements(TRUE);
 
     COMPtr<IWebViewEditing> viewEditing;
-    if (FAILED(webView->QueryInterface(viewEditing.adoptionPointer())))
+    if (FAILED(webView->QueryInterface(&viewEditing)))
         return;
     COMPtr<IWebEditingDelegate> delegate;
-    if (FAILED(viewEditing->editingDelegate(delegate.adoptionPointer())))
+    if (FAILED(viewEditing->editingDelegate(&delegate)))
         return;
     COMPtr<EditingDelegate> editingDelegate(Query, viewEditing.get());
     if (editingDelegate)
@@ -83,15 +83,15 @@ void LayoutTestController::addDisallowedURL(JSStringRef url)
 void LayoutTestController::clearBackForwardList()
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebBackForwardList> backForwardList;
-    if (FAILED(webView->backForwardList(backForwardList.adoptionPointer())))
+    if (FAILED(webView->backForwardList(&backForwardList)))
         return;
 
     COMPtr<IWebHistoryItem> item;
-    if (FAILED(backForwardList->currentItem(item.adoptionPointer())))
+    if (FAILED(backForwardList->currentItem(&item)))
         return;
 
     // We clear the history by setting the back/forward list's capacity to 0
@@ -182,11 +182,11 @@ static wstring jsStringRefToWString(JSStringRef jsStr)
 void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
 {
     COMPtr<IWebDataSource> dataSource;
-    if (FAILED(frame->dataSource(dataSource.adoptionPointer())))
+    if (FAILED(frame->dataSource(&dataSource)))
         return;
 
     COMPtr<IWebURLResponse> response;
-    if (FAILED(dataSource->response(response.adoptionPointer())) || !response)
+    if (FAILED(dataSource->response(&response)) || !response)
         return;
 
     BSTR responseURLBSTR;
@@ -220,15 +220,15 @@ void LayoutTestController::queueScript(JSStringRef script)
 void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebViewEditing> viewEditing;
-    if (FAILED(webView->QueryInterface(viewEditing.adoptionPointer())))
+    if (FAILED(webView->QueryInterface(&viewEditing)))
         return;
 
     COMPtr<IWebEditingDelegate> delegate;
-    if (FAILED(viewEditing->editingDelegate(delegate.adoptionPointer())))
+    if (FAILED(viewEditing->editingDelegate(&delegate)))
         return;
 
     EditingDelegate* editingDelegate = (EditingDelegate*)(IWebEditingDelegate*)delegate.get();
@@ -238,11 +238,11 @@ void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
 void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(preferences.adoptionPointer())))
+    if (FAILED(webView->preferences(&preferences)))
         return;
 
     COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
@@ -255,7 +255,7 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
 void LayoutTestController::setCustomPolicyDelegate(bool setDelegate)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     if (setDelegate)
@@ -272,11 +272,11 @@ void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
 void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(preferences.adoptionPointer())))
+    if (FAILED(webView->preferences(&preferences)))
         return;
 
     preferences->setPrivateBrowsingEnabled(privateBrowsingEnabled);
@@ -285,11 +285,11 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled
 void LayoutTestController::setPopupBlockingEnabled(bool privateBrowsingEnabled)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(preferences.adoptionPointer())))
+    if (FAILED(webView->preferences(&preferences)))
         return;
 
     preferences->setJavaScriptCanOpenWindowsAutomatically(!privateBrowsingEnabled);
@@ -298,11 +298,11 @@ void LayoutTestController::setPopupBlockingEnabled(bool privateBrowsingEnabled)
 void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebViewPrivate> viewPrivate;
-    if (FAILED(webView->QueryInterface(viewPrivate.adoptionPointer())))
+    if (FAILED(webView->QueryInterface(&viewPrivate)))
         return;
 
     viewPrivate->setTabKeyCyclesThroughElements(shouldCycle ? TRUE : FALSE);
@@ -316,11 +316,11 @@ void LayoutTestController::setUseDashboardCompatibilityMode(bool flag)
 void LayoutTestController::setUserStyleSheetEnabled(bool flag)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(preferences.adoptionPointer())))
+    if (FAILED(webView->preferences(&preferences)))
         return;
 
    preferences->setUserStyleSheetEnabled(flag);
@@ -437,11 +437,11 @@ static wstring cfStringRefToWString(CFStringRef cfStr)
 void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(preferences.adoptionPointer())))
+    if (FAILED(webView->preferences(&preferences)))
         return;
 
     RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL));
@@ -492,11 +492,11 @@ void LayoutTestController::clearPersistentUserStyleSheet()
 void LayoutTestController::setWindowIsKey(bool flag)
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebViewPrivate> viewPrivate;
-    if (FAILED(webView->QueryInterface(viewPrivate.adoptionPointer())))
+    if (FAILED(webView->QueryInterface(&viewPrivate)))
         return;
 
     HWND webViewWindow;
@@ -537,11 +537,11 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
     wstring wValue = jsStringRefToWString(value);
 
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebViewPrivate> viewPrivate;
-    if (FAILED(webView->QueryInterface(viewPrivate.adoptionPointer())))
+    if (FAILED(webView->QueryInterface(&viewPrivate)))
         return;
 
     BSTR nameBSTR = SysAllocStringLen((OLECHAR*)wName.c_str(), wName.length());
index aed18d1..4113c9e 100644 (file)
@@ -58,7 +58,7 @@ void LoadItem::invoke() const
         targetFrame = frame;
     else {
         BSTR targetBSTR = SysAllocString(targetString.c_str());
-        bool failed = FAILED(frame->findFrameNamed(targetBSTR, targetFrame.adoptionPointer()));
+        bool failed = FAILED(frame->findFrameNamed(targetBSTR, &targetFrame));
         SysFreeString(targetBSTR);
         if (failed)
             return;
@@ -81,18 +81,18 @@ void LoadItem::invoke() const
 void ReloadItem::invoke() const
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     COMPtr<IWebIBActions> webActions;
-    if (SUCCEEDED(webView->QueryInterface(webActions.adoptionPointer())))
+    if (SUCCEEDED(webView->QueryInterface(&webActions)))
         webActions->reload(0);
 }
 
 void ScriptItem::invoke() const
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     wstring scriptString = jsStringRefToWString(script());
@@ -107,7 +107,7 @@ void ScriptItem::invoke() const
 void BackForwardItem::invoke() const
 {
     COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(webView.adoptionPointer())))
+    if (FAILED(frame->webView(&webView)))
         return;
 
     BOOL result;
@@ -122,11 +122,11 @@ void BackForwardItem::invoke() const
     }
     
     COMPtr<IWebBackForwardList> bfList;
-    if (FAILED(webView->backForwardList(bfList.adoptionPointer())))
+    if (FAILED(webView->backForwardList(&bfList)))
         return;
 
     COMPtr<IWebHistoryItem> item;
-    if (FAILED(bfList->itemAtIndex(m_howFar, item.adoptionPointer())))
+    if (FAILED(bfList->itemAtIndex(m_howFar, &item)))
         return;
 
     webView->goToBackForwardItem(item.get(), &result);