Changeset 63664 in webkit
- Timestamp:
- Jul 19, 2010 8:29:25 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r63663 r63664 1 2010-07-19 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Adam Roben. 4 5 WebKit2 does not have application cache 6 https://bugs.webkit.org/show_bug.cgi?id=42552 7 8 * platform/mac-wk2/Skipped: 9 Remove http/tests/appcache from skipped list. 10 1 11 2010-07-19 Yury Semikhatsky <yurys@chromium.org> 2 12 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r63644 r63664 2313 2313 transitions/transition-hit-test-transform.html 2314 2314 transitions/transition-shorthand-delay.html 2315 2316 # WebKit2 does not have application cache2317 # <https://bugs.webkit.org/show_bug.cgi?id=42552>2318 http/tests/appcache -
trunk/WebKit2/ChangeLog
r63640 r63664 1 2010-07-19 Anders carlsson <andersca@apple.com> 2 3 Reviewed by Adam Roben. 4 5 WebKit2 does not have application cache 6 https://bugs.webkit.org/show_bug.cgi?id=42552 7 8 * Shared/CoreIPCSupport/WebProcessMessageKinds.h: 9 (WebProcessMessage::): 10 Add SetApplicationCacheDirectory. 11 12 * Shared/WebPreferencesStore.h: 13 (WebKit::WebPreferencesStore::encode): 14 (WebKit::WebPreferencesStore::decode): 15 add offlineWebApplicationCacheEnabled. 16 17 * UIProcess/API/C/WKPreferences.cpp: 18 (WKPreferencesSetOfflineWebApplicationCacheEnabled): 19 (WKPreferencesGetOfflineWebApplicationCacheEnabled): 20 * UIProcess/API/C/WKPreferences.h: 21 Add getters/setters for whether the application cache is enabled. 22 23 * UIProcess/WebContext.h: 24 * UIProcess/WebPreferences.cpp: 25 (WebKit::WebPreferences::setOfflineWebApplicationCacheEnabled): 26 Update the store and call update(). 27 28 * UIProcess/WebPreferences.h: 29 * UIProcess/WebProcessProxy.cpp: 30 (WebKit::WebProcessProxy::WebProcessProxy): 31 Ask the web process to set the application cache directory. 32 33 * UIProcess/mac/WebContextMac.mm: Added. 34 (WebKit::WebContext::applicationCacheDirectory): 35 Return the application cache directory. 36 37 * UIProcess/win/WebContextWin.cpp: Added. 38 (WebKit::WebContext::applicationCacheDirectory): 39 Ditto. 40 41 * WebKit2.xcodeproj/project.pbxproj: 42 Add WebContextMac.mm 43 44 * WebProcess/WebPage/WebPage.cpp: 45 (WebKit::WebPage::preferencesDidChange): 46 47 (WebKit::WebPage::didReceiveMessage): 48 Handle PreferencesDidChange. Get rid of the default: case statement so we'll 49 get warnings if we have unhandled message kinds. 50 51 * WebProcess/WebProcess.cpp: 52 (WebKit::WebProcess::setApplicationCacheDirectory): 53 Set the application cache directory. 54 55 (WebKit::WebProcess::didReceiveMessage): 56 Handle SetApplicationCacheDirectory. 57 58 win/WebKit2.vcproj: 59 Add WebContextWin.cpp 60 1 61 2010-07-18 Anders Carlsson <andersca@apple.com> 2 62 -
trunk/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h
r62320 r63664 35 35 enum Kind { 36 36 LoadInjectedBundle, 37 SetApplicationCacheDirectory, 37 38 Create, 38 39 PostMessage, -
trunk/WebKit2/Shared/WebPreferencesStore.h
r61719 r63664 45 45 encoder.encode(loadsImagesAutomatically); 46 46 encoder.encode(pluginsEnabled); 47 encoder.encode(offlineWebApplicationCacheEnabled); 47 48 encoder.encode(minimumFontSize); 48 49 encoder.encode(minimumLogicalFontSize); … … 64 65 return false; 65 66 if (!decoder.decode(s.pluginsEnabled)) 67 return false; 68 if (!decoder.decode(s.offlineWebApplicationCacheEnabled)) 66 69 return false; 67 70 if (!decoder.decode(s.minimumFontSize)) … … 91 94 bool loadsImagesAutomatically; 92 95 bool pluginsEnabled; 93 96 bool offlineWebApplicationCacheEnabled; 97 94 98 uint32_t minimumFontSize; 95 99 uint32_t minimumLogicalFontSize; -
trunk/WebKit2/UIProcess/API/C/WKPreferences.cpp
r57310 r63664 65 65 } 66 66 67 void WKPreferencesSetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef, bool offlineWebApplicationCacheEnabled) 68 { 69 toWK(preferencesRef)->setOfflineWebApplicationCacheEnabled(offlineWebApplicationCacheEnabled); 70 } 71 72 bool WKPreferencesGetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef) 73 { 74 return toWK(preferencesRef)->offlineWebApplicationCacheEnabled(); 75 } 76 67 77 WKPreferencesRef WKPreferencesRetain(WKPreferencesRef preferencesRef) 68 78 { -
trunk/WebKit2/UIProcess/API/C/WKPreferences.h
r61048 r63664 44 44 WK_EXPORT void WKPreferencesSetLoadsImagesAutomatically(WKPreferencesRef preferences, bool loadsImagesAutomatically); 45 45 WK_EXPORT bool WKPreferencesGetLoadsImagesAutomatically(WKPreferencesRef preferences); 46 WK_EXPORT void WKPreferencesSetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferences, bool offlineWebApplicationCacheEnabled); 47 WK_EXPORT bool WKPreferencesGetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferences); 46 48 47 49 WK_EXPORT WKPreferencesRef WKPreferencesRetain(WKPreferencesRef preferences); -
trunk/WebKit2/UIProcess/WebContext.h
r63621 r63664 85 85 86 86 PluginInfoStore* pluginInfoStore() { return &m_pluginInfoStore; } 87 WebCore::String applicationCacheDirectory(); 87 88 88 89 private: -
trunk/WebKit2/UIProcess/WebPreferences.cpp
r57310 r63664 87 87 } 88 88 89 void WebPreferences::setOfflineWebApplicationCacheEnabled(bool b) 90 { 91 m_store.offlineWebApplicationCacheEnabled = b; 92 update(); 93 } 94 95 bool WebPreferences::offlineWebApplicationCacheEnabled() const 96 { 97 return m_store.offlineWebApplicationCacheEnabled; 98 } 99 89 100 } // namespace WebKit -
trunk/WebKit2/UIProcess/WebPreferences.h
r57310 r63664 62 62 bool loadsImagesAutomatically() const; 63 63 64 void setOfflineWebApplicationCacheEnabled(bool); 65 bool offlineWebApplicationCacheEnabled() const; 66 64 67 private: 65 68 WebPreferences(); -
trunk/WebKit2/UIProcess/WebProcessProxy.cpp
r63621 r63664 59 59 connect(); 60 60 61 // FIXME: Instead of sending three separate initialization related messages here, we should just send a 62 // single "Initialize" messages with a struct that has all the needed information. 63 send(WebProcessMessage::SetApplicationCacheDirectory, 0, CoreIPC::In(m_context->applicationCacheDirectory())); 64 61 65 // FIXME: We could instead send the bundle path as part of the arguments to process creation? 62 66 // Would that be better than sending a connection? … … 67 71 setUpAcceleratedCompositing(); 68 72 #endif 73 69 74 } 70 75 -
trunk/WebKit2/UIProcess/mac/WebContextMac.mm
r63663 r63664 24 24 */ 25 25 26 #ifndef WebPreferences_h 27 #define WebPreferences_h 26 #include "WebContext.h" 28 27 29 #include "WebPreferencesStore.h"30 #include <wtf/HashSet.h> 31 #include <wtf/PassRefPtr.h> 32 #include <wtf/RefCounted.h> 33 #include <wtf/RefPtr.h> 28 #include <sys/param.h> 29 30 using namespace WebCore; 31 32 NSString *WebKitLocalCacheDefaultsKey = @"WebKitLocalCache"; 34 33 35 34 namespace WebKit { 36 35 37 class WebContext; 36 String WebContext::applicationCacheDirectory() 37 { 38 NSString *appName = [[NSBundle mainBundle] bundleIdentifier]; 39 if (!appName) 40 appName = [[NSProcessInfo processInfo] processName]; 41 42 ASSERT(appName); 43 44 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 45 NSString *cacheDir = [defaults objectForKey:WebKitLocalCacheDefaultsKey]; 38 46 39 class WebPreferences : public RefCounted<WebPreferences> { 40 public: 41 static WebPreferences* shared(); 47 if (!cacheDir || ![cacheDir isKindOfClass:[NSString class]]) { 48 #ifdef BUILDING_ON_TIGER 49 cacheDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"]; 50 #else 51 char cacheDirectory[MAXPATHLEN]; 52 size_t cacheDirectoryLen = confstr(_CS_DARWIN_USER_CACHE_DIR, cacheDirectory, MAXPATHLEN); 53 54 if (cacheDirectoryLen) 55 cacheDir = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:cacheDirectory length:cacheDirectoryLen - 1]; 56 #endif 57 } 42 58 43 static PassRefPtr<WebPreferences> create() 44 { 45 return adoptRef(new WebPreferences); 46 } 47 static PassRefPtr<WebPreferences> copy(WebPreferences* preferences) 48 { 49 return adoptRef(new WebPreferences(preferences)); 50 } 51 ~WebPreferences(); 52 53 void addContext(WebContext*); 54 void removeContext(WebContext*); 55 56 const WebPreferencesStore& store() const { return m_store; } 57 58 void setJavaScriptEnabled(bool); 59 bool javaScriptEnabled() const; 60 61 void setLoadsImagesAutomatically(bool); 62 bool loadsImagesAutomatically() const; 63 64 private: 65 WebPreferences(); 66 WebPreferences(WebPreferences*); 67 68 void update(); 69 70 HashSet<WebContext*> m_contexts; 71 WebPreferencesStore m_store; 72 }; 59 return [cacheDir stringByAppendingPathComponent:appName]; 60 } 73 61 74 62 } // namespace WebKit 75 63 76 #endif // WebPreferences_h -
trunk/WebKit2/UIProcess/win/WebContextWin.cpp
r63663 r63664 24 24 */ 25 25 26 #ifndef WebProcessMessageKinds_h 27 #define WebProcessMessageKinds_h 26 #include "WebContext.h" 28 27 29 // Messages sent from WebKit to the web process. 28 #include <WebCore/FileSystem.h> 30 29 31 #include "MessageID.h" 30 using namespace WebCore; 32 31 33 namespace Web ProcessMessage{32 namespace WebKit { 34 33 35 enum Kind { 36 LoadInjectedBundle, 37 Create, 38 PostMessage, 39 #if PLATFORM(MAC) 40 SetupAcceleratedCompositingPort 41 #endif 42 }; 43 34 String WebContext::applicationCacheDirectory() 35 { 36 return localUserSpecificStorageDirectory(); 44 37 } 45 38 46 namespace CoreIPC { 39 } // namespace WebKit 47 40 48 template<> struct MessageKindTraits<WebProcessMessage::Kind> {49 static const MessageClass messageClass = MessageClassWebProcess;50 };51 52 }53 54 #endif // WebProcessMessageKinds_h -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r63631 r63664 33 33 1A10475A110A5AD500A43ECD /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */; }; 34 34 1A1C4EC810D06099005E67E7 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1C79A100E7FC50078DEBC /* WebCore.framework */; }; 35 1A1C649B11F4174200553C19 /* WebContextMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C648611F415B700553C19 /* WebContextMac.mm */; }; 35 36 1A2161B011F37664008AD0F5 /* NPJSObjectMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2161AE11F37664008AD0F5 /* NPJSObjectMap.h */; }; 36 37 1A2161B111F37664008AD0F5 /* NPJSObjectMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2161AF11F37664008AD0F5 /* NPJSObjectMap.cpp */; }; … … 302 303 0F52667311DD4A490006D33C /* WebProcessProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessProxyMac.mm; sourceTree = "<group>"; }; 303 304 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 305 1A1C648611F415B700553C19 /* WebContextMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMac.mm; sourceTree = "<group>"; }; 304 306 1A2161AE11F37664008AD0F5 /* NPJSObjectMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NPJSObjectMap.h; sourceTree = "<group>"; }; 305 307 1A2161AF11F37664008AD0F5 /* NPJSObjectMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPJSObjectMap.cpp; sourceTree = "<group>"; }; … … 1122 1124 0F5265BB11DD37860006D33C /* LayerBackedDrawingAreaProxyMac.mm */, 1123 1125 0F52667311DD4A490006D33C /* WebProcessProxyMac.mm */, 1126 1A1C648611F415B700553C19 /* WebContextMac.mm */, 1124 1127 ); 1125 1128 path = mac; … … 1441 1444 1A2161B111F37664008AD0F5 /* NPJSObjectMap.cpp in Sources */, 1442 1445 1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */, 1446 1A1C649B11F4174200553C19 /* WebContextMac.mm in Sources */, 1443 1447 ); 1444 1448 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/WebProcess/WebPage/WebPage.cpp
r63377 r63664 328 328 m_page->settings()->setJavaScriptEnabled(store.javaScriptEnabled); 329 329 m_page->settings()->setLoadsImagesAutomatically(store.loadsImagesAutomatically); 330 m_page->settings()->setOfflineWebApplicationCacheEnabled(store.offlineWebApplicationCacheEnabled); 330 331 } 331 332 … … 375 376 376 377 setActive(active); 377 break;378 return; 378 379 } 379 380 case WebPageMessage::SetFocused: { … … 383 384 384 385 setFocused(focused); 385 break;386 return; 386 387 } 387 388 case WebPageMessage::SetIsInWindow: { … … 391 392 392 393 setIsInWindow(isInWindow); 393 break;394 return; 394 395 } 395 396 case WebPageMessage::MouseEvent: { … … 400 401 PlatformMouseEvent platformEvent = platform(event); 401 402 mouseEvent(platformEvent); 402 break; 403 return; 404 } 405 case WebPageMessage::PreferencesDidChange: { 406 WebPreferencesStore store; 407 if (!arguments.decode(store)) 408 return; 409 410 preferencesDidChange(store); 411 return; 403 412 } 404 413 case WebPageMessage::WheelEvent: { … … 409 418 PlatformWheelEvent platformEvent = platform(event); 410 419 wheelEvent(platformEvent); 411 break;420 return; 412 421 } 413 422 case WebPageMessage::KeyEvent: { … … 418 427 PlatformKeyboardEvent platformEvent = platform(event); 419 428 keyEvent(platformEvent); 420 break;429 return; 421 430 } 422 431 case WebPageMessage::LoadURL: { … … 426 435 427 436 loadURL(url); 428 break;437 return; 429 438 } 430 439 case WebPageMessage::StopLoading: … … 437 446 438 447 reload(reloadFromOrigin); 439 break;448 return; 440 449 } 441 450 case WebPageMessage::GoForward: { … … 444 453 return; 445 454 goForward(backForwardItemID); 446 break;455 return; 447 456 } 448 457 case WebPageMessage::GoBack: { … … 451 460 return; 452 461 goBack(backForwardItemID); 453 break;462 return; 454 463 } 455 464 case WebPageMessage::GoToBackForwardItem: { … … 458 467 return; 459 468 goToBackForwardItem(backForwardItemID); 460 break;469 return; 461 470 } 462 471 case WebPageMessage::DidReceivePolicyDecision: { … … 467 476 return; 468 477 didReceivePolicyDecision(webFrame(frameID), listenerID, (WebCore::PolicyAction)policyAction); 469 break;478 return; 470 479 } 471 480 case WebPageMessage::RunJavaScriptInMainFrame: { … … 475 484 return; 476 485 runJavaScriptInMainFrame(script, callbackID); 477 break;486 return; 478 487 } 479 488 case WebPageMessage::GetRenderTreeExternalRepresentation: { … … 482 491 return; 483 492 getRenderTreeExternalRepresentation(callbackID); 484 break;493 return; 485 494 } 486 495 case WebPageMessage::Close: { 487 496 close(); 488 break;497 return; 489 498 } 490 499 case WebPageMessage::TryClose: { 491 500 tryClose(); 492 break; 493 } 494 default: 495 ASSERT_NOT_REACHED(); 496 break; 501 return; 502 } 497 503 } 504 505 ASSERT_NOT_REACHED(); 498 506 } 499 507 -
trunk/WebKit2/WebProcess/WebProcess.cpp
r62788 r63664 37 37 #include "WebPreferencesStore.h" 38 38 #include "WebProcessMessageKinds.h" 39 #include <WebCore/ApplicationCacheStorage.h> 39 40 #include <wtf/PassRefPtr.h> 40 41 … … 86 87 m_injectedBundle.clear(); 87 88 } 89 } 90 91 void WebProcess::setApplicationCacheDirectory(const String& directory) 92 { 93 cacheStorage().setCacheDirectory(directory); 88 94 } 89 95 … … 160 166 return; 161 167 } 168 case WebProcessMessage::SetApplicationCacheDirectory: { 169 String directory; 170 if (!arguments->decode(CoreIPC::Out(directory))) 171 return; 172 173 setApplicationCacheDirectory(directory); 174 return; 175 } 162 176 case WebProcessMessage::Create: { 163 177 uint64_t pageID = arguments->destinationID(); -
trunk/WebKit2/WebProcess/WebProcess.h
r62320 r63664 68 68 69 69 void loadInjectedBundle(const WebCore::String&); 70 void setApplicationCacheDirectory(const WebCore::String&); 70 71 void forwardMessageToInjectedBundle(const WebCore::String&); 71 72 -
trunk/WebKit2/win/WebKit2.vcproj
r63639 r63664 1194 1194 </File> 1195 1195 <File 1196 RelativePath="..\UIProcess\win\WebContextWin.cpp" 1197 > 1198 </File> 1199 <File 1196 1200 RelativePath="..\UIProcess\win\WebView.cpp" 1197 1201 > -
trunk/WebKitTools/ChangeLog
r63661 r63664 1 2010-07-19 Anders carlsson <andersca@apple.com> 2 3 Reviewed by Adam Roben. 4 5 WebKit2 does not have application cache 6 https://bugs.webkit.org/show_bug.cgi?id=42552 7 8 * WebKitTestRunner/TestInvocation.cpp: 9 (WTR::TestInvocation::resetPreferencesToConsistentValues): 10 Set up default preferences. Right now just enables the web application cache. 11 12 (WTR::TestInvocation::invoke): 13 Call resetPreferencesToConsistentValues. 14 15 * WebKitTestRunner/TestInvocation.h: 16 1 17 2010-07-19 Kent Tamura <tkent@chromium.org> 2 18 -
trunk/WebKitTools/WebKitTestRunner/TestInvocation.cpp
r63583 r63664 97 97 } 98 98 99 void TestInvocation::resetPreferencesToConsistentValues() 100 { 101 WKPreferencesRef preferences = WKContextGetPreferences(TestController::shared().context()); 102 103 WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true); 104 } 105 99 106 void TestInvocation::invoke() 100 107 { 101 108 sizeWebViewForCurrentTest(m_pathOrURL); 109 resetPreferencesToConsistentValues(); 110 102 111 WKRetainPtr<WKStringRef> message(AdoptWK, WKStringCreateWithCFString(CFSTR("BeginTest"))); 103 112 WKContextPostMessageToInjectedBundle(TestController::shared().context(), message.get()); -
trunk/WebKitTools/WebKitTestRunner/TestInvocation.h
r63155 r63664 43 43 void dump(const char*); 44 44 45 void resetPreferencesToConsistentValues(); 46 45 47 // Helper 46 48 static void runUntil(bool& done);
Note: See TracChangeset
for help on using the changeset viewer.