Skip to content
Permalink
Browse files
2011-05-01 Patrick Gansterer <paroga@webkit.org>
        Reviewed by Adam Barth.

        Fix OwnPtr strict issues in windows build
        https://bugs.webkit.org/show_bug.cgi?id=59878

        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
        (WebCore::getDirtyRects):
        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):
        * platform/graphics/win/WKCAImageQueue.cpp:
        (WebCore::WKCAImageQueue::WKCAImageQueue):
        * platform/win/CursorWin.cpp:
        (WebCore::createSharedCursor):
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::writeImage):
2011-05-01  Patrick Gansterer  <paroga@webkit.org>

        Reviewed by Adam Barth.

        Fix OwnPtr strict issues in windows build
        https://bugs.webkit.org/show_bug.cgi?id=59878

        * FullscreenVideoController.cpp:
        (FullscreenVideoController::FullscreenVideoController):
        (FullscreenVideoController::createHUDWindow):
        * WebCoreSupport/WebInspectorClient.cpp:
        (WebInspectorClient::highlight):
        * WebElementPropertyBag.cpp:
        (WebElementPropertyBag::WebElementPropertyBag):
        * WebNodeHighlight.cpp:
        (WebNodeHighlight::update):
        * WebNotificationCenter.cpp:
        (WebNotificationCenter::WebNotificationCenter):
        * WebView.cpp:
        (WebView::close):
        (WebView::paint):
        (WebView::handleMouseEvent):
        (WebView::registerEmbeddedViewMIMEType):

Canonical link: https://commits.webkit.org/75125@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@85420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
paroga committed May 1, 2011
1 parent f03979d commit 0e1336ea7a0c333dbe9c2e2c965b612eababa7e7
Showing 13 changed files with 70 additions and 25 deletions.
@@ -1,3 +1,21 @@
2011-05-01 Patrick Gansterer <paroga@webkit.org>

Reviewed by Adam Barth.

Fix OwnPtr strict issues in windows build
https://bugs.webkit.org/show_bug.cgi?id=59878

* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::getDirtyRects):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext):
* platform/graphics/win/WKCAImageQueue.cpp:
(WebCore::WKCAImageQueue::WKCAImageQueue):
* platform/win/CursorWin.cpp:
(WebCore::createSharedCursor):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeImage):

2011-05-01 Patrick Gansterer <paroga@webkit.org>

Reviewed by Eric Seidel.
@@ -239,7 +239,7 @@ static void getDirtyRects(HWND window, Vector<CGRect>& outRects)
if (!GetClientRect(window, &clientRect))
return;

OwnPtr<HRGN> region(CreateRectRgn(0, 0, 0, 0));
OwnPtr<HRGN> region = adoptPtr(CreateRectRgn(0, 0, 0, 0));
int regionType = GetUpdateRgn(window, region.get(), false);
if (regionType != COMPLEXREGION) {
RECT dirtyRect;
@@ -173,12 +173,12 @@ MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualConte
, m_isStreaming(false)
, m_visible(false)
, m_newFrameAvailable(false)
, m_movieClient(new MediaPlayerPrivateQuickTimeVisualContext::MovieClient(this))
, m_movieClient(adoptPtr(new MediaPlayerPrivateQuickTimeVisualContext::MovieClient(this)))
#if USE(ACCELERATED_COMPOSITING)
, m_layerClient(new MediaPlayerPrivateQuickTimeVisualContext::LayerClient(this))
, m_layerClient(adoptPtr(new MediaPlayerPrivateQuickTimeVisualContext::LayerClient(this)))
, m_movieTransform(CGAffineTransformIdentity)
#endif
, m_visualContextClient(new MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient(this))
, m_visualContextClient(adoptPtr(new MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient(this)))
, m_delayingLoad(false)
, m_privateBrowsing(false)
, m_preload(MediaPlayer::Auto)
@@ -30,6 +30,7 @@

#include <CoreFoundation/CoreFoundation.h>
#include <WebKitSystemInterface/WebKitSystemInterface.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RetainPtr.h>

namespace WebCore {
@@ -53,13 +54,13 @@ static void WKCAImageQueueRelease(CAImageQueueRef iq)
}

WKCAImageQueue::WKCAImageQueue(uint32_t width, uint32_t height, uint32_t capacity)
: m_private(new WKCAImageQueuePrivate())
: m_private(adoptPtr(new WKCAImageQueuePrivate()))
{
m_private->m_imageQueue.adoptCF(wkCAImageQueueCreate(width, height, capacity));
}

WKCAImageQueue::WKCAImageQueue(const WKCAImageQueue& o)
: m_private(new WKCAImageQueuePrivate())
: m_private(adoptPtr(new WKCAImageQueuePrivate()))
{
m_private->m_imageQueue = o.m_private->m_imageQueue;
}
@@ -33,6 +33,7 @@
#include "SystemInfo.h"

#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>

#include <windows.h>

@@ -51,7 +52,7 @@ static PassRefPtr<SharedCursor> createSharedCursor(Image* img, const IntPoint& h
HDC dc = GetDC(0);
HDC workingDC = CreateCompatibleDC(dc);
if (doAlpha) {
OwnPtr<HBITMAP> hCursor(CreateDIBSection(dc, (BITMAPINFO *)&cursorImage, DIB_RGB_COLORS, 0, 0, 0));
OwnPtr<HBITMAP> hCursor = adoptPtr(CreateDIBSection(dc, (BITMAPINFO *)&cursorImage, DIB_RGB_COLORS, 0, 0, 0));
ASSERT(hCursor);

img->getHBITMAP(hCursor.get());
@@ -61,7 +62,7 @@ static PassRefPtr<SharedCursor> createSharedCursor(Image* img, const IntPoint& h

Vector<unsigned char, 128> maskBits;
maskBits.fill(0xff, (img->width() + 7) / 8 * img->height());
OwnPtr<HBITMAP> hMask(CreateBitmap(img->width(), img->height(), 1, 1, maskBits.data()));
OwnPtr<HBITMAP> hMask = adoptPtr(CreateBitmap(img->width(), img->height(), 1, 1, maskBits.data()));

ICONINFO ii;
ii.fIcon = FALSE;
@@ -76,13 +77,13 @@ static PassRefPtr<SharedCursor> createSharedCursor(Image* img, const IntPoint& h
// to create the mask manually
HDC andMaskDC = CreateCompatibleDC(dc);
HDC xorMaskDC = CreateCompatibleDC(dc);
OwnPtr<HBITMAP> hCursor(CreateDIBSection(dc, &cursorImage, DIB_RGB_COLORS, 0, 0, 0));
OwnPtr<HBITMAP> hCursor = adoptPtr(CreateDIBSection(dc, &cursorImage, DIB_RGB_COLORS, 0, 0, 0));
ASSERT(hCursor);
img->getHBITMAP(hCursor.get());
BITMAP cursor;
GetObject(hCursor.get(), sizeof(BITMAP), &cursor);
OwnPtr<HBITMAP> andMask(CreateBitmap(cursor.bmWidth, cursor.bmHeight, 1, 1, NULL));
OwnPtr<HBITMAP> xorMask(CreateCompatibleBitmap(dc, cursor.bmWidth, cursor.bmHeight));
OwnPtr<HBITMAP> andMask = adoptPtr(CreateBitmap(cursor.bmWidth, cursor.bmHeight, 1, 1, NULL));
OwnPtr<HBITMAP> xorMask = adoptPtr(CreateCompatibleBitmap(dc, cursor.bmWidth, cursor.bmHeight));
HBITMAP oldCursor = (HBITMAP)SelectObject(workingDC, hCursor.get());
HBITMAP oldAndMask = (HBITMAP)SelectObject(andMaskDC, andMask.get());
HBITMAP oldXorMask = (HBITMAP)SelectObject(xorMaskDC, xorMask.get());
@@ -221,7 +221,7 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&)
HDC dc = GetDC(0);
HDC compatibleDC = CreateCompatibleDC(0);
HDC sourceDC = CreateCompatibleDC(0);
OwnPtr<HBITMAP> resultBitmap(CreateCompatibleBitmap(dc, image->width(), image->height()));
OwnPtr<HBITMAP> resultBitmap = adoptPtr(CreateCompatibleBitmap(dc, image->width(), image->height()));
HGDIOBJ oldBitmap = SelectObject(compatibleDC, resultBitmap.get());

BitmapInfo bmInfo = BitmapInfo::create(image->size());
@@ -1,3 +1,27 @@
2011-05-01 Patrick Gansterer <paroga@webkit.org>

Reviewed by Adam Barth.

Fix OwnPtr strict issues in windows build
https://bugs.webkit.org/show_bug.cgi?id=59878

* FullscreenVideoController.cpp:
(FullscreenVideoController::FullscreenVideoController):
(FullscreenVideoController::createHUDWindow):
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorClient::highlight):
* WebElementPropertyBag.cpp:
(WebElementPropertyBag::WebElementPropertyBag):
* WebNodeHighlight.cpp:
(WebNodeHighlight::update):
* WebNotificationCenter.cpp:
(WebNotificationCenter::WebNotificationCenter):
* WebView.cpp:
(WebView::close):
(WebView::paint):
(WebView::handleMouseEvent):
(WebView::registerEmbeddedViewMIMEType):

2011-04-29 Jer Noble <jer.noble@apple.com>

Reviewed by Adam Roben.
@@ -242,10 +242,10 @@ FullscreenVideoController::FullscreenVideoController()
, m_movingWindow(false)
, m_timer(this, &FullscreenVideoController::timerFired)
#if USE(ACCELERATED_COMPOSITING)
, m_layerClient(new LayerClient(this))
, m_layerClient(adoptPtr(new LayerClient(this)))
, m_rootChild(PlatformCALayer::create(PlatformCALayer::LayerTypeLayer, m_layerClient.get()))
#endif
, m_fullscreenWindow(new MediaPlayerPrivateFullscreenWindow(this))
, m_fullscreenWindow(adoptPtr(new MediaPlayerPrivateFullscreenWindow(this)))
{
}

@@ -437,8 +437,8 @@ void FullscreenVideoController::createHUDWindow()
// will get cleaned up when m_bitmap is destroyed in the dtor
void* pixels;
BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(IntSize(windowWidth, windowHeight));
m_bitmap.set(::CreateDIBSection(0, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0));
m_bitmap = adoptPtr(::CreateDIBSection(0, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0));

// Dirty the window so the HUD draws
RECT clearRect = { m_hudPosition.x(), m_hudPosition.y(), m_hudPosition.x() + windowWidth, m_hudPosition.y() + windowHeight };
InvalidateRect(m_fullscreenWindow->hwnd(), &clearRect, true);
@@ -181,7 +181,7 @@ void WebInspectorClient::highlight(Node*)
bool creatingHighlight = !m_highlight;

if (creatingHighlight)
m_highlight.set(new WebNodeHighlight(m_inspectedWebView));
m_highlight = adoptPtr(new WebNodeHighlight(m_inspectedWebView));

if (m_highlight->isShowing())
m_highlight->update();
@@ -42,7 +42,7 @@ using namespace WebCore;

// WebElementPropertyBag -----------------------------------------------
WebElementPropertyBag::WebElementPropertyBag(const HitTestResult& result)
: m_result(new HitTestResult(result))
: m_result(adoptPtr(new HitTestResult(result)))
, m_refCount(0)
{
gClassCount++;
@@ -148,7 +148,7 @@ void WebNodeHighlight::update()
BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(IntSize(size));

void* pixels = 0;
OwnPtr<HBITMAP> hbmp(::CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0));
OwnPtr<HBITMAP> hbmp = adoptPtr(::CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0));

::SelectObject(hdc, hbmp.get());

@@ -32,6 +32,7 @@
#include <WebCore/PlatformString.h>
#include <wtf/HashMap.h>
#include <wtf/HashTraits.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/StringHash.h>
#include <utility>
@@ -54,7 +55,7 @@ IWebNotificationCenter* WebNotificationCenter::m_defaultCenter = 0;

WebNotificationCenter::WebNotificationCenter()
: m_refCount(0)
, d(new WebNotificationCenterPrivate)
, d(adoptPtr(new WebNotificationCenterPrivate))
{
gClassCount++;
gClassNameCount.add("WebNotificationCenter");
@@ -680,7 +680,7 @@ HRESULT STDMETHODCALLTYPE WebView::close()
if (m_mouseOutTracker) {
m_mouseOutTracker->dwFlags = TME_CANCEL;
::TrackMouseEvent(m_mouseOutTracker.get());
m_mouseOutTracker.set(0);
m_mouseOutTracker.clear();
}

revokeDragDrop();
@@ -1050,7 +1050,7 @@ void WebView::paint(HDC dc, LPARAM options)
PAINTSTRUCT ps;
WindowsToPaint windowsToPaint;
if (!dc) {
region.set(CreateRectRgn(0,0,0,0));
region = adoptPtr(CreateRectRgn(0,0,0,0));
regionType = GetUpdateRgn(m_viewWindow, region.get(), false);
hdc = BeginPaint(m_viewWindow, &ps);
rcPaint = ps.rcPaint;
@@ -1499,7 +1499,7 @@ bool WebView::handleMouseEvent(UINT message, WPARAM wParam, LPARAM lParam)
} else if (message == WM_MOUSELEAVE && m_mouseOutTracker) {
// Once WM_MOUSELEAVE is fired windows clears this tracker
// so there is no need to disable it ourselves.
m_mouseOutTracker.set(0);
m_mouseOutTracker.clear();
m_page->mainFrame()->eventHandler()->mouseMoved(mouseEvent);
handled = true;
} else if (message == WM_MOUSEMOVE) {
@@ -1508,7 +1508,7 @@ bool WebView::handleMouseEvent(UINT message, WPARAM wParam, LPARAM lParam)
mouseEvent.setClickCount(globalClickCount);
handled = m_page->mainFrame()->eventHandler()->mouseMoved(mouseEvent);
if (!m_mouseOutTracker) {
m_mouseOutTracker.set(new TRACKMOUSEEVENT);
m_mouseOutTracker = adoptPtr(new TRACKMOUSEEVENT);
m_mouseOutTracker->cbSize = sizeof(TRACKMOUSEEVENT);
m_mouseOutTracker->dwFlags = TME_LEAVE;
m_mouseOutTracker->hwndTrack = m_viewWindow;
@@ -6026,7 +6026,7 @@ HRESULT STDMETHODCALLTYPE WebView::registerEmbeddedViewMIMEType(BSTR mimeType)
return E_POINTER;

if (!m_embeddedViewMIMETypes)
m_embeddedViewMIMETypes.set(new HashSet<String>);
m_embeddedViewMIMETypes = adoptPtr(new HashSet<String>);

m_embeddedViewMIMETypes->add(String(mimeType, ::SysStringLen(mimeType)));
return S_OK;

0 comments on commit 0e1336e

Please sign in to comment.