Reviewed by Steve.
- <rdar://
5656485> Drosera: Win: Nightly does not reliably connect to
WebKit.
- Drosera and Safari need to use the same ProgIDs in order for
CoCreateInstance to work properly. The most robust way to do this is
for WebKit to dynamically publish those ProgIDs.
* ForEachCoClass.cpp: Added.
(setUseOpenSourceWebKit):
(progIDForClass):
* ForEachCoClass.h: Added functionality to publish ProgIDs.
* WebKit.vcproj/WebKit.def: Exposed added functions for applications.
* WebKit.vcproj/WebKit.vcproj: Added ForEachCoClass.cpp
* WebKit.vcproj/WebKit_debug.def: Exposed added functions fori
applications.
WebKitTools:
Reviewed by Steve.
- <rdar://
5656485> Drosera: Win: Nightly does not reliably connect to
WebKit.
- Drosera and Safari need to use the same ProgIDs in order for
CoCreateInstance to work properly. The most robust way to do this is
for WebKit to dynamically publish those ProgIDs.
* Drosera/win/DebuggerClient.cpp: Use the published ProgIDs
(DebuggerClient::createWebViewWithRequest):
* Drosera/win/Drosera.cpp: Use the published ProgIDs and rename some
statics.
(Drosera::initUI):
(Drosera::attach):
(Drosera::attemptToCreateServerConnection):
* Drosera/win/Drosera.vcproj/Drosera.vcproj: Fix a runtime failure.
* Drosera/win/ServerConnection.cpp: Reformat the connection function and
make use of the published ProgIDs.
(ServerConnection::attemptToCreateServerConnection):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28910
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-12-20 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Steve.
+
+ - <rdar://5656485> Drosera: Win: Nightly does not reliably connect to
+ WebKit.
+
+ - Drosera and Safari need to use the same ProgIDs in order for
+ CoCreateInstance to work properly. The most robust way to do this is
+ for WebKit to dynamically publish those ProgIDs.
+
+ * ForEachCoClass.cpp: Added.
+ (setUseOpenSourceWebKit):
+ (progIDForClass):
+ * ForEachCoClass.h: Added functionality to publish ProgIDs.
+ * WebKit.vcproj/WebKit.def: Exposed added functions for applications.
+ * WebKit.vcproj/WebKit.vcproj: Added ForEachCoClass.cpp
+ * WebKit.vcproj/WebKit_debug.def: Exposed added functions fori
+ applications.
+
2007-12-19 Dave Hyatt <hyatt@apple.com>
Add a fourth preference value for GDI text in the font smoothing prefs.
--- /dev/null
+/*
+ * Copyright (C) 2007 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebKitDLL.h"
+#include "ForEachCoClass.h"
+
+#include <JavaScriptCore/Assertions.h>
+
+void setUseOpenSourceWebKit(bool b)
+{
+ s_progIDs = b ? openSourceProgIDs : productionProgIDs;
+}
+
+LPCOLESTR progIDForClass(WebKitClass cls)
+{
+ ASSERT(cls < WebKitClassSentinel);
+ return s_progIDs[cls];
+}
+
+
#ifndef ForEachCoClass_h
#define ForEachCoClass_h
+#include <WebKit/ProgIDMacros.h>
+
#define FOR_EACH_COCLASS(macro) \
macro(CFDictionaryPropertyBag) \
macro(WebCache) \
macro(WebView) \
// end of macro
+#define WEBKITCLASS_MEMBER(cls) cls##Class,
+enum WebKitClass {
+ FOR_EACH_COCLASS(WEBKITCLASS_MEMBER)
+ WebKitClassSentinel
+};
+#undef WEBKITCLASS_MEMBER
+
+#define PRODUCTION_PROGID(cls) VERSION_INDEPENDENT_PRODUCTION_PROGID(cls),
+static LPCOLESTR productionProgIDs[WebKitClassSentinel] = {
+ FOR_EACH_COCLASS(PRODUCTION_PROGID)
+};
+#undef PRODUCTION_PROGID
+
+#define OPENSOURCE_PROGID(cls) VERSION_INDEPENDENT_OPENSOURCE_PROGID(cls),
+static LPCOLESTR openSourceProgIDs[WebKitClassSentinel] = {
+ FOR_EACH_COCLASS(OPENSOURCE_PROGID)
+};
+#undef OPENSOURCE_PROGID
+
+#if __PRODUCTION__
+ static LPCOLESTR* s_progIDs = productionProgIDs;
+#else
+ static LPCOLESTR* s_progIDs = openSourceProgIDs;
+#endif
+
+#define PROGID(className) progIDForClass(className##Class)
+
+void setUseOpenSourceWebKit(bool);
+LPCOLESTR progIDForClass(WebKitClass);
+
+
+
#endif // !defined(ForEachCoClass_h)
; KJS_JSObject_JSObjectSetMember
; KJS_JSObject_JSObjectSetSlot
; KJS_JSObject_JSObjectToString
+ setUseOpenSourceWebKit
+ progIDForClass
WebLocalizedStringUTF8
WebLocalizedLPCTSTRUTF8
DrawTextAtPoint
RelativePath="..\DOMHTMLClasses.cpp"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\ForEachCoClass.cpp"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\HTTPHeaderPropertyBag.cpp"\r
>\r
; KJS_JSObject_JSObjectSetMember
; KJS_JSObject_JSObjectSetSlot
; KJS_JSObject_JSObjectToString
+ setUseOpenSourceWebKit
+ progIDForClass
WebLocalizedStringUTF8
WebLocalizedLPCTSTRUTF8
DrawTextAtPoint
+2007-12-20 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Steve.
+
+ - <rdar://5656485> Drosera: Win: Nightly does not reliably connect to
+ WebKit.
+
+ - Drosera and Safari need to use the same ProgIDs in order for
+ CoCreateInstance to work properly. The most robust way to do this is
+ for WebKit to dynamically publish those ProgIDs.
+
+ * Drosera/win/DebuggerClient.cpp: Use the published ProgIDs
+ (DebuggerClient::createWebViewWithRequest):
+ * Drosera/win/Drosera.cpp: Use the published ProgIDs and rename some
+ statics.
+ (Drosera::initUI):
+ (Drosera::attach):
+ (Drosera::attemptToCreateServerConnection):
+ * Drosera/win/Drosera.vcproj/Drosera.vcproj: Fix a runtime failure.
+ * Drosera/win/ServerConnection.cpp: Reformat the connection function and
+ make use of the published ProgIDs.
+ (ServerConnection::attemptToCreateServerConnection):
+
2007-12-20 Kevin McCullough <kmccullough@apple.com>
- <rdar://problem/5658317> REGRESSION: 20+ leaks seen on buildbots.
#include "Drosera.h"
#include "ServerConnection.h"
+#include <WebKit/ForEachCoClass.h>
#include <WebKit/IWebView.h>
#include <WebKit/IWebViewPrivate.h>
#include <WebKit/WebKit.h>
if (FAILED(ret))
return ret;
+ CLSID clsid = CLSID_NULL;
+ ret = CLSIDFromProgID(PROGID(WebView), &clsid);
+ if (FAILED(ret))
+ return ret;
+
COMPtr<IWebView> view;
- ret = CoCreateInstance(CLSID_WebView, 0, CLSCTX_ALL, IID_IWebView, (void**)&view);
+ ret = CoCreateInstance(clsid, 0, CLSCTX_ALL, IID_IWebView, (void**)&view);
if (FAILED(ret))
return ret;
#include "ServerConnection.h"
#include <JavaScriptCore/JSStringRef.h>
+#include <WebKit/ForEachCoClass.h>
#include <WebKit/IWebMutableURLRequest.h>
#include <WebKit/IWebView.h>
#include <WebKit/WebKit.h>
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
-static const LRESULT kNotHandledResult = -1;
-static LPCTSTR kDroseraPointerProp = TEXT("DroseraPointer");
+static LPCTSTR s_DroseraPointerProp = TEXT("DroseraPointer");
static HINSTANCE hInst;
BSTR cfStringToBSTR(CFStringRef cfstr);
if (FAILED(ret))
return ret;
- ret = CoCreateInstance(CLSID_WebView, 0, CLSCTX_ALL, IID_IWebView, (void**)&m_webView);
+ CLSID clsid = CLSID_NULL;
+ ret = CLSIDFromProgID(PROGID(WebView), &clsid);
+ if (FAILED(ret))
+ return ret;
+
+ ret = CoCreateInstance(clsid, 0, CLSCTX_ALL, IID_IWebView, (void**)&m_webView);
if (FAILED(ret))
return ret;
if (FAILED(ret))
return ret;
- ::SetProp(viewWindow, kDroseraPointerProp, (HANDLE)this);
+ SetProp(viewWindow, s_DroseraPointerProp, (HANDLE)this);
// FIXME: Implement window size/position save/restore
ShowWindow(m_hWnd, nCmdShow);
if (FAILED(ret))
return ret;
+ CLSID clsid = CLSID_NULL;
+ ret = CLSIDFromProgID(PROGID(WebMutableURLRequest), &clsid);
+ if (FAILED(ret))
+ return ret;
+
COMPtr<IWebMutableURLRequest> request;
- ret = CoCreateInstance(CLSID_WebMutableURLRequest, 0, CLSCTX_ALL, IID_IWebMutableURLRequest, (void**)&request);
+ ret = CoCreateInstance(clsid, 0, CLSCTX_ALL, IID_IWebMutableURLRequest, (void**)&request);
if (FAILED(ret))
return ret;
MinimalRebuild="true"\r
ExceptionHandling="1"\r
BasicRuntimeChecks="3"\r
- RuntimeLibrary="3"\r
+ RuntimeLibrary="2"\r
RuntimeTypeInfo="false"\r
UsePrecompiledHeader="2"\r
PrecompiledHeaderThrough="DroseraPrefix.h"\r
#include <JavaScriptCore/JSRetainPtr.h>
#include <JavaScriptCore/JSStringRefBSTR.h>
#include <JavaScriptCore/RetainPtr.h>
+#include <WebKit/ForEachCoClass.h>
#include <WebKit/IWebScriptCallFrame.h>
#include <WebKit/IWebScriptDebugServer.h>
#include <WebKit/WebKit.h>
void ServerConnection::attemptToCreateServerConnection(JSGlobalContextRef globalContextRef)
{
COMPtr<IWebScriptDebugServer> tempServer;
- if (SUCCEEDED(CoCreateInstance(CLSID_WebScriptDebugServer, 0, CLSCTX_LOCAL_SERVER, IID_IWebScriptDebugServer, (void**)&tempServer))) {
- if (FAILED(tempServer->sharedWebScriptDebugServer(&m_server)))
- return;
- if (FAILED(m_server->addListener(this))) {
- m_server = 0;
- return;
- }
+ CLSID clsid = CLSID_NULL;
+ if (FAILED(CLSIDFromProgID(PROGID(WebScriptDebugServer), &clsid)))
+ return;
+
+ if (FAILED(CoCreateInstance(clsid, 0, CLSCTX_LOCAL_SERVER, IID_IWebScriptDebugServer, (void**)&tempServer)))
+ return;
- m_serverConnected = true;
+ if (FAILED(tempServer->sharedWebScriptDebugServer(&m_server)))
+ return;
- if (globalContextRef)
- m_globalContext = JSGlobalContextRetain(globalContextRef);
+ if (FAILED(m_server->addListener(this))) {
+ m_server = 0;
+ return;
}
+
+ m_serverConnected = true;
+
+ if (globalContextRef)
+ m_globalContext = JSGlobalContextRetain(globalContextRef);
}
void ServerConnection::setGlobalContext(JSGlobalContextRef globalContextRef)