[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
jhoneycutt at apple.com
jhoneycutt at apple.com
Wed Mar 17 18:08:51 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit fda303c722540124e64eb5c49e7f139b513d4c0d
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Mar 2 04:14:53 2010 +0000
Remove Windows line endings from some files.
Rubber-stamped by Alice Liu.
* Interfaces/IWebEmbeddedView.idl:
* WebCoreSupport/EmbeddedWidget.cpp:
(EmbeddedWidget::create):
(EmbeddedWidget::~EmbeddedWidget):
(EmbeddedWidget::createWindow):
(EmbeddedWidget::invalidateRect):
(EmbeddedWidget::setFrameRect):
(EmbeddedWidget::frameRectsChanged):
(EmbeddedWidget::setFocus):
(EmbeddedWidget::show):
(EmbeddedWidget::hide):
(EmbeddedWidget::windowClipRect):
(EmbeddedWidget::setParent):
(EmbeddedWidget::attachToWindow):
(EmbeddedWidget::detachFromWindow):
(EmbeddedWidget::didReceiveResponse):
(EmbeddedWidget::didReceiveData):
(EmbeddedWidget::didFinishLoading):
(EmbeddedWidget::didFail):
* WebCoreSupport/EmbeddedWidget.h:
(EmbeddedWidget::EmbeddedWidget):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 525b5bd..f135412 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,5 +1,35 @@
2010-03-01 Jon Honeycutt <jhoneycutt at apple.com>
+ Remove Windows line endings from some files.
+
+ Rubber-stamped by Alice Liu.
+
+ * Interfaces/IWebEmbeddedView.idl:
+
+ * WebCoreSupport/EmbeddedWidget.cpp:
+ (EmbeddedWidget::create):
+ (EmbeddedWidget::~EmbeddedWidget):
+ (EmbeddedWidget::createWindow):
+ (EmbeddedWidget::invalidateRect):
+ (EmbeddedWidget::setFrameRect):
+ (EmbeddedWidget::frameRectsChanged):
+ (EmbeddedWidget::setFocus):
+ (EmbeddedWidget::show):
+ (EmbeddedWidget::hide):
+ (EmbeddedWidget::windowClipRect):
+ (EmbeddedWidget::setParent):
+ (EmbeddedWidget::attachToWindow):
+ (EmbeddedWidget::detachFromWindow):
+ (EmbeddedWidget::didReceiveResponse):
+ (EmbeddedWidget::didReceiveData):
+ (EmbeddedWidget::didFinishLoading):
+ (EmbeddedWidget::didFail):
+
+ * WebCoreSupport/EmbeddedWidget.h:
+ (EmbeddedWidget::EmbeddedWidget):
+
+2010-03-01 Jon Honeycutt <jhoneycutt at apple.com>
+
Some WebKit DOMNode API is unimplemented.
https://bugs.webkit.org/show_bug.cgi?id=35554
diff --git a/WebKit/win/Interfaces/IWebEmbeddedView.idl b/WebKit/win/Interfaces/IWebEmbeddedView.idl
index fb47f60..14b61fd 100644
--- a/WebKit/win/Interfaces/IWebEmbeddedView.idl
+++ b/WebKit/win/Interfaces/IWebEmbeddedView.idl
@@ -1,46 +1,46 @@
-/*
- * Copyright (C) 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
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef DO_NO_IMPORTS
-import "oaidl.idl";
-import "ocidl.idl";
-#endif
-
-[
- object,
- oleautomation,
- uuid(F2771780-84C2-4684-8D52-D4F923E67F71),
- pointer_default(unique)
-]
-interface IWebEmbeddedView : IUnknown
-{
- HRESULT createViewWindow([in] OLE_HANDLE parentWindow, [in] LPSIZE pluginSize, [out, retval] OLE_HANDLE* window);
-
- HRESULT didReceiveResponse([in] IWebURLResponse* response);
- HRESULT didReceiveData([in] IStream* data);
- HRESULT didFinishLoading();
- HRESULT didFail([in] IWebError* error);
-}
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef DO_NO_IMPORTS
+import "oaidl.idl";
+import "ocidl.idl";
+#endif
+
+[
+ object,
+ oleautomation,
+ uuid(F2771780-84C2-4684-8D52-D4F923E67F71),
+ pointer_default(unique)
+]
+interface IWebEmbeddedView : IUnknown
+{
+ HRESULT createViewWindow([in] OLE_HANDLE parentWindow, [in] LPSIZE pluginSize, [out, retval] OLE_HANDLE* window);
+
+ HRESULT didReceiveResponse([in] IWebURLResponse* response);
+ HRESULT didReceiveData([in] IStream* data);
+ HRESULT didFinishLoading();
+ HRESULT didFail([in] IWebError* error);
+}
diff --git a/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp b/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
index 6bd8f44..463a986 100644
--- a/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
+++ b/WebKit/win/WebCoreSupport/EmbeddedWidget.cpp
@@ -1,238 +1,238 @@
-/*
- * Copyright (C) 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
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "EmbeddedWidget.h"
-
-#include <WebCore/Document.h>
-#include <WebCore/Element.h>
-#include <WebCore/FrameView.h>
-#include <WebCore/RenderObject.h>
-
-#include "MemoryStream.h"
-#include "WebError.h"
-#include "WebURLResponse.h"
-
-using namespace WebCore;
-
-PassRefPtr<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, Element* element, HWND parentWindow, const IntSize& size)
-{
- RefPtr<EmbeddedWidget> widget = adoptRef(new EmbeddedWidget(view, element));
-
- widget->createWindow(parentWindow, size);
- return widget.release();
-}
-
-EmbeddedWidget::~EmbeddedWidget()
-{
- if (m_window)
- DestroyWindow(m_window);
-}
-
-bool EmbeddedWidget::createWindow(HWND parentWindow, const IntSize& size)
-{
- ASSERT(!m_window);
-
- HWND window;
-
- SIZE pluginSize(size);
-
- HRESULT hr = m_view->createViewWindow((OLE_HANDLE)parentWindow, &pluginSize, (OLE_HANDLE*)&window);
-
- if (FAILED(hr) || !window)
- return false;
-
- m_window = window;
- return true;
-}
-
-void EmbeddedWidget::invalidateRect(const IntRect& rect)
-{
- if (!m_window)
- return;
-
- RECT r = rect;
- ::InvalidateRect(m_window, &r, false);
-}
-
-void EmbeddedWidget::setFrameRect(const IntRect& rect)
-{
- if (m_element->document()->printing())
- return;
-
- if (rect != frameRect())
- Widget::setFrameRect(rect);
-
- frameRectsChanged();
-}
-
-void EmbeddedWidget::frameRectsChanged()
-{
- if (!parent())
- return;
-
- ASSERT(parent()->isFrameView());
- FrameView* frameView = static_cast<FrameView*>(parent());
-
- IntRect oldWindowRect = m_windowRect;
- IntRect oldClipRect = m_clipRect;
-
- m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size());
- m_clipRect = windowClipRect();
- m_clipRect.move(-m_windowRect.x(), -m_windowRect.y());
-
- if (!m_window)
- return;
-
- if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect)
- return;
-
- HRGN rgn;
-
- // To prevent flashes while scrolling, we disable drawing during the window
- // update process by clipping the window to the zero rect.
-
- bool clipToZeroRect = true;
-
- if (clipToZeroRect) {
- rgn = ::CreateRectRgn(0, 0, 0, 0);
- ::SetWindowRgn(m_window, rgn, FALSE);
- } else {
- rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
- ::SetWindowRgn(m_window, rgn, TRUE);
- }
-
- if (m_windowRect != oldWindowRect)
- ::MoveWindow(m_window, m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE);
-
- if (clipToZeroRect) {
- rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
- ::SetWindowRgn(m_window, rgn, TRUE);
- }
-}
-
-void EmbeddedWidget::setFocus()
-{
- if (m_window)
- SetFocus(m_window);
-
- Widget::setFocus();
-}
-
-void EmbeddedWidget::show()
-{
- m_isVisible = true;
-
- if (m_attachedToWindow && m_window)
- ShowWindow(m_window, SW_SHOWNA);
-
- Widget::show();
-}
-
-void EmbeddedWidget::hide()
-{
- m_isVisible = false;
-
- if (m_attachedToWindow && m_window)
- ShowWindow(m_window, SW_HIDE);
-
- Widget::hide();
-}
-
-IntRect EmbeddedWidget::windowClipRect() const
-{
- // Start by clipping to our bounds.
- IntRect clipRect(m_windowRect);
-
- // Take our element and get the clip rect from the enclosing layer and frame view.
- RenderLayer* layer = m_element->renderer()->enclosingLayer();
- FrameView* parentView = m_element->document()->view();
- clipRect.intersect(parentView->windowClipRectForLayer(layer, true));
-
- return clipRect;
-}
-
-void EmbeddedWidget::setParent(ScrollView* parent)
-{
- Widget::setParent(parent);
-
- if (!m_window)
- return;
-
- if (parent)
- return;
-
- // If the embedded window or one of its children have the focus, we need to
- // clear it to prevent the web view window from being focused because that can
- // trigger a layout while the plugin element is being detached.
- HWND focusedWindow = ::GetFocus();
- if (m_window == focusedWindow || ::IsChild(m_window, focusedWindow))
- ::SetFocus(0);
-}
-
-void EmbeddedWidget::attachToWindow()
-{
- if (m_attachedToWindow)
- return;
-
- m_attachedToWindow = true;
- if (m_isVisible && m_window)
- ShowWindow(m_window, SW_SHOWNA);
-}
-
-void EmbeddedWidget::detachFromWindow()
-{
- if (!m_attachedToWindow)
- return;
-
- if (m_isVisible && m_window)
- ShowWindow(m_window, SW_HIDE);
- m_attachedToWindow = false;
-}
-
-void EmbeddedWidget::didReceiveResponse(const ResourceResponse& response)
-{
- ASSERT(m_view);
-
- COMPtr<IWebURLResponse> urlResponse(AdoptCOM, WebURLResponse::createInstance(response));
- m_view->didReceiveResponse(urlResponse.get());
-}
-
-void EmbeddedWidget::didReceiveData(const char* data, int length)
-{
- COMPtr<MemoryStream> stream = MemoryStream::createInstance(SharedBuffer::create(data, length));
- m_view->didReceiveData(stream.get());
-}
-
-void EmbeddedWidget::didFinishLoading()
-{
- m_view->didFinishLoading();
-}
-
-void EmbeddedWidget::didFail(const ResourceError& error)
-{
- COMPtr<IWebError> webError(AdoptCOM, WebError::createInstance(error));
- m_view->didFail(webError.get());
-}
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "EmbeddedWidget.h"
+
+#include <WebCore/Document.h>
+#include <WebCore/Element.h>
+#include <WebCore/FrameView.h>
+#include <WebCore/RenderObject.h>
+
+#include "MemoryStream.h"
+#include "WebError.h"
+#include "WebURLResponse.h"
+
+using namespace WebCore;
+
+PassRefPtr<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, Element* element, HWND parentWindow, const IntSize& size)
+{
+ RefPtr<EmbeddedWidget> widget = adoptRef(new EmbeddedWidget(view, element));
+
+ widget->createWindow(parentWindow, size);
+ return widget.release();
+}
+
+EmbeddedWidget::~EmbeddedWidget()
+{
+ if (m_window)
+ DestroyWindow(m_window);
+}
+
+bool EmbeddedWidget::createWindow(HWND parentWindow, const IntSize& size)
+{
+ ASSERT(!m_window);
+
+ HWND window;
+
+ SIZE pluginSize(size);
+
+ HRESULT hr = m_view->createViewWindow((OLE_HANDLE)parentWindow, &pluginSize, (OLE_HANDLE*)&window);
+
+ if (FAILED(hr) || !window)
+ return false;
+
+ m_window = window;
+ return true;
+}
+
+void EmbeddedWidget::invalidateRect(const IntRect& rect)
+{
+ if (!m_window)
+ return;
+
+ RECT r = rect;
+ ::InvalidateRect(m_window, &r, false);
+}
+
+void EmbeddedWidget::setFrameRect(const IntRect& rect)
+{
+ if (m_element->document()->printing())
+ return;
+
+ if (rect != frameRect())
+ Widget::setFrameRect(rect);
+
+ frameRectsChanged();
+}
+
+void EmbeddedWidget::frameRectsChanged()
+{
+ if (!parent())
+ return;
+
+ ASSERT(parent()->isFrameView());
+ FrameView* frameView = static_cast<FrameView*>(parent());
+
+ IntRect oldWindowRect = m_windowRect;
+ IntRect oldClipRect = m_clipRect;
+
+ m_windowRect = IntRect(frameView->contentsToWindow(frameRect().location()), frameRect().size());
+ m_clipRect = windowClipRect();
+ m_clipRect.move(-m_windowRect.x(), -m_windowRect.y());
+
+ if (!m_window)
+ return;
+
+ if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect)
+ return;
+
+ HRGN rgn;
+
+ // To prevent flashes while scrolling, we disable drawing during the window
+ // update process by clipping the window to the zero rect.
+
+ bool clipToZeroRect = true;
+
+ if (clipToZeroRect) {
+ rgn = ::CreateRectRgn(0, 0, 0, 0);
+ ::SetWindowRgn(m_window, rgn, FALSE);
+ } else {
+ rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
+ ::SetWindowRgn(m_window, rgn, TRUE);
+ }
+
+ if (m_windowRect != oldWindowRect)
+ ::MoveWindow(m_window, m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE);
+
+ if (clipToZeroRect) {
+ rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
+ ::SetWindowRgn(m_window, rgn, TRUE);
+ }
+}
+
+void EmbeddedWidget::setFocus()
+{
+ if (m_window)
+ SetFocus(m_window);
+
+ Widget::setFocus();
+}
+
+void EmbeddedWidget::show()
+{
+ m_isVisible = true;
+
+ if (m_attachedToWindow && m_window)
+ ShowWindow(m_window, SW_SHOWNA);
+
+ Widget::show();
+}
+
+void EmbeddedWidget::hide()
+{
+ m_isVisible = false;
+
+ if (m_attachedToWindow && m_window)
+ ShowWindow(m_window, SW_HIDE);
+
+ Widget::hide();
+}
+
+IntRect EmbeddedWidget::windowClipRect() const
+{
+ // Start by clipping to our bounds.
+ IntRect clipRect(m_windowRect);
+
+ // Take our element and get the clip rect from the enclosing layer and frame view.
+ RenderLayer* layer = m_element->renderer()->enclosingLayer();
+ FrameView* parentView = m_element->document()->view();
+ clipRect.intersect(parentView->windowClipRectForLayer(layer, true));
+
+ return clipRect;
+}
+
+void EmbeddedWidget::setParent(ScrollView* parent)
+{
+ Widget::setParent(parent);
+
+ if (!m_window)
+ return;
+
+ if (parent)
+ return;
+
+ // If the embedded window or one of its children have the focus, we need to
+ // clear it to prevent the web view window from being focused because that can
+ // trigger a layout while the plugin element is being detached.
+ HWND focusedWindow = ::GetFocus();
+ if (m_window == focusedWindow || ::IsChild(m_window, focusedWindow))
+ ::SetFocus(0);
+}
+
+void EmbeddedWidget::attachToWindow()
+{
+ if (m_attachedToWindow)
+ return;
+
+ m_attachedToWindow = true;
+ if (m_isVisible && m_window)
+ ShowWindow(m_window, SW_SHOWNA);
+}
+
+void EmbeddedWidget::detachFromWindow()
+{
+ if (!m_attachedToWindow)
+ return;
+
+ if (m_isVisible && m_window)
+ ShowWindow(m_window, SW_HIDE);
+ m_attachedToWindow = false;
+}
+
+void EmbeddedWidget::didReceiveResponse(const ResourceResponse& response)
+{
+ ASSERT(m_view);
+
+ COMPtr<IWebURLResponse> urlResponse(AdoptCOM, WebURLResponse::createInstance(response));
+ m_view->didReceiveResponse(urlResponse.get());
+}
+
+void EmbeddedWidget::didReceiveData(const char* data, int length)
+{
+ COMPtr<MemoryStream> stream = MemoryStream::createInstance(SharedBuffer::create(data, length));
+ m_view->didReceiveData(stream.get());
+}
+
+void EmbeddedWidget::didFinishLoading()
+{
+ m_view->didFinishLoading();
+}
+
+void EmbeddedWidget::didFail(const ResourceError& error)
+{
+ COMPtr<IWebError> webError(AdoptCOM, WebError::createInstance(error));
+ m_view->didFail(webError.get());
+}
diff --git a/WebKit/win/WebCoreSupport/EmbeddedWidget.h b/WebKit/win/WebCoreSupport/EmbeddedWidget.h
index 5eee892..7930e0f 100644
--- a/WebKit/win/WebCoreSupport/EmbeddedWidget.h
+++ b/WebKit/win/WebCoreSupport/EmbeddedWidget.h
@@ -1,85 +1,85 @@
-/*
- * Copyright (C) 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
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef EmbeddedWidget_h
-#define EmbeddedWidget_h
-
-#include <WebCore/COMPtr.h>
-#include <WebCore/IntRect.h>
-#include <WebCore/PluginView.h>
-
-namespace WebCore {
- class Element;
- class IntSize;
-}
-
-interface IWebEmbeddedView;
-
-class EmbeddedWidget : public WebCore::Widget, public WebCore::PluginManualLoader {
-public:
- static PassRefPtr<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::Element* element, HWND parentWindow, const WebCore::IntSize&);
- ~EmbeddedWidget();
-
-private:
- EmbeddedWidget(IWebEmbeddedView* view, WebCore::Element* element)
- : m_view(view)
- , m_element(element)
- , m_window(0)
- , m_isVisible(false)
- , m_attachedToWindow(false)
- {
- }
-
- bool createWindow(HWND parentWindow, const WebCore::IntSize& size);
-
- virtual void didReceiveResponse(const WebCore::ResourceResponse&);
- virtual void didReceiveData(const char*, int);
- virtual void didFinishLoading();
- virtual void didFail(const WebCore::ResourceError&);
-
- virtual void invalidateRect(const WebCore::IntRect&);
- virtual void setFrameRect(const WebCore::IntRect&);
- virtual void frameRectsChanged();
- virtual void setFocus();
- virtual void show();
- virtual void hide();
- virtual WebCore::IntRect windowClipRect() const;
- virtual void setParent(WebCore::ScrollView*);
-
- virtual void attachToWindow();
- virtual void detachFromWindow();
-
- COMPtr<IWebEmbeddedView> m_view;
- WebCore::Element* m_element;
- HWND m_window;
-
- bool m_isVisible;
- bool m_attachedToWindow;
-
- WebCore::IntRect m_clipRect; // The clip rect to apply to an embedded view.
- WebCore::IntRect m_windowRect; // Our window rect.
-};
-
-#endif // EmbeddedWidget_h
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef EmbeddedWidget_h
+#define EmbeddedWidget_h
+
+#include <WebCore/COMPtr.h>
+#include <WebCore/IntRect.h>
+#include <WebCore/PluginView.h>
+
+namespace WebCore {
+ class Element;
+ class IntSize;
+}
+
+interface IWebEmbeddedView;
+
+class EmbeddedWidget : public WebCore::Widget, public WebCore::PluginManualLoader {
+public:
+ static PassRefPtr<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::Element* element, HWND parentWindow, const WebCore::IntSize&);
+ ~EmbeddedWidget();
+
+private:
+ EmbeddedWidget(IWebEmbeddedView* view, WebCore::Element* element)
+ : m_view(view)
+ , m_element(element)
+ , m_window(0)
+ , m_isVisible(false)
+ , m_attachedToWindow(false)
+ {
+ }
+
+ bool createWindow(HWND parentWindow, const WebCore::IntSize& size);
+
+ virtual void didReceiveResponse(const WebCore::ResourceResponse&);
+ virtual void didReceiveData(const char*, int);
+ virtual void didFinishLoading();
+ virtual void didFail(const WebCore::ResourceError&);
+
+ virtual void invalidateRect(const WebCore::IntRect&);
+ virtual void setFrameRect(const WebCore::IntRect&);
+ virtual void frameRectsChanged();
+ virtual void setFocus();
+ virtual void show();
+ virtual void hide();
+ virtual WebCore::IntRect windowClipRect() const;
+ virtual void setParent(WebCore::ScrollView*);
+
+ virtual void attachToWindow();
+ virtual void detachFromWindow();
+
+ COMPtr<IWebEmbeddedView> m_view;
+ WebCore::Element* m_element;
+ HWND m_window;
+
+ bool m_isVisible;
+ bool m_attachedToWindow;
+
+ WebCore::IntRect m_clipRect; // The clip rect to apply to an embedded view.
+ WebCore::IntRect m_windowRect; // Our window rect.
+};
+
+#endif // EmbeddedWidget_h
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list