We need a mechanism to allow injecting code into the WebProcess on startup, sort of like a plugin, but for the embedding app instead of the web content.
Created attachment 58793 [details] patch
Comment on attachment 58793 [details] patch Double change log in this patch.
Comment on attachment 58793 [details] patch > Index: WebKit2/ChangeLog > =================================================================== > --- WebKit2/ChangeLog (revision 61196) > +++ WebKit2/ChangeLog (working copy) > @@ -1,3 +1,172 @@ > +2010-06-15 Sam Weinig <sam@webkit.org> > + > + Reviewed by NOBODY (OOPS!). > + > + Fix for https://bugs.webkit.org/show_bug.cgi?id=40630 > + WebKit2: Add mechanism to inject code into the WebProcess on startup > + > + Add initial WebBundle support. Let's call it "Injected Bundle" instead. > Index: WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h > =================================================================== > --- WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h (revision 61159) > +++ WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h (working copy) > @@ -33,6 +33,7 @@ > namespace WebProcessMessage { > > enum Kind { > + LoadWebBundle, > Create > }; > Injected bundle. > Index: WebKit2/UIProcess/WebContext.cpp > =================================================================== > --- WebKit2/UIProcess/WebContext.cpp (revision 61159) > +++ WebKit2/UIProcess/WebContext.cpp (working copy) > @@ -36,6 +36,8 @@ > #include <wtf/RefCountedLeakCounter.h> > #endif > > +using namespace WebCore; > + > namespace WebKit { > > #ifndef NDEBUG > @@ -55,6 +57,20 @@ WebContext::WebContext(ProcessModel proc > #endif > } > > +WebContext::WebContext(ProcessModel processModel, const WebCore::String& bundlePath) > + : m_processModel(processModel) > + , m_bundlePath(bundlePath) > +{ > + RunLoop::initializeMainRunLoop(); > + > + m_preferences = WebPreferences::shared(); > + m_preferences->addContext(this); > + > +#ifndef NDEBUG > + webContextCounter.increment(); > +#endif > +} > + No need for an extra constructor, just add a bundlePath parameter to the already existing constructor. > WebContext::~WebContext() > { > ASSERT(m_pageNamespaces.isEmpty()); > Index: WebKit2/UIProcess/WebContext.h > =================================================================== > --- WebKit2/UIProcess/WebContext.h (revision 61159) > +++ WebKit2/UIProcess/WebContext.h (working copy) > @@ -27,6 +27,7 @@ > #define WebContext_h > > #include "ProcessModel.h" > +#include <WebCore/PlatformString.h> > #include <wtf/HashSet.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > @@ -46,26 +47,35 @@ public: > return adoptRef(new WebContext(processModel)); > } > > + static PassRefPtr<WebContext> create(ProcessModel processModel, const WebCore::String& bundlePath) > + { > + return adoptRef(new WebContext(processModel, bundlePath)); > + } > + No need for an extra ::create function here. > > +void WebProcess::loadWebBundle(const WebCore::String& path) > +{ InjectedBundle! (I'm gonna stop complaining about that now). > +void WebBundle::initializeClient(WKBundleClient* client) > +{ > + if (client && !client->version) > + m_client = *client; Maybe we should log an error if the client version didn't match? r=me!
Landed in r61222.
Comment on attachment 58793 [details] patch Cleared r? since the patch was "r=me" (in comments) and landed.