[webkit-reviews] review granted: [Bug 45822] We should save messages that can't be sent when postMessageToInjectedBundle is called and send in ensureWebProcess : [Attachment 67741] Save the messages in postMessageToInjectedBundle and send them in ensureWebProcess

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 15 18:17:33 PDT 2010


Jon Honeycutt <jhoneycutt at apple.com> has granted Jessie Berlin
<jberlin at webkit.org>'s request for review:
Bug 45822: We should save messages that can't be sent when
postMessageToInjectedBundle is called and send in ensureWebProcess
https://bugs.webkit.org/show_bug.cgi?id=45822

Attachment 67741: Save the messages in postMessageToInjectedBundle and send
them in ensureWebProcess
https://bugs.webkit.org/attachment.cgi?id=67741&action=review

------- Additional Comments from Jon Honeycutt <jhoneycutt at apple.com>
> @@ -130,6 +130,12 @@ void WebContext::ensureWebProcess()
>      for (HashSet<String>::iterator it =
m_schemesToRegisterAsEmptyDocument.begin(), end =
m_schemesToRegisterAsEmptyDocument.end(); it != end; ++it)
>	   m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument,
0, CoreIPC::In(*it));
>  
> +    for (size_t i = 0; i != m_pendingMessagesToPostToInjectedBundle.size();
++i) {
> +	   pair<String, RefPtr<APIObject> > message =
m_pendingMessagesToPostToInjectedBundle[i];

I think you can make message a reference to avoid a copy.

> @@ -197,8 +203,10 @@ void WebContext::preferencesDidChange()
>  
>  void WebContext::postMessageToInjectedBundle(const String& messageName,
APIObject* messageBody)
>  {
> -    if (!hasValidProcess())
> +    if (!hasValidProcess()) {
> +	   m_pendingMessagesToPostToInjectedBundle.append(pair<String,
RefPtr<APIObject> >(messageName, messageBody));

You can simplify this using make_pair(messageName, messageBody).

r=me


More information about the webkit-reviews mailing list