JavaScriptCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jun 2008 03:41:32 +0000 (03:41 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jun 2008 03:41:32 +0000 (03:41 +0000)
2008-06-14  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - more of https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * kjs/nodes.cpp:
        (KJS::ParserRefCounted::hasOneRef): Added. Replaces refcount.
        * kjs/nodes.h: Replaced refcount with hasOneRef.

        * wtf/ListRefPtr.h:
        (WTF::ListRefPtr::~ListRefPtr): Changed to use hasOneRef instead of
        refcount, so this class can be used with the RefCounted template.

        * wtf/RefCounted.h:
        (WTF::RefCounted::hasOneRef): Made const, since there's no reason for
        it to be non-const.

WebCore:

2008-06-14  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - more work on https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * WebCore.base.exp: Added some new exports needed for functions that are now
        non-virtual.

        * WebCore.xcodeproj/project.pbxproj: Moved the "icon" group to the correct
        location in the project. Before it was inside "appcache"!

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::applyProperty):
        * dom/Clipboard.cpp:
        (WebCore::Clipboard::Clipboard):
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::newGeneralClipboard):
        * editing/qt/EditorQt.cpp:
        (WebCore::Editor::newGeneralClipboard):
        * editing/wx/EditorWx.cpp:
        (WebCore::Editor::newGeneralClipboard):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::DocumentLoader):
        * loader/DocumentLoader.h:
        (WebCore::DocumentLoader::create):
        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::defaultIcon):
        (WebCore::IconDatabase::setIconDataForIconURL):
        (WebCore::IconDatabase::setIconURLForPageURL):
        (WebCore::IconDatabase::getOrCreateIconRecord):
        (WebCore::IconDatabase::performURLImport):
        * loader/icon/IconDatabase.h:
        * loader/icon/IconRecord.cpp:
        (WebCore::IconRecord::IconRecord):
        * loader/icon/IconRecord.h:
        (WebCore::IconRecord::create):
        * page/EventHandler.h:
        * page/Frame.cpp:
        (WebCore::Frame::Frame):
        * page/Frame.h:
        (WebCore::Frame::create):
        * page/gtk/EventHandlerGtk.cpp:
        (WebCore::EventHandler::createDraggingClipboard):
        * page/mac/EventHandlerMac.mm:
        (WebCore::EventHandler::createDraggingClipboard):
        * page/qt/EventHandlerQt.cpp:
        (WebCore::EventHandler::createDraggingClipboard):
        * page/win/EventHandlerWin.cpp:
        (WebCore::EventHandler::createDraggingClipboard):
        * page/wx/EventHandlerWx.cpp:
        (WebCore::EventHandler::createDraggingClipboard):
        * platform/Cursor.h:
        (WebCore::SharedCursor::create):
        (WebCore::SharedCursor::~SharedCursor):
        (WebCore::SharedCursor::SharedCursor):
        * platform/DragData.h:
        * platform/PopupMenu.h:
        (WebCore::PopupMenu::create):
        (WebCore::PopupMenu::isActive):
        * platform/ScrollBar.cpp:
        (WebCore::Scrollbar::Scrollbar):
        * platform/SearchPopupMenu.h:
        (WebCore::SearchPopupMenu::create):
        * platform/graphics/FontFamily.cpp:
        (WebCore::FontFamily::FontFamily):
        (WebCore::operator==):
        * platform/graphics/FontFamily.h:
        (WebCore::FontFamily::FontFamily):
        (WebCore::SharedFontFamily::create):
        (WebCore::SharedFontFamily::SharedFontFamily):
        (WebCore::operator!=):
        (WebCore::FontFamily::next):
        (WebCore::FontFamily::appendFamily):
        (WebCore::FontFamily::releaseNext):
        * platform/graphics/Icon.h:
        * platform/graphics/gtk/IconGtk.cpp:
        (WebCore::Icon::Icon):
        (WebCore::Icon::~Icon):
        (WebCore::Icon::newIconForFile):
        * platform/graphics/mac/IconMac.mm:
        (WebCore::Icon::Icon):
        (WebCore::Icon::newIconForFile):
        * platform/graphics/qt/IconQt.cpp:
        (WebCore::Icon::Icon):
        (WebCore::Icon::newIconForFile):
        * platform/graphics/win/IconWin.cpp:
        (WebCore::Icon::Icon):
        (WebCore::Icon::~Icon):
        (WebCore::Icon::newIconForFile):
        * platform/gtk/ClipboardGtk.cpp:
        (WebCore::Editor::newGeneralClipboard):
        * platform/gtk/ClipboardGtk.h:
        (WebCore::ClipboardGtk::create):
        * platform/gtk/PlatformScrollBar.h:
        (WebCore::PlatformScrollbar::create):
        * platform/gtk/PopupMenuGtk.cpp:
        (WebCore::PopupMenu::PopupMenu):
        * platform/gtk/ScrollViewGtk.cpp:
        (WebCore::ScrollViewScrollbar::create):
        (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
        (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
        * platform/mac/ClipboardMac.h:
        (WebCore::ClipboardMac::create):
        * platform/mac/DragDataMac.mm:
        (WebCore::DragData::createClipboard):
        (WebCore::DragData::containsCompatibleContent):
        * platform/mac/PlatformScrollBar.h:
        (WebCore::PlatformScrollbar::create):
        (WebCore::PlatformScrollbar::horizontalScrollbarHeight):
        (WebCore::PlatformScrollbar::verticalScrollbarWidth):
        * platform/mac/PopupMenuMac.mm:
        (WebCore::PopupMenu::PopupMenu):
        * platform/qt/ClipboardQt.h:
        (WebCore::ClipboardQt::create):
        * platform/qt/DragDataQt.cpp:
        (WebCore::DragData::createClipboard):
        * platform/qt/PlatformScrollBar.h:
        (WebCore::PlatformScrollbar::create):
        * platform/qt/PopupMenuQt.cpp:
        (WebCore::PopupMenu::PopupMenu):
        * platform/qt/ScrollViewQt.cpp:
        (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
        (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
        * platform/win/ClipboardWin.h:
        (WebCore::ClipboardWin::create):
        * platform/win/CursorWin.cpp:
        (WebCore::Cursor::Cursor):
        (WebCore::loadSharedCursor):
        * platform/win/DragDataWin.cpp:
        (WebCore::DragData::createClipboard):
        * platform/win/EditorWin.cpp:
        (WebCore::Editor::newGeneralClipboard):
        * platform/win/PlatformScrollBar.h:
        (WebCore::PlatformScrollbar::create):
        * platform/win/PopupMenuWin.cpp:
        (WebCore::PopupMenu::PopupMenu):
        (WebCore::PopupMenu::show):
        * platform/win/ScrollViewWin.cpp:
        (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
        (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
        * platform/wx/ClipboardWx.h:
        (WebCore::ClipboardWx::create):
        * platform/wx/PlatformScrollBar.h:
        (WebCore::PlatformScrollbar::create):
        * platform/wx/PopupMenuWx.cpp:
        (WebCore::PopupMenu::PopupMenu):
        * platform/wx/TemporaryLinkStubs.cpp:
        (Icon::Icon):
        (Icon::newIconForFile):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::createScrollbar):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::updateFromElement):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::dataChanged):
        * svg/graphics/SVGImageEmptyClients.h:
        (WebCore::SVGEmptyFrameLoaderClient::createDocumentLoader):

WebKit/gtk:

2008-06-14  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - more https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * WebCoreSupport/FrameLoaderClientGtk.cpp:
        (WebKit::FrameLoaderClient::createDocumentLoader): Use create instead of new.
        * webkit/webkitwebframe.cpp:
        (webkit_web_frame_new): Ditto.
        (webkit_web_frame_init_with_web_view): Ditto.

WebKit/mac:

2008-06-14  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - more of https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::createDocumentLoader): Use create instead of new.
        (WebFrameLoaderClient::createFrame): Remove now-obsolete adoptRef that was balanced by
        a ref call inside the Frame constructor. The lifetime rules for Frame are now the
        conventional ones without a special case.

        * WebView/WebDataSource.mm:
        (-[WebDataSource _initWithDocumentLoader:]): Changed argument to be a PassRefPtr, since
        this function takes ownership of the DocumentLoader.
        (-[WebDataSource initWithRequest:]): Use create instead of new.
        * WebView/WebDataSourceInternal.h: Changed _initWithDocumentLoader argument to be a
        PassRefPtr and also cleaned up the header a bit.

        * WebView/WebDocumentLoaderMac.h:
        (WebDocumentLoaderMac::create): Added. Also made the constructor and a couple of virtual
        functions private.

        * WebView/WebFrame.mm:
        (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): Use create instead
        of new.

WebKit/qt:

2008-06-14  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - more https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * Api/qwebframe.cpp:
        (QWebFramePrivate::init): Use create instead of new.
        * WebCoreSupport/FrameLoaderClientQt.cpp:
        (WebCore::FrameLoaderClientQt::createDocumentLoader): Ditto.

WebKit/win:

2008-06-14  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - more of https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebFrameLoaderClient::createFrame): Remove now-obsolete adoptRef that was balanced by
        a ref call inside the Frame constructor. The lifetime rules for Frame are now the
        conventional ones without a special case.

        * WebFrame.cpp:
        (WebFrame::init): Renamed function from initWithWebFrameView and removed the unused
        IWebFrameView argument (every caller was passing 0). Also changed this to return the
        WebCore Frame object, which is needed to straighten out the lifetime and ownership
        issues.
        * WebFrame.h: Ditto.

        * WebView.cpp:
        (WebView::initWithFrame): Changed to call new init function and use the return value.

WebKit/wx:

2008-06-14  Darin Adler  <darin@apple.com>

        Reviewed by Sam.

        - more https://bugs.webkit.org/show_bug.cgi?id=17257
          start ref counts at 1 instead of 0 for speed

        * WebKitSupport/FrameLoaderClientWx.cpp:
        (WebCore::FrameLoaderClientWx::createDocumentLoader): Use create function
        instead of new.

LayoutTests:

2008-06-14  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - test for https://bugs.webkit.org/show_bug.cgi?id=19538
          <rdar://problem/5957595> Reading transition property from the style JS gives the wrong value

        * fast/dom/CSSStyleDeclaration/resources/transition-property-names.js: Added.
        * fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt: Added.
        * fast/dom/CSSStyleDeclaration/transition-property-names.html: Added.

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

88 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/nodes.h
JavaScriptCore/wtf/ListRefPtr.h
JavaScriptCore/wtf/RefCounted.h
LayoutTests/ChangeLog
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/css/CSSStyleSelector.cpp
WebCore/dom/Clipboard.cpp
WebCore/editing/mac/EditorMac.mm
WebCore/editing/qt/EditorQt.cpp
WebCore/editing/wx/EditorWx.cpp
WebCore/loader/DocumentLoader.cpp
WebCore/loader/DocumentLoader.h
WebCore/loader/icon/IconDatabase.cpp
WebCore/loader/icon/IconDatabase.h
WebCore/loader/icon/IconRecord.cpp
WebCore/loader/icon/IconRecord.h
WebCore/page/EventHandler.h
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/gtk/EventHandlerGtk.cpp
WebCore/page/mac/EventHandlerMac.mm
WebCore/page/qt/EventHandlerQt.cpp
WebCore/page/win/EventHandlerWin.cpp
WebCore/page/wx/EventHandlerWx.cpp
WebCore/platform/Cursor.h
WebCore/platform/DragData.h
WebCore/platform/PopupMenu.h
WebCore/platform/ScrollBar.cpp
WebCore/platform/SearchPopupMenu.h
WebCore/platform/graphics/FontFamily.cpp
WebCore/platform/graphics/FontFamily.h
WebCore/platform/graphics/Icon.h
WebCore/platform/graphics/gtk/IconGtk.cpp
WebCore/platform/graphics/mac/IconMac.mm
WebCore/platform/graphics/qt/IconQt.cpp
WebCore/platform/graphics/win/IconWin.cpp
WebCore/platform/gtk/ClipboardGtk.cpp
WebCore/platform/gtk/ClipboardGtk.h
WebCore/platform/gtk/PlatformScrollBar.h
WebCore/platform/gtk/PopupMenuGtk.cpp
WebCore/platform/gtk/ScrollViewGtk.cpp
WebCore/platform/mac/ClipboardMac.h
WebCore/platform/mac/DragDataMac.mm
WebCore/platform/mac/PlatformScrollBar.h
WebCore/platform/mac/PopupMenuMac.mm
WebCore/platform/qt/ClipboardQt.h
WebCore/platform/qt/DragDataQt.cpp
WebCore/platform/qt/PlatformScrollBar.h
WebCore/platform/qt/PopupMenuQt.cpp
WebCore/platform/qt/ScrollViewQt.cpp
WebCore/platform/win/ClipboardWin.h
WebCore/platform/win/CursorWin.cpp
WebCore/platform/win/DragDataWin.cpp
WebCore/platform/win/EditorWin.cpp
WebCore/platform/win/PlatformScrollBar.h
WebCore/platform/win/PopupMenuWin.cpp
WebCore/platform/win/ScrollViewWin.cpp
WebCore/platform/wx/ClipboardWx.h
WebCore/platform/wx/PlatformScrollBar.h
WebCore/platform/wx/PopupMenuWx.cpp
WebCore/platform/wx/TemporaryLinkStubs.cpp
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderListBox.cpp
WebCore/svg/graphics/SVGImage.cpp
WebCore/svg/graphics/SVGImageEmptyClients.h
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
WebKit/gtk/webkit/webkitwebframe.cpp
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/mac/WebView/WebDataSource.mm
WebKit/mac/WebView/WebDataSourceInternal.h
WebKit/mac/WebView/WebDocumentLoaderMac.h
WebKit/mac/WebView/WebFrame.mm
WebKit/qt/Api/qwebframe.cpp
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
WebKit/win/ChangeLog
WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
WebKit/win/WebFrame.cpp
WebKit/win/WebFrame.h
WebKit/win/WebView.cpp
WebKit/wx/ChangeLog
WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp

index e6475ba903a52b35735c41a7e618a4d0da9f823e..5eb542fda8bd30d1d1047e2f02888243973ef1cf 100644 (file)
@@ -1,3 +1,22 @@
+2008-06-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam.
+
+        - more of https://bugs.webkit.org/show_bug.cgi?id=17257
+          start ref counts at 1 instead of 0 for speed
+
+        * kjs/nodes.cpp:
+        (KJS::ParserRefCounted::hasOneRef): Added. Replaces refcount.
+        * kjs/nodes.h: Replaced refcount with hasOneRef.
+
+        * wtf/ListRefPtr.h:
+        (WTF::ListRefPtr::~ListRefPtr): Changed to use hasOneRef instead of
+        refcount, so this class can be used with the RefCounted template.
+
+        * wtf/RefCounted.h:
+        (WTF::RefCounted::hasOneRef): Made const, since there's no reason for
+        it to be non-const.
+
 2008-06-14  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Oliver.
 
 2008-05-21  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by NOBODY (Build fix).
-
         Yet more windows build fixes
 
         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
 
 2008-05-21  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by NOBODY (Build fix).
-
         Yet more windows build fixes
 
         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
 
 2008-05-21  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by NOBODY (Build fix).
-
         Add DebuggerCallFrame.{h,cpp} to the project file
 
         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
 
 2008-05-20  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by NOBODY (Build fix).
-
         Fixerate the windows build.
 
         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
 
 2008-05-09  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by Nobody (build fix).
-
         Debug build fix
 
         * kjs/JSGlobalObject.cpp:
 
 2008-04-21  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by NOBODY(Build fix)
-
         Fix debug build
 
         * kjs/nodes.cpp:
 
 2008-03-24  Geoffrey Garen  <ggaren@apple.com>
 
-        Reviewed by NOBODY.
-        
         SquirrelFish lives.
         
         Initial check-in of the code I've been carrying around. Lots of stuff
 
 2007-12-04  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by NOBODY (Build fix).
-
         Fix gtk build.
 
         * wtf/TCSystemAlloc.cpp:
index 950e99d4f57ba05e27312cef87aab87b43001eae..d8290117ab3534420283abd0c27002be40e990c3 100644 (file)
@@ -160,19 +160,19 @@ void ParserRefCounted::deref()
         trackedObjectExtraRefCounts->remove(it);
 }
 
-unsigned ParserRefCounted::refcount()
+bool ParserRefCounted::hasOneRef()
 {
     if (newTrackedObjects && newTrackedObjects->contains(this)) {
         ASSERT(!trackedObjectExtraRefCounts || !trackedObjectExtraRefCounts->contains(this));
-        return 0;
+        return false;
     }
 
     ASSERT(!newTrackedObjects || !newTrackedObjects->contains(this));
 
     if (!trackedObjectExtraRefCounts)
-        return 1;
+        return true;
 
-    return 1 + trackedObjectExtraRefCounts->count(this);
+    return !trackedObjectExtraRefCounts->contains(this);
 }
 
 void ParserRefCounted::deleteNewObjects()
index 424a1a40db87c4f0ff269fe47b85d7d4424531e8..82c51206bdd62f7c451abdd84c221d4b35b857f7 100644 (file)
@@ -125,7 +125,7 @@ namespace KJS {
     public:
         void ref() KJS_FAST_CALL;
         void deref() KJS_FAST_CALL;
-        unsigned refcount() KJS_FAST_CALL;
+        bool hasOneRef() KJS_FAST_CALL;
 
         static void deleteNewObjects() KJS_FAST_CALL;
 
index 0f807b0550ae5cc29b030cc0826621c99d8dcf1b..910ac24cb78aa23f4db8e9207aa82f16f4b78407 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: c++; c-basic-offset: 4 -*-
 /*
- *  Copyright (C) 2005, 2006 Apple Computer, Inc.
+ *  Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Library General Public
@@ -36,9 +36,10 @@ namespace WTF {
         // see comment in PassRefPtr.h for why this takes const reference
         template <typename U> ListRefPtr(const PassRefPtr<U>& o) : RefPtr<T>(o) {}
 
-        ~ListRefPtr() {
+        ~ListRefPtr()
+        {
             RefPtr<T> reaper = this->release();
-            while (reaper && reaper->refcount() == 1)
+            while (reaper && reaper->hasOneRef())
                 reaper = reaper->releaseNext(); // implicitly protects reaper->next, then derefs reaper
         }
         
index 8f05b0fb58564c4749b94e569c59bdd48a22b873..0286575eddae02fe4f99e76a491759866bea3bd0 100644 (file)
@@ -55,7 +55,7 @@ public:
             --m_refCount;
     }
 
-    bool hasOneRef()
+    bool hasOneRef() const
     {
         ASSERT(!m_deletionHasBegun);
         return m_refCount == 1;
index 8386c56430160effc32c6d884f1c21f18c76c5a5..c5a6c9a41b3521ee1711ad7e41b17d9925075fc4 100644 (file)
@@ -1,3 +1,14 @@
+2008-06-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - test for https://bugs.webkit.org/show_bug.cgi?id=19538
+          <rdar://problem/5957595> Reading transition property from the style JS gives the wrong value
+
+        * fast/dom/CSSStyleDeclaration/resources/transition-property-names.js: Added.
+        * fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt: Added.
+        * fast/dom/CSSStyleDeclaration/transition-property-names.html: Added.
+
 2008-06-14  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Dan Bernstein.
         * fast/dynamic/insertAdjacentText.html: Copied from fast/dynamic/insertAdjacentElement.html.
         * platform/mac/fast/dynamic/insertAdjacentElement-expected.txt:
 
-2008-06-14  Darin Adler  <darin@apple.com>
-
-        Reviewed by Maciej.
-
-        - test for https://bugs.webkit.org/show_bug.cgi?id=19538
-          <rdar://problem/5957595> Reading transition property from the style JS gives the wrong value
-
-        * fast/dom/CSSStyleDeclaration/resources/transition-property-names.js: Added.
-        * fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt: Added.
-        * fast/dom/CSSStyleDeclaration/transition-property-names.html: Added.
-
 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
 
         Reviewed by Oliver.
@@ -5293,8 +5293,6 @@ r2008-04-23  Dan Bernstein  <mitz@apple.com>
 
 2008-04-03  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by NOBODY (Rollout).
-
         Rollout layout test changes for r31566
 
 2008-04-03  Brady Eidson  <beidson@apple.com>
index a603b8d85375acd6489b69f7007a9a75e1527364..f18bc98c03760c8dabd0c76434dd324b315fd2a3 100644 (file)
@@ -1,3 +1,163 @@
+2008-06-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam.
+
+        - more work on https://bugs.webkit.org/show_bug.cgi?id=17257
+          start ref counts at 1 instead of 0 for speed
+
+        * WebCore.base.exp: Added some new exports needed for functions that are now
+        non-virtual.
+
+        * WebCore.xcodeproj/project.pbxproj: Moved the "icon" group to the correct
+        location in the project. Before it was inside "appcache"!
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty):
+        * dom/Clipboard.cpp:
+        (WebCore::Clipboard::Clipboard):
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::newGeneralClipboard):
+        * editing/qt/EditorQt.cpp:
+        (WebCore::Editor::newGeneralClipboard):
+        * editing/wx/EditorWx.cpp:
+        (WebCore::Editor::newGeneralClipboard):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::DocumentLoader):
+        * loader/DocumentLoader.h:
+        (WebCore::DocumentLoader::create):
+        * loader/icon/IconDatabase.cpp:
+        (WebCore::IconDatabase::defaultIcon):
+        (WebCore::IconDatabase::setIconDataForIconURL):
+        (WebCore::IconDatabase::setIconURLForPageURL):
+        (WebCore::IconDatabase::getOrCreateIconRecord):
+        (WebCore::IconDatabase::performURLImport):
+        * loader/icon/IconDatabase.h:
+        * loader/icon/IconRecord.cpp:
+        (WebCore::IconRecord::IconRecord):
+        * loader/icon/IconRecord.h:
+        (WebCore::IconRecord::create):
+        * page/EventHandler.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        * page/Frame.h:
+        (WebCore::Frame::create):
+        * page/gtk/EventHandlerGtk.cpp:
+        (WebCore::EventHandler::createDraggingClipboard):
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::createDraggingClipboard):
+        * page/qt/EventHandlerQt.cpp:
+        (WebCore::EventHandler::createDraggingClipboard):
+        * page/win/EventHandlerWin.cpp:
+        (WebCore::EventHandler::createDraggingClipboard):
+        * page/wx/EventHandlerWx.cpp:
+        (WebCore::EventHandler::createDraggingClipboard):
+        * platform/Cursor.h:
+        (WebCore::SharedCursor::create):
+        (WebCore::SharedCursor::~SharedCursor):
+        (WebCore::SharedCursor::SharedCursor):
+        * platform/DragData.h:
+        * platform/PopupMenu.h:
+        (WebCore::PopupMenu::create):
+        (WebCore::PopupMenu::isActive):
+        * platform/ScrollBar.cpp:
+        (WebCore::Scrollbar::Scrollbar):
+        * platform/SearchPopupMenu.h:
+        (WebCore::SearchPopupMenu::create):
+        * platform/graphics/FontFamily.cpp:
+        (WebCore::FontFamily::FontFamily):
+        (WebCore::operator==):
+        * platform/graphics/FontFamily.h:
+        (WebCore::FontFamily::FontFamily):
+        (WebCore::SharedFontFamily::create):
+        (WebCore::SharedFontFamily::SharedFontFamily):
+        (WebCore::operator!=):
+        (WebCore::FontFamily::next):
+        (WebCore::FontFamily::appendFamily):
+        (WebCore::FontFamily::releaseNext):
+        * platform/graphics/Icon.h:
+        * platform/graphics/gtk/IconGtk.cpp:
+        (WebCore::Icon::Icon):
+        (WebCore::Icon::~Icon):
+        (WebCore::Icon::newIconForFile):
+        * platform/graphics/mac/IconMac.mm:
+        (WebCore::Icon::Icon):
+        (WebCore::Icon::newIconForFile):
+        * platform/graphics/qt/IconQt.cpp:
+        (WebCore::Icon::Icon):
+        (WebCore::Icon::newIconForFile):
+        * platform/graphics/win/IconWin.cpp:
+        (WebCore::Icon::Icon):
+        (WebCore::Icon::~Icon):
+        (WebCore::Icon::newIconForFile):
+        * platform/gtk/ClipboardGtk.cpp:
+        (WebCore::Editor::newGeneralClipboard):
+        * platform/gtk/ClipboardGtk.h:
+        (WebCore::ClipboardGtk::create):
+        * platform/gtk/PlatformScrollBar.h:
+        (WebCore::PlatformScrollbar::create):
+        * platform/gtk/PopupMenuGtk.cpp:
+        (WebCore::PopupMenu::PopupMenu):
+        * platform/gtk/ScrollViewGtk.cpp:
+        (WebCore::ScrollViewScrollbar::create):
+        (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
+        (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
+        * platform/mac/ClipboardMac.h:
+        (WebCore::ClipboardMac::create):
+        * platform/mac/DragDataMac.mm:
+        (WebCore::DragData::createClipboard):
+        (WebCore::DragData::containsCompatibleContent):
+        * platform/mac/PlatformScrollBar.h:
+        (WebCore::PlatformScrollbar::create):
+        (WebCore::PlatformScrollbar::horizontalScrollbarHeight):
+        (WebCore::PlatformScrollbar::verticalScrollbarWidth):
+        * platform/mac/PopupMenuMac.mm:
+        (WebCore::PopupMenu::PopupMenu):
+        * platform/qt/ClipboardQt.h:
+        (WebCore::ClipboardQt::create):
+        * platform/qt/DragDataQt.cpp:
+        (WebCore::DragData::createClipboard):
+        * platform/qt/PlatformScrollBar.h:
+        (WebCore::PlatformScrollbar::create):
+        * platform/qt/PopupMenuQt.cpp:
+        (WebCore::PopupMenu::PopupMenu):
+        * platform/qt/ScrollViewQt.cpp:
+        (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
+        (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
+        * platform/win/ClipboardWin.h:
+        (WebCore::ClipboardWin::create):
+        * platform/win/CursorWin.cpp:
+        (WebCore::Cursor::Cursor):
+        (WebCore::loadSharedCursor):
+        * platform/win/DragDataWin.cpp:
+        (WebCore::DragData::createClipboard):
+        * platform/win/EditorWin.cpp:
+        (WebCore::Editor::newGeneralClipboard):
+        * platform/win/PlatformScrollBar.h:
+        (WebCore::PlatformScrollbar::create):
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenu::PopupMenu):
+        (WebCore::PopupMenu::show):
+        * platform/win/ScrollViewWin.cpp:
+        (WebCore::ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar):
+        (WebCore::ScrollView::ScrollViewPrivate::setHasVerticalScrollbar):
+        * platform/wx/ClipboardWx.h:
+        (WebCore::ClipboardWx::create):
+        * platform/wx/PlatformScrollBar.h:
+        (WebCore::PlatformScrollbar::create):
+        * platform/wx/PopupMenuWx.cpp:
+        (WebCore::PopupMenu::PopupMenu):
+        * platform/wx/TemporaryLinkStubs.cpp:
+        (Icon::Icon):
+        (Icon::newIconForFile):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::createScrollbar):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::updateFromElement):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+        * svg/graphics/SVGImageEmptyClients.h:
+        (WebCore::SVGEmptyFrameLoaderClient::createDocumentLoader):
+
 2008-06-14  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Dan Bernstein.
@@ -21950,8 +22110,6 @@ element is when the element reports itself to the screen reader. So all of these
 
 2008-04-03  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by NOBODY (Rollout).
-
         Rollout r31566 as there were a few issues i missed during review (thanks to antti for pointing them out)
 
         * dom/Element.h:
index 6b4309a775aa0ec05d8001d7b33e6ca4b9e8217b..f4355e73e86e334bdcc2a5df5a1791e06ed6e694 100644 (file)
@@ -469,7 +469,9 @@ __ZN7WebCore5Frame29forceLayoutWithPageWidthRangeEffb
 __ZN7WebCore5Frame34setMarkedTextMatchesAreHighlightedEb
 __ZN7WebCore5Frame4initEv
 __ZN7WebCore5Frame5paintEPNS_15GraphicsContextERKNS_7IntRectE
+__ZN7WebCore5Frame7setViewEPNS_9FrameViewE
 __ZN7WebCore5FrameC1EPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
+__ZN7WebCore5FrameD1Ev
 __ZN7WebCore5Image12supportsTypeERKNS_6StringE
 __ZN7WebCore5Image20loadPlatformResourceEPKc
 __ZN7WebCore5Range6createEN3WTF10PassRefPtrINS_8DocumentEEENS2_INS_4NodeEEEiS6_i
index 571dfce5020389362f2fcaed2283f9d8f9280c02..b6cceb632c592cc37e65176387bc727aa448e740 100644 (file)
                1A8F6BB00DB55CDC001DB794 /* appcache */ = {
                        isa = PBXGroup;
                        children = (
-                               5126E6B60A2E3AEF005C29FA /* icon */,
                                1A8F6BB10DB55CDC001DB794 /* ApplicationCache.cpp */,
                                1A8F6BB20DB55CDC001DB794 /* ApplicationCache.h */,
                                1A8F6BB30DB55CDC001DB794 /* ApplicationCacheGroup.cpp */,
                                51E1ECBC0C91C90400DC255B /* PageURLRecord.cpp */,
                                51E1ECBD0C91C90400DC255B /* PageURLRecord.h */,
                        );
-                       name = icon;
-                       path = ../icon;
+                       path = icon;
                        sourceTree = "<group>";
                };
                512DD8E80D91E691000F89EE /* archive */ = {
                        children = (
                                1A8F6BB00DB55CDC001DB794 /* appcache */,
                                512DD8E80D91E691000F89EE /* archive */,
+                               5126E6B60A2E3AEF005C29FA /* icon */,
                                93A1EAA20A5634D8006960A0 /* mac */,
                                BCB16BFE0979C3BD00467741 /* Cache.cpp */,
                                BCB16BFF0979C3BD00467741 /* Cache.h */,
index 1a70ca0630637ca0f46b399079ae77a44140557f..5469e215fcb60bd08131c6c6094f79d499a51459 100644 (file)
@@ -3633,10 +3633,10 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
                     currFamily = &firstFamily;
                 }
                 else {
-                    FontFamily *newFamily = new FontFamily;
+                    RefPtr<SharedFontFamily> newFamily = SharedFontFamily::create();
                     newFamily->setFamily(face);
                     currFamily->appendFamily(newFamily);
-                    currFamily = newFamily;
+                    currFamily = newFamily.get();
                 }
     
                 if (fontDescription.keywordSize() && (fontDescription.genericFamily() == FontDescription::MonospaceFamily) != oldFamilyIsMonospace)
index 7bf922cea885b7ca30fb0c499e847ce0a396cd9e..f7a52efe1e7bc2d0068e02a2f3172df5ffb64f30 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,8 +34,7 @@
 namespace WebCore {
 
 Clipboard::Clipboard(ClipboardAccessPolicy policy, bool isForDragging) 
-    : RefCounted<Clipboard>(0)
-    , m_policy(policy) 
+    : m_policy(policy) 
     , m_dragStarted(false)
     , m_forDragging(isForDragging)
     , m_dragImage(0)
index aaf3bc661d07de2be33ee77ad98a8901e80f8847..b98fc002bc672b58a6efdc096df912ce9ebee2f5 100644 (file)
@@ -48,7 +48,7 @@ void _NSSetKillRingToYankedState();
 
 PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
 {
-    return new ClipboardMac(false, [NSPasteboard generalPasteboard], policy);
+    return ClipboardMac::create(false, [NSPasteboard generalPasteboard], policy, 0);
 }
 
 static void initializeKillRingIfNeeded()
index 5f12450daea84461a6d212e195082348d5f5e762..89ee78ed3892338d5568a7a4f5899bb04f2099ab 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -41,7 +41,7 @@ namespace WebCore {
 
 PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
 {
-    return new ClipboardQt(policy);
+    return ClipboardQt::create(policy);
 }
 
 } // namespace WebCore
index 3cb0472f4caf2635b1df5ee872742ecb95c4c710..0a632159548d480ff2725d7ef2c26064e0572c79 100644 (file)
  */
 
 #include "config.h"
-
 #include "Editor.h"
+
 #include "ClipboardWx.h"
 
 namespace WebCore {
 
 PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy) 
 { 
-    return new ClipboardWx(policy, true);
+    return ClipboardWx::create(policy, true);
 }
 
 }
-
-
index 306ebd5c3fee316ce524fa41169e332b23c6daff..07d500da67adc730d78032cdd0c389b0d243cc54 100644 (file)
@@ -135,8 +135,7 @@ static void setAllDefersLoading(const ResourceLoaderSet& loaders, bool defers)
 }
 
 DocumentLoader::DocumentLoader(const ResourceRequest& req, const SubstituteData& substituteData)
-    : RefCounted<DocumentLoader>(0)
-    , m_deferMainResourceDataLoad(true)
+    : m_deferMainResourceDataLoad(true)
     , m_frame(0)
     , m_originalRequest(req)
     , m_substituteData(substituteData)
index 509e8abe4030eb95f4c39b03ac2cf22b63851059..989807fa08c8a9df8c12904c9eb98cefa1100b6d 100644 (file)
@@ -68,7 +68,10 @@ namespace WebCore {
 
     class DocumentLoader : public RefCounted<DocumentLoader> {
     public:
-        DocumentLoader(const ResourceRequest&, const SubstituteData&);
+        static PassRefPtr<DocumentLoader> create(const ResourceRequest& request, const SubstituteData& data)
+        {
+            return adoptRef(new DocumentLoader(request, data));
+        }
         virtual ~DocumentLoader();
 
         void setFrame(Frame*);
@@ -203,7 +206,10 @@ namespace WebCore {
 
         ApplicationCache* mainResourceApplicationCache() const;
 #endif
+
     protected:
+        DocumentLoader(const ResourceRequest&, const SubstituteData&);
+
         bool m_deferMainResourceDataLoad;
 
     private:
index 5d7ddf1455b2408c68ea77f529bf7287f1373b1a..34b466e4e4c1d6deb6398c892e5bbc49faa3ef82 100644 (file)
@@ -375,7 +375,7 @@ Image* IconDatabase::defaultIcon(const IntSize& size)
     static RefPtr<SharedBuffer> defaultIconBuffer(SharedBuffer::create(defaultIconData, sizeof(defaultIconData)));
     
     if (!m_defaultIconRecord) {
-        m_defaultIconRecord = new IconRecord("urlIcon");
+        m_defaultIconRecord = IconRecord::create("urlIcon");
         m_defaultIconRecord->setImageData(defaultIconBuffer);
     }
     
@@ -513,10 +513,10 @@ void IconDatabase::setIconDataForIconURL(PassRefPtr<SharedBuffer> dataOriginal,
         MutexLocker locker(m_urlAndIconLock);
     
         // If this icon was pending a read, remove it from that set because this new data should override what is on disk
-        IconRecord* icon = m_iconURLToRecordMap.get(iconURL);
+        RefPtr<IconRecord> icon = m_iconURLToRecordMap.get(iconURL);
         if (icon) {
             MutexLocker locker(m_pendingReadingLock);
-            m_iconsPendingReading.remove(icon);
+            m_iconsPendingReading.remove(icon.get());
         } else
             icon = getOrCreateIconRecord(iconURL);
     
@@ -588,8 +588,7 @@ void IconDatabase::setIconURLForPageURL(const String& iconURLOriginal, const Str
         RefPtr<IconRecord> iconRecord = pageRecord->iconRecord();
 
         // Otherwise, set the new icon record for this page
-        IconRecord* newIconRecord = getOrCreateIconRecord(iconURL);
-        pageRecord->setIconRecord(newIconRecord);
+        pageRecord->setIconRecord(getOrCreateIconRecord(iconURL));
 
         // If the current icon has only a single ref left, it is about to get wiped out. 
         // Remove it from the in-memory records and don't bother reading it in from disk anymore
@@ -834,18 +833,18 @@ String IconDatabase::defaultDatabaseFilename()
 }
 
 // Unlike getOrCreatePageURLRecord(), getOrCreateIconRecord() does not mark the icon as "interested in import"
-IconRecord* IconDatabase::getOrCreateIconRecord(const String& iconURL)
+PassRefPtr<IconRecord> IconDatabase::getOrCreateIconRecord(const String& iconURL)
 {
     // Clients of getOrCreateIconRecord() are required to acquire the m_urlAndIconLock before calling this method
     ASSERT(!m_urlAndIconLock.tryLock());
 
     if (IconRecord* icon = m_iconURLToRecordMap.get(iconURL))
         return icon;
-        
-    IconRecord* newIcon = new IconRecord(iconURL);
-    m_iconURLToRecordMap.set(iconURL, newIcon);
-        
-    return newIcon;    
+
+    RefPtr<IconRecord> newIcon = IconRecord::create(iconURL);
+    m_iconURLToRecordMap.set(iconURL, newIcon.get());
+
+    return newIcon.release();
 }
 
 // This method retrieves the existing PageURLRecord, or creates a new one and marks it as "interested in the import" for later notification
@@ -1200,8 +1199,8 @@ void IconDatabase::performURLImport()
                 IconRecord* currentIcon = pageRecord->iconRecord();
 
                 if (!currentIcon || currentIcon->iconURL() != iconURL) {
-                    currentIcon = getOrCreateIconRecord(iconURL);
-                    pageRecord->setIconRecord(currentIcon);
+                    pageRecord->setIconRecord(getOrCreateIconRecord(iconURL));
+                    currentIcon = pageRecord->iconRecord();
                 }
             
                 // Regardless, the time stamp from disk still takes precedence.  Until we read this icon from disk, we didn't think we'd seen it before
index 10211af1118ef928928ca1a7470109328afb118e..546281e2928098f8ccd98d45c5752205dd3ee370 100644 (file)
@@ -123,7 +123,7 @@ private:
     
     HashSet<RefPtr<DocumentLoader> > m_loadersPendingDecision;
 
-    IconRecord* m_defaultIconRecord;
+    RefPtr<IconRecord> m_defaultIconRecord;
 #endif // ENABLE(ICONDATABASE)
 
 // *** Any Thread ***
@@ -134,7 +134,7 @@ public:
 
 #if ENABLE(ICONDATABASE)
 private:
-    IconRecord* getOrCreateIconRecord(const String& iconURL);
+    PassRefPtr<IconRecord> getOrCreateIconRecord(const String& iconURL);
     PageURLRecord* getOrCreatePageURLRecord(const String& pageURL);
     
     bool m_isEnabled;
index 52259ed386b7418d69401b1f8c25ef8e4ff66907..8b3d5f9945a806564b5ecd6860e3522e7484957c 100644 (file)
@@ -41,8 +41,7 @@
 namespace WebCore {
 
 IconRecord::IconRecord(const String& url)
-    : RefCounted<IconRecord>(0)
-    , m_iconURL(url)
+    : m_iconURL(url)
     , m_stamp(0)
     , m_dataSet(false)
 {
index c6da7a640cebba7e8b7aadcb4f6116780461a102..61d31fa0c12f26887c604d52b184fee3da3796b9 100644 (file)
@@ -67,7 +67,10 @@ public:
 class IconRecord : public RefCounted<IconRecord> {
     friend class PageURLRecord;
 public:
-    IconRecord(const String& url); 
+    static PassRefPtr<IconRecord> create(const String& url)
+    {
+        return adoptRef(new IconRecord(url));
+    }
     ~IconRecord();
     
     time_t getTimestamp() { return m_stamp; }
@@ -85,7 +88,10 @@ public:
     const HashSet<String>& retainingPageURLs() { return m_retainingPageURLs; }
     
     IconSnapshot snapshot(bool forDeletion = false) const;
+
 private:
+    IconRecord(const String& url); 
+
     String m_iconURL;
     time_t m_stamp;
     OwnPtr<Image> m_image;
index 68b428d833a6ada4510cd214a1c8205d920b6d60..9e0895fdf6db6ac478133ce7d4cb0540d4cb3cca 100644 (file)
@@ -193,7 +193,7 @@ private:
     static EventHandlerDragState& dragState();
     static const double TextDragDelay;
     
-    Clipboard* createDraggingClipboard() const;
+    PassRefPtr<Clipboard> createDraggingClipboard() const;
     
     bool eventActivatedView(const PlatformMouseEvent&) const;
     void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults& event);
index c5626f76a1a1dcd3c10ac7779b9a8408e55f35dc..3fd818248b0109d82ab5716db6d27760158b4525 100644 (file)
@@ -121,8 +121,7 @@ static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement)
 }
 
 Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* frameLoaderClient) 
-    : RefCounted<Frame>(0)
-    , d(new FramePrivate(page, parentFromOwnerElement(ownerElement), this, ownerElement, frameLoaderClient))
+    : d(new FramePrivate(page, parentFromOwnerElement(ownerElement), this, ownerElement, frameLoaderClient))
 {
     AtomicString::init();
     EventNames::init();
@@ -148,9 +147,6 @@ Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient*
     if (!ownerElement)
         page->setMainFrame(this);
     else {
-        // FIXME: It's bad to have a ref() here but not in the !ownerElement case.
-        // We need to straighten this out.
-        ref();
         page->incrementFrameCount();
         ownerElement->m_contentFrame = this;
     }
index 3edb236bae8df504190a6676ea336d618ada5141..2d9619789e05e040c79e3fbafde50fc0cf202f5e 100644 (file)
@@ -80,9 +80,12 @@ template <typename T> class Timer;
 
 class Frame : public RefCounted<Frame> {
 public:
-    Frame(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
-    virtual void setView(FrameView*);
-    virtual ~Frame();
+    static PassRefPtr<Frame> create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
+    {
+        return adoptRef(new Frame(page, ownerElement, client));
+    }
+    void setView(FrameView*);
+    ~Frame();
     
     void init();
 
@@ -111,6 +114,8 @@ public:
     friend class FramePrivate;
 
 private:
+    Frame(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
+
     FramePrivate* d;
     
 // === undecided, would like to consider moving to another class
index a0046f938dd6eca150e50a19ceac52486bd1d74d..bd96c7bb89d4153e28136c95a41da7dc24edac42 100644 (file)
@@ -100,9 +100,9 @@ bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* wid
     return static_cast<FrameView*>(widget)->frame()->eventHandler()->handleWheelEvent(event);
 }
 
-Clipboard* EventHandler::createDraggingClipboard() const
+PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
 {
-    return new ClipboardGtk(ClipboardWritable, true);
+    return ClipboardGtk::create(ClipboardWritable, true);
 }
 
 bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
index 04a08e627b95452ef321a8306daa5efb5ec1fce4..2ff0716b27da7b48da2f190b7a814e199d01f167 100644 (file)
@@ -362,13 +362,13 @@ bool EventHandler::eventLoopHandleMouseDragged(const MouseEventWithHitTestResult
     return true;
 }
     
-Clipboard* EventHandler::createDraggingClipboard() const 
+PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const 
 {
     NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
     // Must be done before ondragstart adds types and data to the pboard,
     // also done for security, as it erases data from the last drag
     [pasteboard declareTypes:[NSArray array] owner:nil];
-    return new ClipboardMac(true, pasteboard, ClipboardWritable, m_frame);
+    return ClipboardMac::create(true, pasteboard, ClipboardWritable, m_frame);
 }
     
 bool EventHandler::eventLoopHandleMouseUp(const MouseEventWithHitTestResults&)
index 217af69ca9ba4e006f912d24beaa2cdc14f1526c..3e689be45050edc53e384a3c2c97bab83b15b0ae 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
  * Copyright (C) 2007 Trolltech ASA
  *
  * Redistribution and use in source and binary forms, with or without
@@ -111,9 +111,9 @@ bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* wid
     return static_cast<FrameView*>(widget)->frame()->eventHandler()->handleWheelEvent(event);
 }
 
-Clipboard* EventHandler::createDraggingClipboard() const
+PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
 {
-    return new ClipboardQt(ClipboardWritable, true);
+    return ClipboardQt::create(ClipboardWritable, true);
 }
 
 bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
index ec9d0146d4d5d77f084a71a5078948ae4bd03b5d..aa34843bfc7d5c7759252124b231cb053aa4cc9b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -94,11 +94,11 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const
     return event.activatedWebView();
 }
 
-Clipboard* EventHandler::createDraggingClipboard() const
+PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
 {
     COMPtr<WCDataObject> dataObject;
     WCDataObject::createInstance(&dataObject);
-    return new ClipboardWin(true, dataObject.get(), ClipboardWritable);
+    return ClipboardWin::create(true, dataObject.get(), ClipboardWritable);
 }
 
 void EventHandler::focusDocumentView()
index 9c0f4f283b4da0a0b6a8626069ffc38864dab22c..eb2d423106d5a3208510db2700f6f529b3934933 100644 (file)
@@ -24,9 +24,9 @@
  */
 
 #include "config.h"
+#include "EventHandler.h"
 
 #include "ClipboardWx.h"
-#include "EventHandler.h"
 #include "FocusController.h"
 #include "Frame.h"
 #include "FrameView.h"
@@ -91,9 +91,9 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
     return false;
 }
 
-Clipboard* EventHandler::createDraggingClipboard() const 
+PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const 
 {
-    return new ClipboardWx(ClipboardWritable, true);
+    return ClipboardWx::create(ClipboardWritable, true);
 }
 
 }
index c021ebcec6c3285697a321aa119ad29d2468d7e1..125b0ffeba3c942907081932c1d98134d0138c9a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,6 +31,7 @@
 #if PLATFORM(WIN)
 typedef struct HICON__* HICON;
 typedef HICON HCURSOR;
+#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #elif PLATFORM(GTK)
@@ -59,12 +60,11 @@ namespace WebCore {
 #if PLATFORM(WIN)
     class SharedCursor : public RefCounted<SharedCursor> {
     public:
-        SharedCursor(HCURSOR nativeCursor) : RefCounted<SharedCursor>(0), m_nativeCursor(nativeCursor) {}
-        ~SharedCursor() {
-            DestroyIcon(m_nativeCursor);
-        }
+        static PassRefPtr<SharedCursor> create(HCURSOR nativeCursor) { return adoptRef(new SharedCursor(nativeCursor)); }
+        ~SharedCursor() { DestroyIcon(m_nativeCursor); }
         HCURSOR nativeCursor() const { return m_nativeCursor; }
     private:
+        SharedCursor(HCURSOR nativeCursor) : m_nativeCursor(nativeCursor) { }
         HCURSOR m_nativeCursor;
     };
     typedef RefPtr<SharedCursor> PlatformCursor;
index 290f99a53d6911a72d3df0374451c39aaf62b8d0..467904d2b9b91a3166eb84258bc631d044ffe1b9 100644 (file)
@@ -84,7 +84,7 @@ namespace WebCore {
         const IntPoint& globalPosition() const { return m_globalPosition; }
         DragDataRef platformData() const { return m_platformDragData; }
         DragOperation draggingSourceOperationMask() const { return m_draggingSourceOperationMask; }
-        Clipboard* createClipboard(ClipboardAccessPolicy) const;
+        PassRefPtr<Clipboard> createClipboard(ClipboardAccessPolicy) const;
         bool containsURL() const;
         bool containsPlainText() const;
         bool containsCompatibleContent() const;
index d7c87e6af875937b06c07b027782425311244c45..e308486778c9f89de71526bde6fe2e2c042566e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
 #ifndef PopupMenu_h
 #define PopupMenu_h
 
-#include <wtf/RefCounted.h>
-
 #include "IntRect.h"
 #include "PopupMenuClient.h"
 #include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
 
 #if PLATFORM(MAC)
 #include <wtf/RetainPtr.h>
@@ -73,7 +72,7 @@ class PopupMenu : public RefCounted<PopupMenu>
 #endif
 {
 public:
-    static PassRefPtr<PopupMenu> create(PopupMenuClient* client) { return new PopupMenu(client); }
+    static PassRefPtr<PopupMenu> create(PopupMenuClient* client) { return adoptRef(new PopupMenu(client)); }
     ~PopupMenu();
     
     void disconnectClient() { m_popupClient = 0; }
@@ -106,7 +105,7 @@ public:
     void focusFirst();
     void focusLast();
 
-    void paint(const IntRect& damageRect, HDC hdc = 0);
+    void paint(const IntRect& damageRect, HDC = 0);
 
     HWND popupHandle() const { return m_popup; }
 
@@ -127,14 +126,7 @@ public:
 #endif
 
 protected:
-    PopupMenu(PopupMenuClient* client);
-
-#if PLATFORM(WIN)
-    // ScrollBarClient
-    virtual void valueChanged(Scrollbar*);
-    virtual IntRect windowClipRect() const;
-    virtual bool isActive() const { return true; }
-#endif
+    PopupMenu(PopupMenuClient*);
     
 private:
     PopupMenuClient* m_popupClient;
@@ -149,6 +141,11 @@ private:
     void populate(const IntRect&);
     QWebPopup* m_popup;
 #elif PLATFORM(WIN)
+    // ScrollBarClient
+    virtual void valueChanged(Scrollbar*);
+    virtual IntRect windowClipRect() const;
+    virtual bool isActive() const { return true; }
+
     void calculatePositionAndSize(const IntRect&, FrameView*);
     void invalidateItem(int index);
 
index 0b8e9ab65dec57b82699aaf94ab2dfb973905637..8e6af32deb61b48872d60be5e85364104946b678 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,8 +34,7 @@ using std::min;
 namespace WebCore {
 
 Scrollbar::Scrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
-    : RefCounted<Scrollbar>(0)
-    , m_client(client)
+    : m_client(client)
     , m_orientation(orientation)
     , m_controlSize(controlSize)
     , m_visibleSize(0)
@@ -114,4 +113,5 @@ bool Scrollbar::scroll(ScrollDirection direction, ScrollGranularity granularity,
     // return true even if the integer value did not change so that scroll event gets eaten
     return true;
 }
+
 }
index d3b886d9901d5f3b28d875a31abf5d75c73a1f56..4285cdf96b9d9af9573a36d9c8afc4b5d7a62fe5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -22,7 +22,6 @@
 #define SearchPopupMenu_h
 
 #include "PopupMenu.h"
-#include <wtf/Forward.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -31,16 +30,15 @@ class AtomicString;
 
 class SearchPopupMenu : public PopupMenu {
 public:
-    static PassRefPtr<SearchPopupMenu> create(PopupMenuClient* client) { return new SearchPopupMenu(client); }
+    static PassRefPtr<SearchPopupMenu> create(PopupMenuClient* client) { return adoptRef(new SearchPopupMenu(client)); }
 
     void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems);
     void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems);
 
     bool enabled();
     
-protected:
-    SearchPopupMenu(PopupMenuClient* client);
-
+private:
+    SearchPopupMenu(PopupMenuClient*);
 };
 
 }
index c87c661b7078487b12aa941de9964d8301204560..12b59a4ff5457337e22fa0d8dadfc1e095fe3333 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,8 +29,7 @@
 namespace WebCore {
 
 FontFamily::FontFamily(const FontFamily& other)
-    : RefCounted<FontFamily>(0)
-    , m_family(other.m_family)
+    : m_family(other.m_family)
     , m_next(other.m_next)
 {
 }
@@ -42,14 +41,19 @@ FontFamily& FontFamily::operator=(const FontFamily& other)
     return *this;
 }
 
-bool FontFamily::operator==(const FontFamily &compareFontFamily) const
+bool operator==(const FontFamily& a, const FontFamily& b)
 {
-    if ((!m_next && compareFontFamily.m_next) || 
-        (m_next && !compareFontFamily.m_next) ||
-        ((m_next && compareFontFamily.m_next) && (*m_next != *(compareFontFamily.m_next))))
+    if (a.family() != b.family())
         return false;
-    
-    return m_family == compareFontFamily.m_family;
+    const FontFamily* ap;
+    const FontFamily* bp;
+    for (ap = a.next(), bp = b.next(); ap != bp; ap = ap->next(), bp = bp->next()) {
+        if (!ap || !bp)
+            return false;
+        if (ap->family() != bp->family())
+            return false;
+    }
+    return true;
 }
 
 }
index 7a382cc37b2413f432f27128222c3eded82bd6b0..126bd83e41d0b247a9b489a539f9a77ca7d148e9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #include "AtomicString.h"
 #include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
+#include <wtf/ListRefPtr.h>
 
 namespace WebCore {
 
-class FontFamily : public RefCounted<FontFamily> {
+class SharedFontFamily;
+
+class FontFamily {
 public:
-    FontFamily() : RefCounted<FontFamily>(0) { }
-    
+    FontFamily() { }
     FontFamily(const FontFamily&);    
     FontFamily& operator=(const FontFamily&);
 
@@ -43,19 +44,45 @@ public:
     const AtomicString& family() const { return m_family; }
     bool familyIsEmpty() const { return m_family.isEmpty(); }
 
-    FontFamily* next() { return m_next.get(); }
-    const FontFamily* next() const { return m_next.get(); }
+    const FontFamily* next() const;
 
-    void appendFamily(PassRefPtr<FontFamily> family) { m_next = family; }
+    void appendFamily(PassRefPtr<SharedFontFamily>);
+    PassRefPtr<SharedFontFamily> releaseNext();
 
-    bool operator==(const FontFamily&) const;
-    bool operator!=(const FontFamily& x) const { return !(*this == x); }
-    
 private:
     AtomicString m_family;
-    RefPtr<FontFamily> m_next;
+    ListRefPtr<SharedFontFamily> m_next;
 };
 
+class SharedFontFamily : public FontFamily, public RefCounted<SharedFontFamily> {
+public:
+    static PassRefPtr<SharedFontFamily> create()
+    {
+        return adoptRef(new SharedFontFamily);
+    }
+
+private:
+    SharedFontFamily() { }
+};
+
+bool operator==(const FontFamily&, const FontFamily&);
+inline bool operator!=(const FontFamily& a, const FontFamily& b) { return !(a == b); }
+
+inline const FontFamily* FontFamily::next() const
+{
+    return m_next.get();
+}
+
+inline void FontFamily::appendFamily(PassRefPtr<SharedFontFamily> family)
+{
+    m_next = family;
+}
+
+inline PassRefPtr<SharedFontFamily> FontFamily::releaseNext()
+{
+    return m_next.release();
+}
+
 }
 
 #endif
index 310c25a4f4c6b0b1fd1bf7348e623ec3e01ab915..97188214d457e32416795f5a30592ce3c8a48ddc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -47,28 +47,23 @@ class String;
     
 class Icon : public RefCounted<Icon> {
 public:
-    Icon();
-    ~Icon();
-    
     static PassRefPtr<Icon> newIconForFile(const String& filename);
+    ~Icon();
 
     void paint(GraphicsContext*, const IntRect&);
 
-#if PLATFORM(WIN)
-    Icon(HICON);
-#endif
-
 private:
 #if PLATFORM(MAC)
     Icon(NSImage*);
-#endif
-#if PLATFORM(MAC)
     RetainPtr<NSImage> m_nsImage;
 #elif PLATFORM(WIN)
+    Icon(HICON);
     HICON m_hIcon;
 #elif PLATFORM(QT)
+    Icon();
     QIcon m_icon;
 #elif PLATFORM(GTK)
+    Icon();
     GdkPixbuf* m_icon;
 #endif
 };
index a8e65364db7b33ecad149f4401deed988d90d904..f713a6e585161982d5ef74024f8fe97dd3eaef21 100644 (file)
 namespace WebCore {
 
 Icon::Icon()
-    : RefCounted<Icon>(0)
-    , m_icon(0)
+    : m_icon(0)
 {
-    notImplemented();
 }
 
 Icon::~Icon()
 {
-    if(m_icon)
+    if (m_icon)
         g_object_unref(m_icon);
 }
 
@@ -98,9 +96,11 @@ PassRefPtr<Icon> Icon::newIconForFile(const String& filename)
     String MIMEType = MIMETypeRegistry::getMIMETypeForPath(filename);
     String iconName = lookupIconName(MIMEType);
 
-    Icon* icon = new Icon;
+    RefPtr<Icon> icon = adoptRef(new Icon);
     icon->m_icon = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), iconName.utf8().data(), 16, GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
-    return icon->m_icon ? icon : 0;
+    if (!icon->m_icon)
+        return 0;
+    return icon.release();
 }
 
 void Icon::paint(GraphicsContext* context, const IntRect& rect)
index b630ba66ee88b990140e1c090c9c3921f4b59b22..a9eb524e838835553942fc708367d9203619a1e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
 
 namespace WebCore {
 
-Icon::Icon()
-    : RefCounted<Icon>(0)
-{
-}
-
 Icon::Icon(NSImage *image)
-    : RefCounted<Icon>(0)
-    , m_nsImage(image)
+    : m_nsImage(image)
 {
     // Need this because WebCore uses AppKit's flipped coordinate system exclusively.
     [image setFlipped:YES];
@@ -56,7 +50,7 @@ PassRefPtr<Icon> Icon::newIconForFile(const String& filename)
     if (!image)
         return 0;
 
-    return new Icon(image);
+    return adoptRef(new Icon(image));
 }
 
 void Icon::paint(GraphicsContext* context, const IntRect& rect)
index c9c900b7a2d95cd7e2d7b71f591ab0d0f72aae71..734a4fbf903398f937b2630109c8ed60e00d5096 100644 (file)
@@ -34,7 +34,6 @@
 namespace WebCore {
 
 Icon::Icon()
-    : RefCounted<Icon>(0)
 {
 }
 
@@ -44,9 +43,9 @@ Icon::~Icon()
     
 PassRefPtr<Icon> Icon::newIconForFile(const String& filename)
 {
-    Icon *i = new Icon;
+    RefPtr<Icon> i = adoptRef(new Icon);
     i->m_icon = QIcon(filename);
-    return PassRefPtr<Icon>(i);
+    return i.release();
 }
 
 void Icon::paint(GraphicsContext* ctx, const IntRect& rect)
index b6bc926971e27da6cbc11b15194aed97996a6a61..1c67bc73aa80aa84a4a2f9987ca2fac1472d5fce 100644 (file)
@@ -1,5 +1,5 @@
 /*
-* Copyright (C) 2006, 2007 Apple Inc.
+* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 
 namespace WebCore {
 
-Icon::Icon()
-    : RefCounted<Icon>(0)
-    , m_hIcon(0)
-{
-}
-
 Icon::Icon(HICON icon)
-    : RefCounted<Icon>(0)
-    , m_hIcon(icon)
+    : m_hIcon(icon)
 {
+    ASSERT(icon);
 }
 
 Icon::~Icon()
 {
-    if (m_hIcon)
-        DestroyIcon(m_hIcon);
+    DestroyIcon(m_hIcon);
 }
 
 PassRefPtr<Icon> Icon::newIconForFile(const String& filename)
@@ -54,9 +47,7 @@ PassRefPtr<Icon> Icon::newIconForFile(const String& filename)
     if (!SHGetFileInfo(tmpFilename.charactersWithNullTermination(), 0, &sfi, sizeof(sfi), SHGFI_ICON | SHGFI_SHELLICONSIZE | SHGFI_SMALLICON))
         return 0;
 
-    Icon* icon = new Icon();  
-    icon->m_hIcon = sfi.hIcon;
-    return icon;
+    return adoptRef(new Icon(sfi.hIcon));
 }
 
 void Icon::paint(GraphicsContext* context, const IntRect& r)
index 12e3a01f9b33fc8c5d959ce25185c76600fa6721..44aa7f755f6d2b422d45c3346820e63e948d4763 100644 (file)
 #include "Editor.h"
 
 namespace WebCore {
+
 PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
 {
-    return new ClipboardGtk(policy, false);
+    return ClipboardGtk::create(policy, false);
 }
 
 ClipboardGtk::ClipboardGtk(ClipboardAccessPolicy policy, bool forDragging)
index 3ad10497fdb161021b0ffa9ebbe2a3c6e040e50c..b8b4ddf60d456089c9e1a147fdf2403d626bdb54 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2007, Holger Hans Peter Freyther
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,9 +36,11 @@ namespace WebCore {
     // Created from the EventHandlerGtk to be used by the dom
     class ClipboardGtk : public Clipboard {
     public:
-        ClipboardGtk(ClipboardAccessPolicy, bool);
-        ~ClipboardGtk();
-
+        static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, bool isForDragging)
+        {
+            return adoptRef(new ClipboardGtk(policy, isForDragging));
+        }
+        virtual ~ClipboardGtk();
 
         void clearData(const String&);
         void clearAllData();
@@ -58,6 +60,9 @@ namespace WebCore {
         virtual void writeRange(Range*, Frame*);
 
         virtual bool hasData();
+
+    private:
+        ClipboardGtk(ClipboardAccessPolicy, bool);
     };
 }
 
index 88bbfa486d66b962fe5f8cad4af71a396a1417aa..7665eccd393c38ad1e8e1f5d7327f1055a16bc27 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,8 +26,9 @@
 #ifndef PlatformScrollBar_h
 #define PlatformScrollBar_h
 
-#include "Widget.h"
 #include "ScrollBar.h"
+#include "Widget.h"
+#include <wtf/PassRefPtr.h>
 
 typedef struct _GtkAdjustment GtkAdjustment;
 
@@ -35,7 +36,10 @@ namespace WebCore {
 
 class PlatformScrollbar : public Widget, public Scrollbar {
 public:
-    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+    static PassRefPtr<PlatformScrollbar> create(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+    {
+        return adoptRef(new PlatformScrollbar(client, orientation, size));
+    }
     virtual ~PlatformScrollbar();
 
     virtual bool isWidget() const { return true; }
@@ -50,6 +54,8 @@ public:
     static int verticalScrollbarWidth();
 
 protected:
+    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+
     virtual void updateThumbPosition();
     virtual void updateThumbProportion();
     virtual void geometryChanged();
index 3b8446837b75f32076a1990183dee5d5aefdaee1..0266ced3dd9f83edfdf5e8f748c793e8b823342d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the popup menu implementation for <select> elements in WebCore.
  *
- * Copyright (C) 2006, 2007 Apple Inc.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
  * Copyright (C) 2008 Collabora Ltd.
  *
@@ -34,8 +34,7 @@
 namespace WebCore {
 
 PopupMenu::PopupMenu(PopupMenuClient* client)
-    : RefCounted<PopupMenu>(0)
-    , m_popupClient(client)
+    : m_popupClient(client)
     , m_popup(0)
 {
 }
index 9e423a36e11b4291ad233d3bfde2d74dc118a610..9a47b608f8ee1e8e7beba38720e0d8aa9e46f8c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
  * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
  * Copyright (C) 2007 Holger Hans Peter Freyther
  * Copyright (C) 2008 Collabora Ltd.
@@ -52,10 +52,15 @@ namespace WebCore {
 
 class ScrollViewScrollbar : public PlatformScrollbar {
 public:
+    static PassRefPtr<ScrollViewScrollbar> create(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+    {
+        return adoptRef(new ScrollViewScrollbar(client, orientation, size));
+    }
+
+private:
     ScrollViewScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
 
-protected:
-    void geometryChanged() const;
+    virtual void geometryChanged() const;
 };
 
 class ScrollView::ScrollViewPrivate : public ScrollbarClient
@@ -142,7 +147,7 @@ void ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar(bool hasBar)
 {
     if (Scrollbar::hasPlatformScrollbars()) {
         if (hasBar && !hBar && !horizontalAdjustment) {
-            hBar = new ScrollViewScrollbar(this, HorizontalScrollbar, RegularScrollbar);
+            hBar = ScrollViewScrollbar::create(this, HorizontalScrollbar, RegularScrollbar);
             view->addChild(hBar.get());
         } else if (!hasBar && hBar) {
             view->removeChild(hBar.get());
@@ -155,7 +160,7 @@ void ScrollView::ScrollViewPrivate::setHasVerticalScrollbar(bool hasBar)
 {
     if (Scrollbar::hasPlatformScrollbars()) {
         if (hasBar && !vBar && !verticalAdjustment) {
-            vBar = new ScrollViewScrollbar(this, VerticalScrollbar, RegularScrollbar);
+            vBar = ScrollViewScrollbar::create(this, VerticalScrollbar, RegularScrollbar);
             view->addChild(vBar.get());
         } else if (!hasBar && vBar) {
             view->removeChild(vBar.get());
index 480d8284168d035c150657a3892b84fdae603b87..db6ecb6f652427d850794efd6b5f79477921213f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-// An implementation of the clipboard class from IE that talks to the Cocoa Pasteboard
-
 #ifndef ClipboardMac_h
 #define ClipboardMac_h
 
-#include "IntPoint.h"
-#include "Clipboard.h"
-#include "ClipboardAccessPolicy.h"
 #include "CachedResourceClient.h"
+#include "Clipboard.h"
 #include <wtf/RetainPtr.h>
 
 #ifdef __OBJC__
@@ -40,7 +36,6 @@
 #else
 class NSImage;
 class NSPasteboard;
-typedef unsigned NSDragOperation;
 #endif
 
 namespace WebCore {
@@ -49,7 +44,11 @@ class Frame;
 
 class ClipboardMac : public Clipboard, public CachedResourceClient {
 public:
-    ClipboardMac(bool forDragging, NSPasteboard *, ClipboardAccessPolicy, Frame* = 0);
+    static PassRefPtr<ClipboardMac> create(bool forDragging, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, Frame* frame)
+    {
+        return adoptRef(new ClipboardMac(forDragging, pasteboard, policy, frame));
+    }
+
     virtual ~ClipboardMac();
     
     void clearData(const String& type);
@@ -73,7 +72,10 @@ public:
     // Methods for getting info in Cocoa's type system
     NSImage *dragNSImage(NSPoint&) const; // loc converted from dragLoc, based on whole image size
     NSPasteboard *pasteboard() { return m_pasteboard.get(); }
+
 private:
+    ClipboardMac(bool forDragging, NSPasteboard *, ClipboardAccessPolicy, Frame*);
+
     void setDragImage(CachedImage*, Node*, const IntPoint&);
 
     RetainPtr<NSPasteboard> m_pasteboard;
index 73170d75e003fe7b91bee4be351b1bb28ad0ca1f..bd66787c05a7694d628a8a8c3b482ff50cb515f0 100644 (file)
@@ -91,7 +91,7 @@ String DragData::asPlainText() const
 {
     return m_pasteboardHelper->plainTextFromPasteboard([m_platformDragData draggingPasteboard]);
 }
-    
+
 Color DragData::asColor() const
 {
     NSColor *color = [NSColor colorFromPasteboard:[m_platformDragData draggingPasteboard]];
@@ -99,14 +99,13 @@ Color DragData::asColor() const
                     (int)([color blueComponent] * 255.0 + 0.5), (int)([color alphaComponent] * 255.0 + 0.5));
 }
 
-Clipboard* DragData::createClipboard(ClipboardAccessPolicy policy) const
+PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
 {
-    return new ClipboardMac(true, [m_platformDragData draggingPasteboard], policy);
+    return ClipboardMac::create(true, [m_platformDragData draggingPasteboard], policy, 0);
 }
 
 bool DragData::containsCompatibleContent() const
 {
-    
     NSPasteboard *pasteboard = [m_platformDragData draggingPasteboard];
     NSMutableSet *types = [NSMutableSet setWithArray:[pasteboard types]];
     [types intersectSet:[NSSet setWithArray:m_pasteboardHelper->insertablePasteboardTypes()]];
@@ -122,8 +121,7 @@ String DragData::asURL(String* title) const
 {
     return m_pasteboardHelper->urlFromPasteboard([m_platformDragData draggingPasteboard], title);
 }
-    
-    
+
 PassRefPtr<DocumentFragment> DragData::asFragment(Document* doc) const
 {
     return [m_pasteboardHelper->fragmentFromPasteboard([m_platformDragData draggingPasteboard]) _documentFragment];
index 36e9ade365d8ec636cb27a8c3d7ac1bc32d8b327..bb84c5ebda406387e3794ccf0f57f056534a461d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,8 +26,9 @@
 #ifndef PlatformScrollBar_h
 #define PlatformScrollBar_h
 
-#include "Widget.h"
 #include "ScrollBar.h"
+#include "Widget.h"
+#include <wtf/PassRefPtr.h>
 
 #ifdef __OBJC__
 @class NSScroller;
@@ -40,9 +41,20 @@ namespace WebCore {
 
 class PlatformScrollbar : public Widget, public Scrollbar {
 public:
-    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+    static PassRefPtr<PlatformScrollbar> create(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+    {
+        return adoptRef(new PlatformScrollbar(client, orientation, size));
+    }
     virtual ~PlatformScrollbar();
 
+    bool scrollbarHit(NSScrollerPart);
+
+    static int horizontalScrollbarHeight() { return 15; }
+    static int verticalScrollbarWidth() { return 15; }
+    
+private:    
+    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+
     virtual bool isWidget() const { return true; }
 
     virtual int width() const;
@@ -51,12 +63,6 @@ public:
     virtual void setEnabled(bool);
     virtual void paint(GraphicsContext*, const IntRect& damageRect);
 
-    bool scrollbarHit(NSScrollerPart);
-
-    static int horizontalScrollbarHeight() { return 15; }
-    static int verticalScrollbarWidth() { return 15; }
-    
-protected:    
     virtual void updateThumbPosition();
     virtual void updateThumbProportion();
 };
@@ -64,4 +70,3 @@ protected:
 }
 
 #endif // PlatformScrollBar_h
-
index 74cd5e45a56e46e2a602a71f03cc34d898e97b66..1ea00a7f7cffd7b8e304b15bf7f477a942b3147f 100644 (file)
@@ -37,8 +37,7 @@ namespace WebCore {
 using namespace HTMLNames;
 
 PopupMenu::PopupMenu(PopupMenuClient* client)
-    : RefCounted<PopupMenu>(0)
-    , m_popupClient(client)
+    : m_popupClient(client)
 {
 }
 
index ad965ab70eb6161b6a6dd4b71b149c91bfc3727e..caf040f75bc017b4234d202cc5d4a914bc7ce4a7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,7 +28,6 @@
 
 #include "Clipboard.h"
 #include "CachedResourceClient.h"
-#include "ClipboardAccessPolicy.h"
 
 QT_BEGIN_NAMESPACE
 class QMimeData;
@@ -41,11 +40,15 @@ namespace WebCore {
     // State available during IE's events for drag and drop and copy/paste
     class ClipboardQt : public Clipboard, public CachedResourceClient {
     public:
-        ClipboardQt(ClipboardAccessPolicy policy, const QMimeData* readableClipboard);
-        
-        // Clipboard is writable so it will create its own QMimeData object
-        ClipboardQt(ClipboardAccessPolicy policy, bool forDragging = false);
-        ~ClipboardQt();
+        static PassRefPtr<ClipboardQt> create(ClipboardAccessPolicy policy, const QMimeData* readableClipboard)
+        {
+            return adoptRef(new ClipboardQt(policy, readableClipboard));
+        }
+        static PassRefPtr<ClipboardQt> create(ClipboardAccessPolicy policy, bool forDragging = false)
+        {
+            return adoptRef(new ClipboardQt(policy, forDragging));
+        }
+        virtual ~ClipboardQt();
     
         void clearData(const String& type);
         void clearAllData();
@@ -69,7 +72,12 @@ namespace WebCore {
         void invalidateWritableData() { m_writableData = 0; }
         
     private:
-        void setDragImage(CachedImage* image, Node *node, const IntPoint &loc);
+        ClipboardQt(ClipboardAccessPolicy, const QMimeData* readableClipboard);
+
+        // Clipboard is writable so it will create its own QMimeData object
+        ClipboardQt(ClipboardAccessPolicy, bool forDragging);
+
+        void setDragImage(CachedImage*, Node*, const IntPoint& loc);
         
         const QMimeData* m_readableData;
         QMimeData* m_writableData;
index 5e79801d862cd75be540b9a7d9b2f44166a3ca47..9d95373984149adb28b3c6672a24acbf46afeaf4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -102,9 +102,9 @@ Color DragData::asColor() const
     return qvariant_cast<QColor>(m_platformDragData->colorData());
 }
 
-Clipboard* DragData::createClipboard(ClipboardAccessPolicy policy) const
+PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
 {
-    return new ClipboardQt(policy, m_platformDragData);
+    return ClipboardQt::create(policy, m_platformDragData);
 }
     
 bool DragData::containsCompatibleContent() const
index 3d159402ca64c17fda4411a78e0e31d696c316ea..11611e634824c398c60826f883af721faebd9258 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2007 Staikos Computing Services Inc. <info@staikos.net>
  * Copyright (C) 2007 Trolltech ASA
  *
 #ifndef PlatformScrollbar_h
 #define PlatformScrollbar_h
 
-#include "Widget.h"
 #include "ScrollBar.h"
 #include "Timer.h"
-
+#include "Widget.h"
 #include <QStyleOptionSlider>
+#include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
 class PlatformScrollbar : public Widget, public Scrollbar {
 public:
-    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+    static PassRefPtr<PlatformScrollbar> create(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+    {
+        return adoptRef(new PlatformScrollbar(client, orientation, size));
+    }
     virtual ~PlatformScrollbar();
 
     virtual bool isWidget() const { return true; }
@@ -73,6 +76,8 @@ protected:
     virtual void updateThumbProportion();
 
 private:
+    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+
     int thumbPosition() const;
     int thumbLength() const;
     int trackLength() const;
index 9090ed1a52315ceba968c1ab0710bd69eb87b6e8..9f37ff4148f45649abe32c39a6faeae856a8debc 100644 (file)
@@ -43,8 +43,7 @@
 namespace WebCore {
 
 PopupMenu::PopupMenu(PopupMenuClient* client)
-    : RefCounted<PopupMenu>(0)
-    , m_popupClient(client)
+    : m_popupClient(client)
 {
     m_popup = new QWebPopup(client);
 }
index c737ca1ebbef7d1186394afad824cb77db3088f2..8fe69e2a67b48d7672eb6046e3a826cc7c5eab28 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
  * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
  * Copyright (C) 2006 Zack Rusin <zack@kde.org>
  * Copyright (C) 2006 George Staikos <staikos@kde.org>
@@ -109,7 +109,7 @@ void ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar(bool hasBar)
 {
     if (Scrollbar::hasPlatformScrollbars()) {
         if (hasBar && !m_hBar) {
-            m_hBar = new PlatformScrollbar(this, HorizontalScrollbar, RegularScrollbar);
+            m_hBar = PlatformScrollbar::create(this, HorizontalScrollbar, RegularScrollbar);
             m_view->addChild(m_hBar.get());
         } else if (!hasBar && m_hBar) {
             m_view->removeChild(m_hBar.get());;
@@ -122,7 +122,7 @@ void ScrollView::ScrollViewPrivate::setHasVerticalScrollbar(bool hasBar)
 {
     if (Scrollbar::hasPlatformScrollbars()) {
         if (hasBar && !m_vBar) {
-            m_vBar = new PlatformScrollbar(this, VerticalScrollbar, RegularScrollbar);
+            m_vBar = PlatformScrollbar::create(this, VerticalScrollbar, RegularScrollbar);
             m_view->addChild(m_vBar.get());
         } else if (!hasBar && m_vBar) {
             m_view->removeChild(m_vBar.get());
index 0d6e4481467ee437a006bbeb312a6e0b178ca444..01f7332e30de57d4c7b91d3a00c21987fdbd8d35 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #ifndef ClipboardWin_h
 #define ClipboardWin_h
 
-#include "Clipboard.h"
-
 #include "CachedResourceClient.h"
-#include "IntPoint.h"
+#include "Clipboard.h"
 #include "COMPtr.h"
 
 struct IDataObject;
@@ -43,8 +41,14 @@ namespace WebCore {
     // State available during IE's events for drag and drop and copy/paste
     class ClipboardWin : public Clipboard, public CachedResourceClient {
     public:
-        ClipboardWin(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy);
-        ClipboardWin(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy);
+        static PassRefPtr<ClipboardWin> create(bool isForDragging, IDataObject* dataObject, ClipboardAccessPolicy policy)
+        {
+            return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
+        }
+        static PassRefPtr<ClipboardWin> create(bool isForDragging, WCDataObject* dataObject, ClipboardAccessPolicy policy)
+        {
+            return adoptRef(new ClipboardWin(isForDragging, dataObject, policy));
+        }
         ~ClipboardWin();
     
         void clearData(const String& type);
@@ -66,9 +70,14 @@ namespace WebCore {
         virtual bool hasData();
 
         COMPtr<IDataObject> dataObject() { return m_dataObject; }
+
     private:
+        ClipboardWin(bool isForDragging, IDataObject*, ClipboardAccessPolicy);
+        ClipboardWin(bool isForDragging, WCDataObject*, ClipboardAccessPolicy);
+
         void resetFromClipboard();
         void setDragImage(CachedImage*, Node*, const IntPoint&);
+
         COMPtr<IDataObject> m_dataObject;
         COMPtr<WCDataObject> m_writableDataObject;
         Frame* m_frame;
index 8870c75a516097b12de48a857b0757c9d374961d..05763b7005b39395c607ece1eb98b7e1c1da87fd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -83,7 +83,7 @@ Cursor::Cursor(Image* img, const IntPoint& hotspot)
         ii.hbmMask = hMask.get();
         ii.hbmColor = hCursor.get();
 
-        m_impl = new SharedCursor(CreateIconIndirect(&ii));
+        m_impl = SharedCursor::create(CreateIconIndirect(&ii));
     } else {
         // Platform doesn't support alpha blended cursors, so we need
         // to create the mask manually
@@ -118,7 +118,7 @@ Cursor::Cursor(Image* img, const IntPoint& hotspot)
         icon.yHotspot = hotspot.y();
         icon.hbmMask = andMask.get();
         icon.hbmColor = xorMask.get();
-        m_impl = new SharedCursor(CreateIconIndirect(&icon));
+        m_impl = SharedCursor::create(CreateIconIndirect(&icon));
 
         DeleteDC(xorMaskDC);
         DeleteDC(andMaskDC);
@@ -156,7 +156,7 @@ static Cursor loadCursorByName(char* name, int x, int y)
 
 static PassRefPtr<SharedCursor> loadSharedCursor(HINSTANCE hInstance, LPCTSTR lpCursorName)
 {
-    return new SharedCursor(LoadCursor(hInstance, lpCursorName));
+    return SharedCursor::create(LoadCursor(hInstance, lpCursorName));
 }
 
 const Cursor& pointerCursor()
index 26f72d65f0779709c13ad8617ddf2632ae370e2f..30487b8f01a394f8f18c2d9d3836789cb0685c60 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -39,9 +39,9 @@
 
 namespace WebCore {
 
-Clipboard* DragData::createClipboard(ClipboardAccessPolicy policy) const
+PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
 {
-    return new ClipboardWin(true, m_platformDragData, policy);
+    return ClipboardWin::create(true, m_platformDragData, policy);
 }
 
 bool DragData::containsURL() const
index 5738a640b7c7f64e46630e2f7cacca15645a4841..813eb78ae2202da703b9902af37c605e0353f644 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -45,7 +45,7 @@ PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy)
     if (!SUCCEEDED(OleGetClipboard(&clipboardData)))
         clipboardData = 0;
 
-    return new ClipboardWin(false, clipboardData.get(), policy);
+    return ClipboardWin::create(false, clipboardData.get(), policy);
 }
 
 } // namespace WebCore
index 43f2f950eaa945f0d7869fd9f4fde1a7f580e2aa..106a0495c174492b42546aeafd47ca53b53019e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #ifndef PlatformScrollbar_h
 #define PlatformScrollbar_h
 
-#include "Widget.h"
 #include "ScrollBar.h"
 #include "Timer.h"
+#include "Widget.h"
+#include <wtf/PassRefPtr.h>
 
 typedef struct HDC__* HDC;
 
@@ -38,7 +39,10 @@ enum ScrollbarPart { NoPart, BackButtonPart, BackTrackPart, ThumbPart, ForwardTr
 
 class PlatformScrollbar : public Widget, public Scrollbar {
 public:
-    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+    static PassRefPtr<PlatformScrollbar> create(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+    {
+        return adoptRef(new PlatformScrollbar(client, orientation, size));
+    }
 
     virtual ~PlatformScrollbar();
 
@@ -70,6 +74,8 @@ protected:
     virtual void updateThumbProportion();
 
 private:
+    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+
     bool hasButtons() const;
     bool hasThumb() const;
     IntRect backButtonRect() const;
index ed779ad1f3846afabe7533a5c44e2445dedd57db..9e8f6e109b65348584d9ed6d2c25784db378e8ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -65,8 +65,7 @@ static inline bool isASCIIPrintable(unsigned c)
 }
 
 PopupMenu::PopupMenu(PopupMenuClient* client)
-    : RefCounted<PopupMenu>(0)
-    , m_popupClient(client)
+    : m_popupClient(client)
     , m_scrollBar(0)
     , m_popup(0)
     , m_DC(0)
@@ -118,7 +117,7 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
     if (!m_scrollBar)
         if (visibleItems() < client()->listSize()) {
             // We need a scroll bar
-            m_scrollBar = new PlatformScrollbar(this, VerticalScrollbar, SmallScrollbar);
+            m_scrollBar = PlatformScrollbar::create(this, VerticalScrollbar, SmallScrollbar);
             m_scrollBar->setContainingWindow(m_popup);
         }
 
index f742813eb7de1a5fb532196e8182c1efd77ae0b1..23140a4e9418dd4692065501b648a5174ba094e0 100644 (file)
@@ -105,7 +105,7 @@ void ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar(bool hasBar)
 {
     if (Scrollbar::hasPlatformScrollbars()) {
         if (hasBar && !m_hBar) {
-            m_hBar = new PlatformScrollbar(this, HorizontalScrollbar, RegularScrollbar);
+            m_hBar = PlatformScrollbar::create(this, HorizontalScrollbar, RegularScrollbar);
             m_view->addChild(m_hBar.get());
         } else if (!hasBar && m_hBar) {
             m_view->removeChild(m_hBar.get());
@@ -118,7 +118,7 @@ void ScrollView::ScrollViewPrivate::setHasVerticalScrollbar(bool hasBar)
 {
     if (Scrollbar::hasPlatformScrollbars()) {
         if (hasBar && !m_vBar) {
-            m_vBar = new PlatformScrollbar(this, VerticalScrollbar, RegularScrollbar);
+            m_vBar = PlatformScrollbar::create(this, VerticalScrollbar, RegularScrollbar);
             m_view->addChild(m_vBar.get());
         } else if (!hasBar && m_vBar) {
             m_view->removeChild(m_vBar.get());
index 90b7894b3c4fc3ea1012ca9d9c58010efe118bc7..db5f7a83ee6d21ab7acddb1f6a74cc50b6e3f7e1 100644 (file)
@@ -35,9 +35,11 @@ namespace WebCore {
     // State available during IE's events for drag and drop and copy/paste
     class ClipboardWx : public Clipboard {
     public:
-        ClipboardWx(ClipboardAccessPolicy policy, bool forDragging);
-        ~ClipboardWx() { }
-    
+        static PassRefPtr<ClipboardWx> create(ClipboardAccessPolicy policy, bool forDragging)
+        {
+            return adoptRef(new ClipboardWx(policy, forDragging));
+        }
+
         void clearData(const String& type);
         void clearAllData();
         String getData(const String& type, bool& success) const;
@@ -58,6 +60,9 @@ namespace WebCore {
         virtual void writeRange(Range*, Frame*);
 
         virtual bool hasData();
+
+    private:
+        ClipboardWx(ClipboardAccessPolicy, bool forDragging);
     };
 } 
 
index 3dbb11ba9182fe40758ebb5ec8a5a405365002a6..9c6a4f8e3191b56077d82740af8441580b9919d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #ifndef PlatformScrollbar_h
 #define PlatformScrollbar_h
 
-#include "Widget.h"
 #include "ScrollBar.h"
+#include "Widget.h"
+#include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
 class PlatformScrollbar : public Widget, public Scrollbar {
 public:
-    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+    static PassRefPtr<PlatformScrollbar> create(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+    {
+        return adoptRef(new PlatformScrollbar(client, orientation, size));
+    }
     virtual ~PlatformScrollbar();
 
     virtual bool isWidget() const { return true; }
@@ -50,6 +54,9 @@ public:
 protected:    
     virtual void updateThumbPosition();
     virtual void updateThumbProportion();
+
+private:
+    PlatformScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
 };
 
 }
index dfabadd5b338ea78071bf3022faecfecd3bfc235..0828a01ea0079b6d883a4b4bcc97d6877ee60bd2 100644 (file)
@@ -40,8 +40,7 @@ static int s_menuStartId = wxNewId();
 namespace WebCore {
 
 PopupMenu::PopupMenu(PopupMenuClient* client)
-    : RefCounted<PopupMenu>(0)
-    , m_popupClient(client)
+    : m_popupClient(client)
     , m_menu(NULL)
 {
 }
index c17383df9a45dd06783a64a5b85303fbcea86555..2890af1f560a870de9fb8082e9ceac04d1529b07 100755 (executable)
@@ -146,9 +146,9 @@ void PlatformScrollbar::setRect(const IntRect&) { notImplemented(); }
 void FileChooser::openFileChooser(Document*) { notImplemented(); }
 String FileChooser::basenameForWidth(const Font&, int width) const { notImplemented(); return String(); }
 
-Icon::Icon() : RefCounted<Icon>(0) { notImplemented(); }
+Icon::Icon() { notImplemented(); }
 Icon::~Icon() { notImplemented(); }
-PassRefPtr<Icon> Icon::newIconForFile(const String& filename) { notImplemented(); return PassRefPtr<Icon>(new Icon()); }
+PassRefPtr<Icon> Icon::newIconForFile(const String& filename) { notImplemented(); return 0; }
 void Icon::paint(GraphicsContext*, const IntRect&) { notImplemented(); }
 
 ContextMenu::ContextMenu(const HitTestResult& result) : m_hitTestResult(result) { notImplemented(); }
index c067124b176187c6682cfee6e639ca3c8c7c936f..89a37365cb07916b9cd1e5f9498300af18715d3e 100644 (file)
@@ -1054,7 +1054,7 @@ bool RenderLayer::isActive() const
 PassRefPtr<Scrollbar> RenderLayer::createScrollbar(ScrollbarOrientation orientation)
 {
     if (Scrollbar::hasPlatformScrollbars()) {
-        RefPtr<PlatformScrollbar> widget = new PlatformScrollbar(this, orientation, RegularScrollbar);
+        RefPtr<PlatformScrollbar> widget = PlatformScrollbar::create(this, orientation, RegularScrollbar);
         m_object->document()->view()->addChild(widget.get());
         return widget.release();
     }
index 99fbdbfe9d3f17b54bc75209ab6506b9107cb58b..3c0b422cbdeb72dc65652ee8903ad7b0f7208dff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the select element renderer in WebCore.
  *
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -128,7 +128,7 @@ void RenderListBox::updateFromElement()
         
         if (!m_vBar && Scrollbar::hasPlatformScrollbars())
             if (FrameView* view = node()->document()->view()) {
-                RefPtr<PlatformScrollbar> widget = new PlatformScrollbar(this, VerticalScrollbar, SmallScrollbar);
+                RefPtr<PlatformScrollbar> widget = PlatformScrollbar::create(this, VerticalScrollbar, SmallScrollbar);
                 view->addChild(widget.get());
                 m_vBar = widget.release();
             }
index cbcb2932905446c26fdbbbfbbec3894fcb2dc66c..c8a4e5f085a37603f6281252e51d33d600f20c1e 100644 (file)
@@ -206,7 +206,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
         m_page.set(new Page(dummyChromeClient, dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient));
         m_page->settings()->setJavaScriptEnabled(false);
 
-        m_frame = new Frame(m_page.get(), 0, dummyFrameLoaderClient);
+        m_frame = Frame::create(m_page.get(), 0, dummyFrameLoaderClient);
         m_frameView = new FrameView(m_frame.get());
         m_frameView->deref(); // FIXME: FrameView starts with a refcount of 1
         m_frame->setView(m_frameView.get());
index 3083e8c506df56e7dda15a708711bb1729a76ec7..95adafe690db1040bdaa534a856ffde7c0262ed8 100644 (file)
@@ -229,7 +229,7 @@ public:
     virtual void didFinishLoad() { }
     virtual void prepareForDataSourceReplacement() { }
     
-    virtual PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData) { return new DocumentLoader(request, substituteData); }
+    virtual PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData) { return DocumentLoader::create(request, substituteData); }
     virtual void setTitle(const String& title, const KURL&) { }
     
     virtual String userAgent(const KURL&) { return ""; }
index c920fdc9797028779beb552e1ce0349de357f9de..5d7afb8009e405aa1ff7746a93d20c31f0973faf 100644 (file)
@@ -1,3 +1,16 @@
+2008-06-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam.
+
+        - more https://bugs.webkit.org/show_bug.cgi?id=17257
+          start ref counts at 1 instead of 0 for speed
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::createDocumentLoader): Use create instead of new.
+        * webkit/webkitwebframe.cpp:
+        (webkit_web_frame_new): Ditto.
+        (webkit_web_frame_init_with_web_view): Ditto.
+
 2008-06-13  Darin Adler  <darin@apple.com>
 
         - try to fix build
index b4fc8177267ec8d1f1d9c55c86c76b166a5a1a98..82d5cd49b0acad3c966ff79ae3bab9ce96512ae9 100644 (file)
@@ -149,8 +149,7 @@ String FrameLoaderClient::userAgent(const KURL&)
 
 WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClient::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData)
 {
-    RefPtr<DocumentLoader> loader = new DocumentLoader(request, substituteData);
-    return loader.release();
+    return DocumentLoader::create(request, substituteData);
 }
 
 void FrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction policyFunction, PassRefPtr<FormState>)
index 85f383f55853393165624378dff322ff04e53382..5939786ddec0087646c68c9cfa31e85c112c2c3b 100644 (file)
@@ -220,7 +220,7 @@ WebKitWebFrame* webkit_web_frame_new(WebKitWebView* webView)
 
     priv->webView = webView;
     priv->client = new WebKit::FrameLoaderClient(frame);
-    priv->coreFrame = new Frame(viewPriv->corePage, 0, priv->client);
+    priv->coreFrame = Frame::create(viewPriv->corePage, 0, priv->client).get();
     priv->coreFrame->init();
 
     return frame;
@@ -234,7 +234,7 @@ WebKitWebFrame* webkit_web_frame_init_with_web_view(WebKitWebView* webView, HTML
 
     priv->webView = webView;
     priv->client = new WebKit::FrameLoaderClient(frame);
-    priv->coreFrame = new Frame(viewPriv->corePage, element, priv->client);
+    priv->coreFrame = Frame::create(viewPriv->corePage, element, priv->client).release().releaseRef();
     priv->coreFrame->init();
 
     return frame;
index 3a56d1bbc4e939ce93db69bb9c44cfdd0e7e0e24..7ab8440e9d57aefa27d5b1fc8903d52e0a449526 100644 (file)
@@ -1,3 +1,31 @@
+2008-06-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam.
+
+        - more of https://bugs.webkit.org/show_bug.cgi?id=17257
+          start ref counts at 1 instead of 0 for speed
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::createDocumentLoader): Use create instead of new.
+        (WebFrameLoaderClient::createFrame): Remove now-obsolete adoptRef that was balanced by
+        a ref call inside the Frame constructor. The lifetime rules for Frame are now the
+        conventional ones without a special case.
+
+        * WebView/WebDataSource.mm:
+        (-[WebDataSource _initWithDocumentLoader:]): Changed argument to be a PassRefPtr, since
+        this function takes ownership of the DocumentLoader.
+        (-[WebDataSource initWithRequest:]): Use create instead of new.
+        * WebView/WebDataSourceInternal.h: Changed _initWithDocumentLoader argument to be a
+        PassRefPtr and also cleaned up the header a bit.
+
+        * WebView/WebDocumentLoaderMac.h:
+        (WebDocumentLoaderMac::create): Added. Also made the constructor and a couple of virtual
+        functions private.
+
+        * WebView/WebFrame.mm:
+        (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): Use create instead
+        of new.
+
 2008-06-14  Darin Adler  <darin@apple.com>
 
         Reviewed by Sam.
index 9334a01133125c956b1e97381f801be48212abbb..01b7e9cf7fb58a4926cf266a326f1017f40eedac 100644 (file)
@@ -874,7 +874,7 @@ void WebFrameLoaderClient::prepareForDataSourceReplacement()
 
 PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData)
 {
-    RefPtr<WebDocumentLoaderMac> loader = new WebDocumentLoaderMac(request, substituteData);
+    RefPtr<WebDocumentLoaderMac> loader = WebDocumentLoaderMac::create(request, substituteData);
 
     WebDataSource *dataSource = [[WebDataSource alloc] _initWithDocumentLoader:loader.get()];
     loader->setDataSource(dataSource, getWebView(m_webFrame.get()));
@@ -1082,7 +1082,7 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
 
     WebFrame *newFrame = kit(newCoreFrame.get());
 
-    core(m_webFrame.get())->tree()->appendChild(adoptRef(newCoreFrame.get()));
+    core(m_webFrame.get())->tree()->appendChild(newCoreFrame);
     if ([newFrame _dataSource])
         [[newFrame _dataSource] _documentLoader]->setOverrideEncoding([[m_webFrame.get() _dataSource] _documentLoader]->overrideEncoding());  
 
index c61b87941766abe2b16e8c744985d7945b7b00d7..7f7bd56190309763f4dc64bb87212d496898a60b 100644 (file)
@@ -331,7 +331,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     return _private->loader;
 }
 
-- (id)_initWithDocumentLoader:(WebDocumentLoaderMac *)loader
+- (id)_initWithDocumentLoader:(PassRefPtr<WebDocumentLoaderMac>)loader
 {
     self = [super init];
     if (!self)
@@ -339,8 +339,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     
     _private = [[WebDataSourcePrivate alloc] init];
     
-    _private->loader = loader;
-    loader->ref();
+    _private->loader = loader.releaseRef();
         
     LOG(Loading, "creating datasource for %@", static_cast<NSURL *>(_private->loader->request().url()));
     
@@ -355,7 +354,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 
 - (id)initWithRequest:(NSURLRequest *)request
 {
-    return [self _initWithDocumentLoader:new WebDocumentLoaderMac(request, SubstituteData())];
+    return [self _initWithDocumentLoader:WebDocumentLoaderMac::create(request, SubstituteData())];
 }
 
 - (void)dealloc
index 8779e40b2f55e1c8eca9b79d377f0ddfeda03579..29497d59b1418751579b15bf32456882010e6efc 100644 (file)
  */
 
 #import "WebDataSourcePrivate.h"
+#import <wtf/Forward.h>
 
-#ifdef __cplusplus
 namespace WebCore {
     class DocumentLoader;
 }
-typedef WebCore::DocumentLoader WebCoreDocumentLoader;
+
 class WebDocumentLoaderMac;
-#else
-@class WebCoreDocumentLoader;
-@class WebDocumentLoaderMac;
-#endif
 
 @class DOMDocumentFragment;
 @class DOMElement;
@@ -45,8 +41,6 @@ class WebDocumentLoaderMac;
 @class WebResource;
 @class WebView;
 
-@protocol WebDocumentRepresentation;
-
 @interface WebDataSource (WebInternal)
 - (void)_makeRepresentation;
 - (BOOL)_isDocumentHTML;
@@ -57,10 +51,10 @@ class WebDocumentLoaderMac;
 - (DOMDocumentFragment *)_documentFragmentWithArchive:(WebArchive *)archive;
 + (NSMutableDictionary *)_repTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
 - (void)_replaceSelectionWithArchive:(WebArchive *)archive selectReplacement:(BOOL)selectReplacement;
-- (id)_initWithDocumentLoader:(WebDocumentLoaderMac*)loader;
+- (id)_initWithDocumentLoader:(PassRefPtr<WebDocumentLoaderMac>)loader;
 - (void)_finishedLoading;
 - (void)_receivedData:(NSData *)data;
 - (void)_revertToProvisionalState;
 - (void)_setMainDocumentError:(NSError *)error;
-- (WebCoreDocumentLoader*)_documentLoader;
+- (WebCore::DocumentLoader*)_documentLoader;
 @end
index 9acba890ee147485654023158febda207a28b5b1..83e2bb3ba31b062058f156b392ce1b9261718387 100644 (file)
@@ -39,19 +39,24 @@ namespace WebCore {
 
 class WebDocumentLoaderMac : public WebCore::DocumentLoader {
 public:
-    WebDocumentLoaderMac(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
+    static PassRefPtr<WebDocumentLoaderMac> create(const WebCore::ResourceRequest& request, const WebCore::SubstituteData& data)
+    {
+        return adoptRef(new WebDocumentLoaderMac(request, data));
+    }
 
     void setDataSource(WebDataSource *, WebView*);
     void detachDataSource();
     WebDataSource *dataSource() const;
 
-    virtual void attachToFrame();
-    virtual void detachFromFrame();
-
     void increaseLoadCount(unsigned long identifier);
     void decreaseLoadCount(unsigned long identifier);
 
 private:
+    WebDocumentLoaderMac(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
+
+    virtual void attachToFrame();
+    virtual void detachFromFrame();
+
     void retainDataSource();
     void releaseDataSource();
 
index 393474d3fcf59ae83e40997de90b0172f468e8a0..8130dcad1fbd26308d42a0bbf5ef16900bc0dddb 100644 (file)
@@ -279,7 +279,7 @@ WebView *getWebView(WebFrame *webFrame)
     WebView *webView = kit(page);
 
     WebFrame *frame = [[self alloc] _initWithWebFrameView:frameView webView:webView];
-    RefPtr<Frame> coreFrame = new Frame(page, ownerElement, new WebFrameLoaderClient(frame));
+    RefPtr<Frame> coreFrame = Frame::create(page, ownerElement, new WebFrameLoaderClient(frame));
     [frame release];
     frame->_private->coreFrame = coreFrame.get();
 
index a86fe060f40b24a1ed9348e045379ff41ecb3a2f..460bf323b52d6d93a6c507ff5d33817e79da279f 100644 (file)
@@ -92,7 +92,10 @@ void QWebFramePrivate::init(QWebFrame *qframe, WebCore::Page *webcorePage, QWebF
     marginHeight = frameData->marginHeight;
 
     frameLoaderClient = new FrameLoaderClientQt();
-    frame = new Frame(webcorePage, frameData->ownerElement, frameLoaderClient);
+    RefPtr<Frame> newFrame = Frame::create(webcorePage, frameData->ownerElement, frameLoaderClient)
+    frame = newFrame.get();
+    if (frameData->ownerElement)
+        frame->ref(); // balanced by adoptRef in FrameLoaderClientQt::createFrame
     frameLoaderClient->setFrame(qframe, frame);
     frame->init();
 }
index 93814aca60c046f94878ba93bee84b678ab1f17a..077c583b0438f14a4357149e61bf8a80eaa92496 100644 (file)
@@ -1,3 +1,15 @@
+2008-06-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam.
+
+        - more https://bugs.webkit.org/show_bug.cgi?id=17257
+          start ref counts at 1 instead of 0 for speed
+
+        * Api/qwebframe.cpp:
+        (QWebFramePrivate::init): Use create instead of new.
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::createDocumentLoader): Ditto.
+
 2008-06-13  Darin Adler  <darin@apple.com>
 
         - try to fix build
 
 2007-11-07  Simon Hausmann  <hausmann@kde.org>
 
-        Build fix, reviewed by nobody.
-
         Fix the Qt build by setting up WindowFeatures before calling
         createWindow on the Chrome. This is similar to openNewWindow in
         page/ContextMenuController.cpp
 
 2007-02-18  Oliver Hunt  <oliver@apple.com>
 
-        Reviewed by NOBODY (Buildfix).
-
         Build fix -- adding DragClientQt method stubs
 
         * WebCoreSupport/DragClientQt.cpp:
index 052a8efdb638a358d74e3081a948d117eb8ff1a0..beaa4c8b1c949eb8319cc0f0858c89ea6de44b96 100644 (file)
@@ -751,8 +751,7 @@ bool FrameLoaderClientQt::shouldFallBack(const WebCore::ResourceError&)
 
 WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClientQt::createDocumentLoader(const WebCore::ResourceRequest& request, const SubstituteData& substituteData)
 {
-    RefPtr<DocumentLoader> loader = new DocumentLoader(request, substituteData);
-    return loader.release();
+    return DocumentLoader::create(request, substituteData);
 }
 
 void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&)
index 70ce00975a93953bebb6380f1b11f56a5b013b8f..8a4d276ae18a53e11c00f8446ae5ac6820cf54b9 100644 (file)
@@ -1,3 +1,25 @@
+2008-06-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam.
+
+        - more of https://bugs.webkit.org/show_bug.cgi?id=17257
+          start ref counts at 1 instead of 0 for speed
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::createFrame): Remove now-obsolete adoptRef that was balanced by
+        a ref call inside the Frame constructor. The lifetime rules for Frame are now the
+        conventional ones without a special case.
+
+        * WebFrame.cpp:
+        (WebFrame::init): Renamed function from initWithWebFrameView and removed the unused
+        IWebFrameView argument (every caller was passing 0). Also changed this to return the
+        WebCore Frame object, which is needed to straighten out the lifetime and ownership
+        issues.
+        * WebFrame.h: Ditto.
+
+        * WebView.cpp:
+        (WebView::initWithFrame): Changed to call new init function and use the return value.
+
 2008-06-13  Darin Adler  <darin@apple.com>
 
         Reviewed by John Sullivan.
 
         Update WebKit.sln for the removal of Release dftables
 
-        Reviewed by NOBODY.
-
         * WebKit.vcproj/WebKit.sln:
 
 2007-10-25  Kevin McCullough  <kmccullough@apple.com>
 
         Fix for clean builds needed after r26683
 
-        Reviewed by NOBODY.
-
         * WebView.cpp: Remove #include of non-existant file.
 
 2007-10-17  Anders Carlsson  <andersca@apple.com>
 
 2007-01-11  Brady Eidson  <beidson@apple.com>
 
-        Reviewed by NOBODY.
-        
         Make it build again after my OpenSource http auth checkin
 
         * WebFrame.cpp:
index 5b08768e8dc118a5418941c72c79c7f0f4e2ff34..52add932625633b7482953b46c5786512eadfc6c 100644 (file)
@@ -556,10 +556,7 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& URL, const Strin
 
     COMPtr<WebFrame> webFrame(AdoptCOM, WebFrame::createInstance());
 
-    webFrame->initWithWebFrameView(0, m_webFrame->webView(), coreFrame->page(), ownerElement);
-
-    RefPtr<Frame> childFrame(adoptRef(core(webFrame.get()))); // We have to adopt, because Frames start out with a refcount of 1.
-    ASSERT(childFrame);
+    RefPtr<Frame> childFrame = webFrame->init(m_webFrame->webView(), coreFrame->page(), ownerElement);
 
     coreFrame->tree()->appendChild(childFrame);
     childFrame->tree()->setName(name);
index de694a487d2e88500cdfe7826135dce07ef4bff0..d7e97d8f29ad46825272db173b1451f292ba84d9 100644 (file)
@@ -863,18 +863,18 @@ HRESULT STDMETHODCALLTYPE WebFrame::deselectAll()
 
 // WebFrame ---------------------------------------------------------------
 
-void WebFrame::initWithWebFrameView(IWebFrameView* /*view*/, IWebView* webView, Page* page, HTMLFrameOwnerElement* ownerElement)
+PassRefPtr<Frame> WebFrame::init(IWebView* webView, Page* page, HTMLFrameOwnerElement* ownerElement)
 {
-    if (FAILED(webView->QueryInterface(&d->webView)))
-        return;
+    webView->QueryInterface(&d->webView);
     d->webView->Release(); // don't hold the extra ref
 
     HWND viewWindow;
     d->webView->viewWindow((OLE_HANDLE*)&viewWindow);
 
     this->AddRef(); // We release this ref in frameLoaderDestroyed()
-    Frame* frame = new Frame(page, ownerElement, this);
-    d->frame = frame;
+    RefPtr<Frame> frame = Frame::create(page, ownerElement, this);
+    d->frame = frame.get();
+    return frame.release();
 }
 
 Frame* WebFrame::impl()
index 8e272dfcd66b48ce60d3d7df37d3dfc0dcab7b5c..ff2244dceadc99a9dac12c0fdd7f5bad11ece719 100644 (file)
@@ -278,7 +278,7 @@ public:
     virtual void registerForIconNotification(bool listen);
 
     // WebFrame
-    void initWithWebFrameView(IWebFrameView*, IWebView*, WebCore::Page*, WebCore::HTMLFrameOwnerElement*);
+    PassRefPtr<WebCore::Frame> init(IWebView*, WebCore::Page*, WebCore::HTMLFrameOwnerElement*);
     WebCore::Frame* impl();
     void invalidate();
     void unmarkAllMisspellings();
index 38819767e78d3795e14ff3bd904a05320781dc57..98bee93eb08800882ed60a99561e39bde62562f7 100644 (file)
@@ -2128,12 +2128,12 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
     }
 
     WebFrame* webFrame = WebFrame::createInstance();
-    webFrame->initWithWebFrameView(0 /*FIXME*/, this, m_page, 0);
+    RefPtr<Frame> coreFrame = webFrame->init(this, m_page, 0);
     m_mainFrame = webFrame;
     webFrame->Release(); // The WebFrame is owned by the Frame, so release our reference to it.
 
-    m_page->mainFrame()->tree()->setName(String(frameName, SysStringLen(frameName)));
-    m_page->mainFrame()->init();
+    coreFrame->tree()->setName(String(frameName, SysStringLen(frameName)));
+    coreFrame->init();
     setGroupName(groupName);
 
     addToAllWebViewsSet();
index 4ddb43314141c96c1c0ae83f54a1a5da513b071f..f1ae191627eb394cb23eab84dbfb14b24d140a50 100644 (file)
@@ -1,3 +1,14 @@
+2008-06-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam.
+
+        - more https://bugs.webkit.org/show_bug.cgi?id=17257
+          start ref counts at 1 instead of 0 for speed
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        (WebCore::FrameLoaderClientWx::createDocumentLoader): Use create function
+        instead of new.
+
 2008-06-13  Darin Adler  <darin@apple.com>
 
         - try to fix build
index 0980e23801ab1d4972f5aa0d2c9de83d54d1e9e9..b6d616ac19eadf49bf60bf5565b10e39276c0520 100644 (file)
@@ -628,8 +628,7 @@ bool FrameLoaderClientWx::shouldFallBack(const WebCore::ResourceError& error)
 
 WTF::PassRefPtr<DocumentLoader> FrameLoaderClientWx::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData)
 {
-    RefPtr<DocumentLoader> loader = new DocumentLoader(request, substituteData);
-    return loader.release();
+    return DocumentLoader::create(request, substituteData);
 }
 
 void FrameLoaderClientWx::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&)