When a new origin hash is added, notify the context client of the change. The client can then request from the context a copy of the table for its own record keeping, such as saving to disk.
<rdar://problem/12906267>
Created attachment 180108 [details] Patch
Comment on attachment 180108 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180108&action=review > Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.cpp:55 > m_context->sendToAllProcesses(Messages::WebProcess::DidAddPlugInAutoStartOrigin(plugInOriginHash)); > + m_context->client().plugInAutoStartOriginHashesChanged(m_context); > } Is it expected that a client will always call WKContextCopyPlugInAutoStartOriginHashes in response to this client callback? If so, we should just pass the new hashes along with it. And - if so - we might not even need the autoStartOriginsTableCopy accessor at all. > Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.cpp:69 > + ImmutableDictionary::MapType map; > + AutoStartTable::const_iterator itEnd = m_autoStartTable.end(); > + for (AutoStartTable::const_iterator it = m_autoStartTable.begin(); it != itEnd; ++it) { > + Vector<RefPtr<APIObject> > hashes; Just call itEnd "end", please. That's what we do everywhere else. > Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.cpp:71 > + HashSet<unsigned>::iterator valueItEnd = it->value.end(); > + for (HashSet<unsigned>::iterator valueIt = it->value.begin(); valueIt != valueItEnd; ++valueIt) And "valueItEnd" should just be "valueEnd"
Comment on attachment 180108 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180108&action=review >> Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.cpp:55 >> } > > Is it expected that a client will always call WKContextCopyPlugInAutoStartOriginHashes in response to this client callback? > > If so, we should just pass the new hashes along with it. > > And - if so - we might not even need the autoStartOriginsTableCopy accessor at all. No. The client may choose to aggregate these callbacks, and only invoke WKContextCopyPlugInAutoStartOriginHashes periodically. >> Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.cpp:69 >> + Vector<RefPtr<APIObject> > hashes; > > Just call itEnd "end", please. That's what we do everywhere else. Done. >> Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.cpp:71 >> + for (HashSet<unsigned>::iterator valueIt = it->value.begin(); valueIt != valueItEnd; ++valueIt) > > And "valueItEnd" should just be "valueEnd" Done.
Comment on attachment 180108 [details] Patch r+ assuming Jon made the changes he said he made.
Committed r138185: <http://trac.webkit.org/changeset/138185>