Changeset 176544 in webkit
- Timestamp:
- Nov 25, 2014, 11:50:45 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/WebCore.exp.in (modified) (1 diff)
-
WebCore/page/PageGroup.cpp (modified) (7 diffs)
-
WebCore/page/PageGroup.h (modified) (3 diffs)
-
WebKit/mac/ChangeLog (modified) (1 diff)
-
WebKit/mac/WebView/WebView.mm (modified) (1 diff)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (modified) (5 diffs)
-
WebKit2/WebProcess/WebPage/WebPage.cpp (modified) (3 diffs)
-
WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp (modified) (3 diffs)
-
WebKit2/WebProcess/WebPage/WebPageGroupProxy.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r176542 r176544 1 2014-11-25 Anders Carlsson <andersca@apple.com> 2 3 Remove user content handling from PageGroup 4 https://bugs.webkit.org/show_bug.cgi?id=139051 5 6 Reviewed by Antti Koivisto. 7 8 Remove m_userContentController from PageGroup and the related functions and symbol exports. 9 10 * WebCore.exp.in: 11 * page/PageGroup.cpp: 12 (WebCore::PageGroup::PageGroup): 13 (WebCore::PageGroup::~PageGroup): 14 (WebCore::PageGroup::addPage): 15 (WebCore::PageGroup::removePage): 16 (WebCore::PageGroup::addUserScriptToWorld): Deleted. 17 (WebCore::PageGroup::addUserStyleSheetToWorld): Deleted. 18 (WebCore::PageGroup::removeUserScriptFromWorld): Deleted. 19 (WebCore::PageGroup::removeUserStyleSheetFromWorld): Deleted. 20 (WebCore::PageGroup::removeUserScriptsFromWorld): Deleted. 21 (WebCore::PageGroup::removeUserStyleSheetsFromWorld): Deleted. 22 (WebCore::PageGroup::removeAllUserContent): Deleted. 23 * page/PageGroup.h: 24 1 25 2014-11-25 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/WebCore/WebCore.exp.in
r176542 r176544 1555 1555 __ZN7WebCore9PageGroup17closeLocalStorageEv 1556 1556 __ZN7WebCore9PageGroup18addVisitedLinkHashEy 1557 __ZN7WebCore9PageGroup20addUserScriptToWorldERNS_15DOMWrapperWorldERKN3WTF6StringERKNS_3URLERKNS3_6VectorIS4_Lj0ENS3_15CrashOnOverflowEEESE_NS_23UserScriptInjectionTimeENS_25UserContentInjectedFramesE1558 __ZN7WebCore9PageGroup20removeAllUserContentEv1559 1557 __ZN7WebCore9PageGroup21removeAllVisitedLinksEv 1560 __ZN7WebCore9PageGroup24addUserStyleSheetToWorldERNS_15DOMWrapperWorldERKN3WTF6StringERKNS_3URLERKNS3_6VectorIS4_Lj0ENS3_15CrashOnOverflowEEESE_NS_25UserContentInjectedFramesENS_14UserStyleLevelENS_22UserStyleInjectionTimeE1561 __ZN7WebCore9PageGroup25removeUserScriptFromWorldERNS_15DOMWrapperWorldERKNS_3URLE1562 __ZN7WebCore9PageGroup26removeUserScriptsFromWorldERNS_15DOMWrapperWorldE1563 1558 __ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb 1564 __ZN7WebCore9PageGroup29removeUserStyleSheetFromWorldERNS_15DOMWrapperWorldERKNS_3URLE1565 1559 __ZN7WebCore9PageGroup30closeIdleLocalStorageDatabasesEv 1566 __ZN7WebCore9PageGroup30removeUserStyleSheetsFromWorldERNS_15DOMWrapperWorldE1567 1560 __ZN7WebCore9PageGroup9pageGroupERKN3WTF6StringE 1568 1561 __ZN7WebCore9Scrollbar11mouseExitedEv -
trunk/Source/WebCore/page/PageGroup.cpp
r170774 r176544 40 40 #include "Settings.h" 41 41 #include "StorageNamespace.h" 42 #include "UserContentController.h"43 42 #include "VisitedLinkStore.h" 44 43 #include <wtf/StdLibExtras.h> … … 68 67 , m_visitedLinksPopulated(false) 69 68 , m_identifier(getUniqueIdentifier()) 70 , m_userContentController(UserContentController::create())71 69 , m_groupSettings(std::make_unique<GroupSettings>()) 72 70 { … … 76 74 : m_visitedLinksPopulated(false) 77 75 , m_identifier(getUniqueIdentifier()) 78 , m_userContentController(UserContentController::create())79 76 , m_groupSettings(std::make_unique<GroupSettings>()) 80 77 { … … 84 81 PageGroup::~PageGroup() 85 82 { 86 removeAllUserContent();87 83 } 88 84 … … 167 163 ASSERT(!m_pages.contains(&page)); 168 164 m_pages.add(&page); 169 170 if (!page.userContentController())171 page.setUserContentController(m_userContentController.get());172 165 } 173 166 … … 176 169 ASSERT(m_pages.contains(&page)); 177 170 m_pages.remove(&page); 178 179 if (page.userContentController() == m_userContentController)180 page.setUserContentController(nullptr);181 171 } 182 172 … … 285 275 286 276 return result.iterator->value.get(); 287 }288 289 void PageGroup::addUserScriptToWorld(DOMWrapperWorld& world, const String& source, const URL& url, const Vector<String>& whitelist, const Vector<String>& blacklist, UserScriptInjectionTime injectionTime, UserContentInjectedFrames injectedFrames)290 {291 auto userScript = std::make_unique<UserScript>(source, url, whitelist, blacklist, injectionTime, injectedFrames);292 m_userContentController->addUserScript(world, WTF::move(userScript));293 }294 295 void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld& world, const String& source, const URL& url, const Vector<String>& whitelist, const Vector<String>& blacklist, UserContentInjectedFrames injectedFrames, UserStyleLevel level, UserStyleInjectionTime injectionTime)296 {297 auto userStyleSheet = std::make_unique<UserStyleSheet>(source, url, whitelist, blacklist, injectedFrames, level);298 m_userContentController->addUserStyleSheet(world, WTF::move(userStyleSheet), injectionTime);299 300 }301 302 void PageGroup::removeUserScriptFromWorld(DOMWrapperWorld& world, const URL& url)303 {304 m_userContentController->removeUserScript(world, url);305 }306 307 void PageGroup::removeUserStyleSheetFromWorld(DOMWrapperWorld& world, const URL& url)308 {309 m_userContentController->removeUserStyleSheet(world, url);310 }311 312 void PageGroup::removeUserScriptsFromWorld(DOMWrapperWorld& world)313 {314 m_userContentController->removeUserScripts(world);315 }316 317 void PageGroup::removeUserStyleSheetsFromWorld(DOMWrapperWorld& world)318 {319 m_userContentController->removeUserStyleSheets(world);320 }321 322 void PageGroup::removeAllUserContent()323 {324 m_userContentController->removeAllUserContent();325 277 } 326 278 -
trunk/Source/WebCore/page/PageGroup.h
r173176 r176544 44 44 class StorageNamespace; 45 45 class VisitedLinkStore; 46 class UserContentController;47 46 48 47 #if ENABLE(VIDEO_TRACK) … … 94 93 StorageNamespace* transientLocalStorage(SecurityOrigin* topOrigin); 95 94 96 WEBCORE_EXPORT void addUserScriptToWorld(DOMWrapperWorld&, const String& source, const URL&, const Vector<String>& whitelist, const Vector<String>& blacklist, UserScriptInjectionTime, UserContentInjectedFrames);97 WEBCORE_EXPORT void addUserStyleSheetToWorld(DOMWrapperWorld&, const String& source, const URL&, const Vector<String>& whitelist, const Vector<String>& blacklist, UserContentInjectedFrames, UserStyleLevel = UserStyleUserLevel, UserStyleInjectionTime = InjectInExistingDocuments);98 WEBCORE_EXPORT void removeUserStyleSheetFromWorld(DOMWrapperWorld&, const URL&);99 WEBCORE_EXPORT void removeUserScriptFromWorld(DOMWrapperWorld&, const URL&);100 WEBCORE_EXPORT void removeUserScriptsFromWorld(DOMWrapperWorld&);101 WEBCORE_EXPORT void removeUserStyleSheetsFromWorld(DOMWrapperWorld&);102 WEBCORE_EXPORT void removeAllUserContent();103 104 95 GroupSettings& groupSettings() const { return *m_groupSettings; } 105 96 … … 124 115 HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageNamespace>> m_transientLocalStorageMap; 125 116 126 RefPtr<UserContentController> m_userContentController;127 128 117 const std::unique_ptr<GroupSettings> m_groupSettings; 129 118 -
trunk/Source/WebKit/mac/ChangeLog
r176542 r176544 1 2014-11-25 Anders Carlsson <andersca@apple.com> 2 3 Remove user content handling from PageGroup 4 https://bugs.webkit.org/show_bug.cgi?id=139051 5 6 Reviewed by Antti Koivisto. 7 8 Use the user content controller in the web view group. 9 10 * WebView/WebView.mm: 11 (-[WebView _injectOutlookQuirksScript]): 12 1 13 2014-11-25 Anders Carlsson <andersca@apple.com> 2 14 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r176542 r176544 781 781 { 782 782 static NSString *outlookQuirksScriptContents = leakOutlookQuirksUserScriptContents(); 783 core(self)->group().addUserScriptToWorld(*core([WebScriptWorld world]),784 outlookQuirksScriptContents, URL(), Vector<String>(), Vector<String>(), InjectAtDocumentEnd, InjectInAllFrames); 783 _private->group->userContentController().addUserScript(*core([WebScriptWorld world]), std::make_unique<UserScript>(outlookQuirksScriptContents, URL(), Vector<String>(), Vector<String>(), InjectAtDocumentEnd, InjectInAllFrames)); 784 785 785 } 786 786 #endif -
trunk/Source/WebKit2/ChangeLog
r176540 r176544 1 2014-11-25 Anders Carlsson <andersca@apple.com> 2 3 Remove user content handling from PageGroup 4 https://bugs.webkit.org/show_bug.cgi?id=139051 5 6 Reviewed by Antti Koivisto. 7 8 * WebProcess/InjectedBundle/InjectedBundle.cpp: 9 (WebKit::InjectedBundle::addUserScript): 10 (WebKit::InjectedBundle::addUserStyleSheet): 11 (WebKit::InjectedBundle::removeUserScript): 12 (WebKit::InjectedBundle::removeUserStyleSheet): 13 (WebKit::InjectedBundle::removeUserScripts): 14 (WebKit::InjectedBundle::removeUserStyleSheets): 15 (WebKit::InjectedBundle::removeAllUserContent): 16 Talk to the user content controller from the passed in WebPageGroupProxy. 17 18 * WebProcess/WebPage/WebPage.cpp: 19 (WebKit::WebPage::WebPage): 20 Create the WebPageGroupProxy before creating the page so we can get its user content controller and 21 pass it to the page configuration if necessary. 22 23 * WebProcess/WebPage/WebPageGroupProxy.cpp: 24 (WebKit::WebPageGroupProxy::userContentController): 25 New function that lazily creates a user content controller. We don't want to create this eagerly since 26 it's not used with the modern API. 27 28 (WebKit::WebPageGroupProxy::addUserStyleSheet): 29 (WebKit::WebPageGroupProxy::addUserScript): 30 (WebKit::WebPageGroupProxy::removeAllUserStyleSheets): 31 (WebKit::WebPageGroupProxy::removeAllUserScripts): 32 (WebKit::WebPageGroupProxy::removeAllUserContent): 33 Call through to the user content controller. 34 35 * WebProcess/WebPage/WebPageGroupProxy.h: 36 Add an m_userContentController member. 37 1 38 2014-11-25 Ting-Wei Lan <lantw44@gmail.com> 2 39 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r173804 r176544 71 71 #include <WebCore/SessionID.h> 72 72 #include <WebCore/Settings.h> 73 #include <WebCore/UserContentController.h> 73 74 #include <WebCore/UserGestureIndicator.h> 74 75 … … 476 477 { 477 478 // url is not from URL::string(), i.e. it has not already been parsed by URL, so we have to use the relative URL constructor for URL instead of the ParsedURLStringTag version. 478 PageGroup::pageGroup(pageGroup->identifier())->addUserScriptToWorld(scriptWorld->coreWorld(), source, URL(URL(), url), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), injectionTime, injectedFrames); 479 auto userScript = std::make_unique<UserScript>(source, URL(URL(), url), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), injectionTime, injectedFrames); 480 481 pageGroup->userContentController().addUserScript(scriptWorld->coreWorld(), WTF::move(userScript)); 479 482 } 480 483 … … 482 485 { 483 486 // url is not from URL::string(), i.e. it has not already been parsed by URL, so we have to use the relative URL constructor for URL instead of the ParsedURLStringTag version. 484 PageGroup::pageGroup(pageGroup->identifier())->addUserStyleSheetToWorld(scriptWorld->coreWorld(), source, URL(URL(), url), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), injectedFrames); 487 auto userStyleSheet = std::make_unique<UserStyleSheet>(source, URL(URL(), url), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), injectedFrames, UserStyleUserLevel); 488 489 pageGroup->userContentController().addUserStyleSheet(scriptWorld->coreWorld(), WTF::move(userStyleSheet), InjectInExistingDocuments); 485 490 } 486 491 … … 488 493 { 489 494 // url is not from URL::string(), i.e. it has not already been parsed by URL, so we have to use the relative URL constructor for URL instead of the ParsedURLStringTag version. 490 PageGroup::pageGroup(pageGroup->identifier())->removeUserScriptFromWorld(scriptWorld->coreWorld(), URL(URL(), url));495 pageGroup->userContentController().removeUserScript(scriptWorld->coreWorld(), URL(URL(), url)); 491 496 } 492 497 … … 494 499 { 495 500 // url is not from URL::string(), i.e. it has not already been parsed by URL, so we have to use the relative URL constructor for URL instead of the ParsedURLStringTag version. 496 PageGroup::pageGroup(pageGroup->identifier())->removeUserStyleSheetFromWorld(scriptWorld->coreWorld(), URL(URL(), url));501 pageGroup->userContentController().removeUserStyleSheet(scriptWorld->coreWorld(), URL(URL(), url)); 497 502 } 498 503 499 504 void InjectedBundle::removeUserScripts(WebPageGroupProxy* pageGroup, InjectedBundleScriptWorld* scriptWorld) 500 505 { 501 PageGroup::pageGroup(pageGroup->identifier())->removeUserScriptsFromWorld(scriptWorld->coreWorld());506 pageGroup->userContentController().removeUserScripts(scriptWorld->coreWorld()); 502 507 } 503 508 504 509 void InjectedBundle::removeUserStyleSheets(WebPageGroupProxy* pageGroup, InjectedBundleScriptWorld* scriptWorld) 505 510 { 506 PageGroup::pageGroup(pageGroup->identifier())->removeUserStyleSheetsFromWorld(scriptWorld->coreWorld());511 pageGroup->userContentController().removeUserStyleSheets(scriptWorld->coreWorld()); 507 512 } 508 513 509 514 void InjectedBundle::removeAllUserContent(WebPageGroupProxy* pageGroup) 510 515 { 511 PageGroup::pageGroup(pageGroup->identifier())->removeAllUserContent();516 pageGroup->userContentController().removeAllUserContent(); 512 517 } 513 518 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r176499 r176544 338 338 Settings::setDefaultMinDOMTimerInterval(0.004); 339 339 340 m_pageGroup = WebProcess::shared().webPageGroup(parameters.pageGroupData); 341 340 342 #if PLATFORM(IOS) 341 343 Settings::setShouldManageAudioSessionCategory(true); … … 364 366 pageConfiguration.diagnosticLoggingClient = new WebDiagnosticLoggingClient(*this); 365 367 366 pageConfiguration.userContentController = m_userContentController ? &m_userContentController->userContentController() : nullptr;368 pageConfiguration.userContentController = m_userContentController ? &m_userContentController->userContentController() : &m_pageGroup->userContentController(); 367 369 pageConfiguration.visitedLinkStore = VisitedLinkTableController::getOrCreate(parameters.visitedLinkTableID); 368 370 … … 407 409 m_mayStartMediaWhenInWindow = parameters.mayStartMediaWhenInWindow; 408 410 409 m_pageGroup = WebProcess::shared().webPageGroup(parameters.pageGroupData);410 411 m_page->setGroupName(m_pageGroup->identifier()); 411 412 m_page->setDeviceScaleFactor(parameters.deviceScaleFactor); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp
r150344 r176544 31 31 #include <WebCore/DOMWrapperWorld.h> 32 32 #include <WebCore/PageGroup.h> 33 #include <WebCore/UserContentController.h> 33 34 34 35 namespace WebKit { … … 44 45 } 45 46 46 WebPageGroupProxy::~WebPageGroupProxy()47 {48 }49 50 47 WebPageGroupProxy::WebPageGroupProxy(const WebPageGroupData& data) 51 48 : m_data(data) … … 58 55 } 59 56 57 WebPageGroupProxy::~WebPageGroupProxy() 58 { 59 } 60 61 WebCore::UserContentController& WebPageGroupProxy::userContentController() 62 { 63 if (!m_userContentController) 64 m_userContentController = WebCore::UserContentController::create(); 65 66 return *m_userContentController; 67 } 68 60 69 void WebPageGroupProxy::addUserStyleSheet(const WebCore::UserStyleSheet& userStyleSheet) 61 70 { 62 m_pageGroup->addUserStyleSheetToWorld(WebCore::mainThreadNormalWorld(), userStyleSheet.source(), userStyleSheet.url(), userStyleSheet.whitelist(), userStyleSheet.blacklist(), userStyleSheet.injectedFrames(), userStyleSheet.level());71 userContentController().addUserStyleSheet(WebCore::mainThreadNormalWorld(), std::make_unique<WebCore::UserStyleSheet>(userStyleSheet), WebCore::InjectInExistingDocuments); 63 72 } 64 73 65 74 void WebPageGroupProxy::addUserScript(const WebCore::UserScript& userScript) 66 75 { 67 m_pageGroup->addUserScriptToWorld(WebCore::mainThreadNormalWorld(), userScript.source(), userScript.url(), userScript.whitelist(), userScript.blacklist(), userScript.injectionTime(), userScript.injectedFrames());76 userContentController().addUserScript(WebCore::mainThreadNormalWorld(), std::make_unique<WebCore::UserScript>(userScript)); 68 77 } 69 78 70 79 void WebPageGroupProxy::removeAllUserStyleSheets() 71 80 { 72 m_pageGroup->removeUserStyleSheetsFromWorld(WebCore::mainThreadNormalWorld());81 userContentController().removeUserStyleSheets(WebCore::mainThreadNormalWorld()); 73 82 } 74 83 75 84 void WebPageGroupProxy::removeAllUserScripts() 76 85 { 77 m_pageGroup->removeUserScriptsFromWorld(WebCore::mainThreadNormalWorld());86 userContentController().removeUserScripts(WebCore::mainThreadNormalWorld()); 78 87 } 79 88 80 89 void WebPageGroupProxy::removeAllUserContent() 81 90 { 82 m_pageGroup->removeAllUserContent();91 userContentController().removeAllUserContent(); 83 92 } 84 93 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h
r161148 r176544 38 38 namespace WebCore { 39 39 class PageGroup; 40 class UserContentController; 40 41 } 41 42 … … 53 54 WebCore::PageGroup* corePageGroup() const { return m_pageGroup; } 54 55 56 WebCore::UserContentController& userContentController(); 57 55 58 void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&); 56 57 private:58 WebPageGroupProxy(const WebPageGroupData&);59 59 60 60 void addUserStyleSheet(const WebCore::UserStyleSheet&); … … 64 64 void removeAllUserContent(); 65 65 66 private: 67 WebPageGroupProxy(const WebPageGroupData&); 68 66 69 WebPageGroupData m_data; 67 70 WebCore::PageGroup* m_pageGroup; 71 72 RefPtr<WebCore::UserContentController> m_userContentController; 68 73 }; 69 74
Note:
See TracChangeset
for help on using the changeset viewer.