BUILD FIX: Use COM API on Windows in LayoutTestController::setIconDatabaseEna...
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2009 23:19:19 +0000 (23:19 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2009 23:19:19 +0000 (23:19 +0000)
        Rubber-stamped by Alice Liu.

        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
        (LayoutTestController::setIconDatabaseEnabled): Use COM API
        to get the shared WebIconDatabase.

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp

index e781046..219cd7f 100644 (file)
@@ -1,3 +1,13 @@
+2009-01-14  David Kilzer  <ddkilzer@apple.com>
+
+        BUILD FIX: Use COM API on Windows in LayoutTestController::setIconDatabaseEnabled()
+
+        Rubber-stamped by Alice Liu.
+
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::setIconDatabaseEnabled): Use COM API
+        to get the shared WebIconDatabase.
+
 2009-01-14  Jeremy Moskovich  <jeremy@chromium.org>
 
         Reviewed by Eric Seidel.
index 5b407b3..8059cbd 100644 (file)
@@ -268,16 +268,15 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permis
 
 void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
 {
-    // FIXME: Workaround <rdar://problem/6480108>
-    static WebIconDatabase* sharedWebIconDatabase = NULL;
-    if (!sharedWebIconDatabase) {
-        if (!iconDatabaseEnabled)
-            return;
-        sharedWebIconDatabase = WebIconDatabase::sharedWebIconDatabase();
-        if (sharedWebIconDatabase->isEnabled() == iconDatabaseEnabled)
-            return;
-    }
-    sharedWebIconDatabase->setEnabled(iconDatabaseEnabled);
+    // See also <rdar://problem/6480108>
+    COMPtr<IWebIconDatabase> iconDatabase;
+    COMPtr<IWebIconDatabase> tmpIconDatabase;
+    if (FAILED(CoCreateInstance(CLSID_WebIconDatabase, 0, CLSCTX_ALL, IID_IWebIconDatabase, (void**)&tmpIconDatabase)))
+        return;
+    if (FAILED(tmpIconDatabase->sharedIconDatabase(&iconDatabase)))
+        return;
+
+    iconDatabase->setEnabled(iconDatabaseEnabled);
 }
 
 void LayoutTestController::setMainFrameIsFirstResponder(bool flag)