Changeset 80240 in webkit
- Timestamp:
- Mar 3, 2011 8:21:05 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r80218 r80240 1 2011-03-03 Adam Roben <aroben@apple.com> 2 3 Create the CFBundleRef for WebKit.dll on Windows if needed 4 5 WebKit part of <http://webkit.org/b/55672> <rdar://problem/9080867> All inspector tests time 6 out or crash on Windows 7 Release (WebKit2 Tests) 7 8 Reviewed by Darin Adler. 9 10 * Shared/win/WebKitBundle.cpp: Added. 11 (WebKit::createWebKitBundle): Returns a pre-existing bundle, if possible, otherwise creates 12 and returns a new bundle. 13 (WebKit::webKitBundle): Creates and caches a bundle, and returns it. 14 15 * Shared/win/WebKitBundle.h: Added. 16 17 * UIProcess/win/WebInspectorProxyWin.cpp: 18 (WebKit::WebInspectorProxy::inspectorPageURL): 19 * WebProcess/WebPage/win/WebInspectorWin.cpp: 20 (WebKit::WebInspector::localizedStringsURL): 21 Changed to use webKitBundle() to ensure that the bundle has been created. 22 23 * win/WebKit2.vcproj: Added new files. 24 1 25 2011-03-03 Peter Kasting <pkasting@google.com> 2 26 -
trunk/Source/WebKit2/Shared/win/WebKitBundle.cpp
r80237 r80240 1 1 /* 2 * Copyright (C) 201 0Apple Inc. All rights reserved.2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #include "config.h" 27 #include "Web Inspector.h"27 #include "WebKitBundle.h" 28 28 29 #if ENABLE(INSPECTOR) 29 #include <CoreFoundation/CFBundle.h> 30 #include <wtf/RetainPtr.h> 31 #include <wtf/StdLibExtras.h> 30 32 31 #include <wtf/RetainPtr.h> 32 #include <wtf/text/WTFString.h> 33 extern "C" HINSTANCE gInstance; 33 34 34 35 namespace WebKit { 35 36 36 String WebInspector::localizedStringsURL() const 37 static CFBundleRef createWebKitBundle() 37 38 { 38 RetainPtr<CFURLRef> localizedStringsURLRef(AdoptCF, CFBundleCopyResourceURL(CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit")), CFSTR("localizedStrings"), CFSTR("js"), 0)); 39 if (!localizedStringsURLRef) 40 return String(); 39 if (CFBundleRef existingBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit"))) { 40 CFRetain(existingBundle); 41 return existingBundle; 42 } 41 43 42 return String(CFURLGetString(localizedStringsURLRef.get())); 44 wchar_t dllPathBuffer[MAX_PATH]; 45 DWORD length = ::GetModuleFileNameW(gInstance, dllPathBuffer, WTF_ARRAY_LENGTH(dllPathBuffer)); 46 ASSERT(length && length < WTF_ARRAY_LENGTH(dllPathBuffer)); 47 48 RetainPtr<CFStringRef> dllPath(AdoptCF, CFStringCreateWithCharactersNoCopy(0, reinterpret_cast<const UniChar*>(dllPathBuffer), length, kCFAllocatorNull)); 49 RetainPtr<CFURLRef> dllURL(AdoptCF, CFURLCreateWithFileSystemPath(0, dllPath.get(), kCFURLWindowsPathStyle, false)); 50 RetainPtr<CFURLRef> dllDirectoryURL(AdoptCF, CFURLCreateCopyDeletingLastPathComponent(0, dllURL.get())); 51 RetainPtr<CFURLRef> resourcesDirectoryURL(AdoptCF, CFURLCreateCopyAppendingPathComponent(0, dllDirectoryURL.get(), CFSTR("WebKit.resources"), true)); 52 53 return CFBundleCreate(0, resourcesDirectoryURL.get()); 54 } 55 56 CFBundleRef webKitBundle() 57 { 58 static CFBundleRef bundle = createWebKitBundle(); 59 ASSERT(bundle); 60 return bundle; 43 61 } 44 62 45 63 } // namespace WebKit 46 47 #endif // ENABLE(INSPECTOR) -
trunk/Source/WebKit2/Shared/win/WebKitBundle.h
r80237 r80240 1 1 /* 2 * Copyright (C) 201 0Apple Inc. All rights reserved.2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #i nclude "config.h"27 # include "WebInspector.h"26 #ifndef WebKitBundle_h 27 #define WebKitBundle_h 28 28 29 #if ENABLE(INSPECTOR) 30 31 #include <wtf/RetainPtr.h> 32 #include <wtf/text/WTFString.h> 29 typedef struct __CFBundle* CFBundleRef; 33 30 34 31 namespace WebKit { 35 32 36 String WebInspector::localizedStringsURL() const 37 { 38 RetainPtr<CFURLRef> localizedStringsURLRef(AdoptCF, CFBundleCopyResourceURL(CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit")), CFSTR("localizedStrings"), CFSTR("js"), 0)); 39 if (!localizedStringsURLRef) 40 return String(); 41 42 return String(CFURLGetString(localizedStringsURLRef.get())); 43 } 33 CFBundleRef webKitBundle(); 44 34 45 35 } // namespace WebKit 46 36 47 #endif // ENABLE(INSPECTOR)37 #endif // WebKitBundle_h -
trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp
r79274 r80240 29 29 #if ENABLE(INSPECTOR) 30 30 31 #include "WebKitBundle.h" 31 32 #include "WebPageProxy.h" 32 33 #include "WebView.h" … … 195 196 String WebInspectorProxy::inspectorPageURL() const 196 197 { 197 RetainPtr<CFURLRef> htmlURLRef(AdoptCF, CFBundleCopyResourceURL( CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit")), CFSTR("inspector"), CFSTR("html"), CFSTR("inspector")));198 RetainPtr<CFURLRef> htmlURLRef(AdoptCF, CFBundleCopyResourceURL(webKitBundle(), CFSTR("inspector"), CFSTR("html"), CFSTR("inspector"))); 198 199 if (!htmlURLRef) 199 200 return String(); -
trunk/Source/WebKit2/WebProcess/WebPage/win/WebInspectorWin.cpp
r76916 r80240 29 29 #if ENABLE(INSPECTOR) 30 30 31 #include "WebKitBundle.h" 31 32 #include <wtf/RetainPtr.h> 32 33 #include <wtf/text/WTFString.h> … … 36 37 String WebInspector::localizedStringsURL() const 37 38 { 38 RetainPtr<CFURLRef> localizedStringsURLRef(AdoptCF, CFBundleCopyResourceURL( CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit")), CFSTR("localizedStrings"), CFSTR("js"), 0));39 RetainPtr<CFURLRef> localizedStringsURLRef(AdoptCF, CFBundleCopyResourceURL(webKitBundle(), CFSTR("localizedStrings"), CFSTR("js"), 0)); 39 40 if (!localizedStringsURLRef) 40 41 return String(); -
trunk/Source/WebKit2/win/WebKit2.vcproj
r80051 r80240 1175 1175 </File> 1176 1176 <File 1177 RelativePath="..\Shared\win\WebKitBundle.cpp" 1178 > 1179 </File> 1180 <File 1181 RelativePath="..\Shared\win\WebKitBundle.h" 1182 > 1183 </File> 1184 <File 1177 1185 RelativePath="..\Shared\win\WebURLRequestWin.cpp" 1178 1186 > -
trunk/Tools/ChangeLog
r80237 r80240 1 2011-03-03 Adam Roben <aroben@apple.com> 2 3 Look for Windows-style paths when checking whether a test is an Inspector test 4 5 WTR part of <http://webkit.org/b/55672> <rdar://problem/9080867> All inspector tests time 6 out or crash on Windows 7 Release (WebKit2 Tests) 7 8 Reviewed by Darin Adler. 9 10 * WebKitTestRunner/TestInvocation.cpp: 11 (WTR::shouldOpenWebInspector): Also look for backslashes, since that's what we'll get on 12 Windows. 13 1 14 2011-03-03 Adam Roben <aroben@apple.com> 2 15 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r79626 r80240 125 125 static bool shouldOpenWebInspector(const char* pathOrURL) 126 126 { 127 return strstr(pathOrURL, "inspector/") ;127 return strstr(pathOrURL, "inspector/") || strstr(pathOrURL, "inspector\\"); 128 128 } 129 129
Note: See TracChangeset
for help on using the changeset viewer.