WebCore:
Add wrappers around CoCreateInstance to COMPtr
I followed the example of the Query constructor and query method by
adding a Create constructor and create method.
Reviewed by Darin.
* platform/win/COMPtr.h:
(COMPtr::COMPtr): Added a new constructor that calls
CoCreateInstance.
(COMPtr::create): Added.
(COMPtr::createInstance): Added.
WebKitTools:
Fix <rdar://
5133816> keepWebHistory is not implemented
Fixes fast/history/clicked-link-is-visited.html.
Reviewed by Darin.
* DumpRenderTree/win/DumpRenderTree.cpp:
(runTest): Clear the optionalSharedHistory.
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::keepWebHistory): Set the optionalSharedHistory.
LayoutTests:
Remove a now-passing test from the Windows Skipped file
Reviewed by Darin.
* platform/win/Skipped:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27691
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-11 Adam Roben <aroben@apple.com>
+
+ Remove a now-passing test from the Windows Skipped file
+
+ Reviewed by Darin.
+
+ * platform/win/Skipped:
+
2007-11-10 Darin Adler <darin@apple.com>
* platform/win/fast/dom/Window/window-properties-expected.txt: Update for
# fast/frames/frame-src-attribute.html fails on boomer <rdar://problem/5134044>
fast/frames/frame-src-attribute.html
-# keepWebHistory is not implemented in DRT in boomer <rdar://problem/5133816>
-fast/history/clicked-link-is-visited.html
-
# fast/html/keygen.html is failing on boomer <rdar://problem/5133799>
fast/html/keygen.html
fast/invalid/residual-style.html
+2007-11-11 Adam Roben <aroben@apple.com>
+
+ Add wrappers around CoCreateInstance to COMPtr
+
+ I followed the example of the Query constructor and query method by
+ adding a Create constructor and create method.
+
+ Reviewed by Darin.
+
+ * platform/win/COMPtr.h:
+ (COMPtr::COMPtr): Added a new constructor that calls
+ CoCreateInstance.
+ (COMPtr::create): Added.
+ (COMPtr::createInstance): Added.
+
2007-11-11 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Darin.
enum AdoptCOMTag { AdoptCOM };
enum QueryTag { Query };
+enum CreateTag { Create };
template <typename T> class COMPtr {
public:
inline COMPtr(QueryTag, IUnknown* ptr) : m_ptr(copyQueryInterfaceRef(ptr)) { }
template <typename U> inline COMPtr(QueryTag, const COMPtr<U>& ptr) : m_ptr(copyQueryInterfaceRef(ptr.get())) { }
+ inline COMPtr(CreateTag, const IID& clsid) : m_ptr(createInstance(clsid)) { }
+
~COMPtr() { if (m_ptr) m_ptr->Release(); }
T* get() const { return m_ptr; }
COMPtr& operator=(const COMPtr&);
COMPtr& operator=(T*);
template <typename U> COMPtr& operator=(const COMPtr<U>&);
-
+
void query(IUnknown* ptr) { adoptRef(copyQueryInterfaceRef(ptr)); }
template <typename U> inline void query(const COMPtr<U>& ptr) { query(ptr.get()); }
+ void create(const IID& clsid) { adoptRef(createInstance(clsid)); }
+
template <typename U> HRESULT copyRefTo(U**);
void adoptRef(T*);
private:
static T* copyQueryInterfaceRef(IUnknown*);
+ static T* createInstance(const IID& clsid);
T* m_ptr;
};
+template <typename T> inline T* COMPtr<T>::createInstance(const IID& clsid)
+{
+ T* result;
+ if (FAILED(CoCreateInstance(clsid, 0, CLSCTX_ALL, __uuidof(result), reinterpret_cast<void**>(&result))))
+ return 0;
+ return result;
+}
+
template <typename T> inline T* COMPtr<T>::copyQueryInterfaceRef(IUnknown* ptr)
{
if (!ptr)
+2007-11-11 Adam Roben <aroben@apple.com>
+
+ Fix <rdar://5133816> keepWebHistory is not implemented
+
+ Fixes fast/history/clicked-link-is-visited.html.
+
+ Reviewed by Darin.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (runTest): Clear the optionalSharedHistory.
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::keepWebHistory): Set the optionalSharedHistory.
+
2007-11-10 Sam Weinig <sam@webkit.org>
Reviewed by Tim Hatcher.
topLoadingFrame = 0;
timedOut = false;
+ COMPtr<IWebHistory> history(Create, CLSID_WebHistory);
+ if (history)
+ history->setOptionalSharedHistory(0);
+
prevTestBFItem = 0;
COMPtr<IWebView> webView;
if (SUCCEEDED(frame->webView(&webView))) {
#include <JavaScriptCore/Assertions.h>
#include <JavaScriptCore/JavaScriptCore.h>
#include <JavaScriptCore/JSRetainPtr.h>
+#include <WebKit/IWebHistory.h>
#include <WebKit/IWebViewPrivate.h>
+#include <WebKit/WebKit.h>
#include <string>
#include <CoreFoundation/CoreFoundation.h>
void LayoutTestController::keepWebHistory()
{
- // FIXME: Implement!
+ COMPtr<IWebHistory> history(Create, CLSID_WebHistory);
+ if (!history)
+ return;
+
+ COMPtr<IWebHistory> sharedHistory(Create, CLSID_WebHistory);
+ if (!sharedHistory)
+ return;
+
+ history->setOptionalSharedHistory(sharedHistory.get());
}
void LayoutTestController::notifyDone()