Add -[WKProcessPool _setObjectsForBundleParametersWithDictionary:]
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Oct 2015 19:40:17 +0000 (19:40 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Oct 2015 19:40:17 +0000 (19:40 +0000)
commit1c03d56adc996687994c047945293e12932d3907
treec8c70c4248fa01d8e21f188a3affbe3dc972dd6d
parent998e792fc5cfade1161c487c6b0d4a16c9666e78
Add -[WKProcessPool _setObjectsForBundleParametersWithDictionary:]
https://bugs.webkit.org/show_bug.cgi?id=149887

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
Copy the dictionary, archive it, and set the values on the UI side bundle parameter data struct.

* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
Add new SPI.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
(-[WKWebProcessBundleParameters setParameter:forKey:]):
We can just call setValue:forKey: on the dictionary; it will do the right thing if value is nil.

(-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:]):
Enumerate the dictionary and call setValue:forKey: on each key/value pair.

* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::setBundleParameter):
If we fail to unarchive a parameter, don't set it to null.

(WebKit::InjectedBundle::setBundleParameters):
Unarchive the dictionary and update the bundle parameters.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setInjectedBundleParameters):
Call the injected bundle.

* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
Add new message.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm
Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
Source/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/WebProcess.messages.in