Changeset 211841 in webkit
- Timestamp:
- Feb 7, 2017 4:07:02 PM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r211838 r211841 1 2017-02-07 Brent Fulgham <bfulgham@apple.com> 2 3 Correct initialization of Resource Load Statistics for use in WebKitTestRunner 4 https://bugs.webkit.org/show_bug.cgi?id=167960 5 6 Reviewed by Andy Estes. 7 8 WebKit2 starts up with different process configuration settings depending on the type of 9 WebView and client application. This led to two problems: 10 1. Registering the shared resource load observer did not start at UIProcess launch. Instead, it 11 was lazily initialized as messages from the various WebProcess started getting received. This 12 is too slow for WebKitTestRunner, which needs this object to be initialized right at launch 13 time. 14 15 A new 'registerSharedResourceLoadObserver' method was needed, so that the WebProcess can ask 16 the WebsiteDataStore to register a resource load observer during platform initialization. 17 18 2. Some WebView uses do not enable WebsiteDataStore, and should not activate a resource load 19 statistics observer. 20 21 * UIProcess/API/APIWebsiteDataStore.cpp: 22 (API::WebsiteDataStore::registerSharedResourceLoadObserver): Added. 23 * UIProcess/API/APIWebsiteDataStore.h: 24 * UIProcess/Cocoa/WebProcessPoolCocoa.mm: 25 (WebKit::WebProcessPool::platformInitialize): If the web process is using a WebsiteDataStore, 26 register a resource load observer. 27 * UIProcess/WebResourceLoadStatisticsStore.cpp: 28 (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Added. 29 * UIProcess/WebResourceLoadStatisticsStore.h: 30 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 31 (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver): Added. 32 * UIProcess/WebsiteData/WebsiteDataStore.h: 33 1 34 2017-02-07 Anders Carlsson <andersca@apple.com> 2 35 -
trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp
r199326 r211841 1 1 /* 2 * Copyright (C) 2014 , 2016Apple Inc. All rights reserved.2 * Copyright (C) 2014-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 79 79 m_websiteDataStore->setResourceLoadStatisticsEnabled(enabled); 80 80 } 81 82 void WebsiteDataStore::registerSharedResourceLoadObserver() 83 { 84 m_websiteDataStore->registerSharedResourceLoadObserver(); 85 } 81 86 82 87 #if !PLATFORM(COCOA) && !PLATFORM(EFL) && !PLATFORM(GTK) -
trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h
r199326 r211841 1 1 /* 2 * Copyright (C) 2014-201 6Apple Inc. All rights reserved.2 * Copyright (C) 2014-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 45 45 bool resourceLoadStatisticsEnabled() const; 46 46 void setResourceLoadStatisticsEnabled(bool); 47 void registerSharedResourceLoadObserver(); 47 48 48 49 WebKit::WebsiteDataStore& websiteDataStore() { return *m_websiteDataStore; } -
trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r210315 r211841 1 1 /* 2 * Copyright (C) 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2010-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 146 146 WebKit::WebMemoryPressureHandler::singleton(); 147 147 #endif 148 149 if (m_websiteDataStore) 150 m_websiteDataStore->registerSharedResourceLoadObserver(); 148 151 } 149 152 -
trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp
r208874 r211841 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 #include "WebsiteDataType.h" 35 35 #include <WebCore/KeyedCoding.h> 36 #include <WebCore/ResourceLoadObserver.h> 36 37 #include <WebCore/ResourceLoadStatistics.h> 37 38 #include <wtf/CurrentTime.h> … … 192 193 } 193 194 195 void WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver() 196 { 197 ResourceLoadObserver::sharedObserver().setStatisticsStore(m_resourceStatisticsStore.copyRef()); 198 } 199 194 200 void WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded() 195 201 { -
trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h
r208874 r211841 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 56 56 void setResourceLoadStatisticsEnabled(bool); 57 57 bool resourceLoadStatisticsEnabled() const; 58 void registerSharedResourceLoadObserver(); 58 59 59 60 void resourceLoadStatisticsUpdated(const Vector<WebCore::ResourceLoadStatistics>& origins); -
trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
r208727 r211841 1 1 /* 2 * Copyright (C) 2014-201 6Apple Inc. All rights reserved.2 * Copyright (C) 2014-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1159 1159 } 1160 1160 1161 } 1161 void WebsiteDataStore::registerSharedResourceLoadObserver() 1162 { 1163 if (!m_resourceLoadStatistics) 1164 return; 1165 1166 m_resourceLoadStatistics->registerSharedResourceLoadObserver(); 1167 } 1168 1169 } -
trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h
r208633 r211841 1 1 /* 2 * Copyright (C) 2014-201 6Apple Inc. All rights reserved.2 * Copyright (C) 2014-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 80 80 bool resourceLoadStatisticsEnabled() const; 81 81 void setResourceLoadStatisticsEnabled(bool); 82 void registerSharedResourceLoadObserver(); 82 83 83 84 static void cloneSessionData(WebPageProxy& sourcePage, WebPageProxy& newPage);
Note: See TracChangeset
for help on using the changeset viewer.