Commit 7241adc0 authored by andersca@apple.com's avatar andersca@apple.com

Simplify ImmutableArray creation

https://bugs.webkit.org/show_bug.cgi?id=124213

Reviewed by Andreas Kling.

Get rid of the various ImmutableArray::adopt functions and have a single create function instead.
Use std::move to avoid unnecessarily copying vector data.

* Shared/API/c/WKArray.cpp:
(WKArrayCreate):
(WKArrayCreateAdoptingValues):
* Shared/Cocoa/WKNSArray.mm:
(-[WKNSArray copyWithZone:]):
* Shared/ImmutableArray.cpp:
(WebKit::ImmutableArray::create):
(WebKit::ImmutableArray::createStringArray):
(WebKit::ImmutableArray::ImmutableArray):
* Shared/ImmutableArray.h:
(WebKit::ImmutableArray::at):
(WebKit::ImmutableArray::size):
(WebKit::ImmutableArray::entries):
* Shared/ImmutableDictionary.cpp:
(WebKit::ImmutableDictionary::keys):
* Shared/MutableArray.cpp:
(WebKit::MutableArray::MutableArray):
(WebKit::MutableArray::append):
(WebKit::MutableArray::reserveCapacity):
(WebKit::MutableArray::removeItemAtIndex):
* Shared/SecurityOriginData.cpp:
(WebKit::performAPICallbackWithSecurityOriginDataVector):
* Shared/UserMessageCoders.h:
(WebKit::UserMessageDecoder::baseDecode):
* Shared/WebArchive.cpp:
(WebKit::WebArchive::subresources):
(WebKit::WebArchive::subframeArchives):
* Shared/WebContextMenuItem.cpp:
(WebKit::WebContextMenuItem::submenuItemsAsImmutableArray):
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextGetInfoForInstalledPlugIns):
* UIProcess/StatisticsRequest.cpp:
(WebKit::StatisticsRequest::completedRequest):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
(WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::pluginInfoStoreDidLoadPlugins):
* UIProcess/WebDatabaseManagerProxy.cpp:
(WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
(WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
* UIProcess/WebKeyValueStorageManager.cpp:
(WebKit::didGetKeyValueStorageOrigins):
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::didChangeBackForwardList):
* UIProcess/WebPageContextMenuClient.cpp:
(WebKit::WebPageContextMenuClient::showContextMenu):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::relatedPages):
(WebKit::WebPageProxy::didFindStringMatches):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::originsWithApplicationCache):
* WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
(WebKit::InjectedBundleBackForwardListItem::children):
* WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
(WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::childFrames):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::trackedRepaintRects):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1641b4bb
2013-11-12 Anders Carlsson <andersca@apple.com>
Simplify ImmutableArray creation
https://bugs.webkit.org/show_bug.cgi?id=124213
Reviewed by Andreas Kling.
Get rid of the various ImmutableArray::adopt functions and have a single create function instead.
Use std::move to avoid unnecessarily copying vector data.
* Shared/API/c/WKArray.cpp:
(WKArrayCreate):
(WKArrayCreateAdoptingValues):
* Shared/Cocoa/WKNSArray.mm:
(-[WKNSArray copyWithZone:]):
* Shared/ImmutableArray.cpp:
(WebKit::ImmutableArray::create):
(WebKit::ImmutableArray::createStringArray):
(WebKit::ImmutableArray::ImmutableArray):
* Shared/ImmutableArray.h:
(WebKit::ImmutableArray::at):
(WebKit::ImmutableArray::size):
(WebKit::ImmutableArray::entries):
* Shared/ImmutableDictionary.cpp:
(WebKit::ImmutableDictionary::keys):
* Shared/MutableArray.cpp:
(WebKit::MutableArray::MutableArray):
(WebKit::MutableArray::append):
(WebKit::MutableArray::reserveCapacity):
(WebKit::MutableArray::removeItemAtIndex):
* Shared/SecurityOriginData.cpp:
(WebKit::performAPICallbackWithSecurityOriginDataVector):
* Shared/UserMessageCoders.h:
(WebKit::UserMessageDecoder::baseDecode):
* Shared/WebArchive.cpp:
(WebKit::WebArchive::subresources):
(WebKit::WebArchive::subframeArchives):
* Shared/WebContextMenuItem.cpp:
(WebKit::WebContextMenuItem::submenuItemsAsImmutableArray):
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextGetInfoForInstalledPlugIns):
* UIProcess/StatisticsRequest.cpp:
(WebKit::StatisticsRequest::completedRequest):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::backListAsImmutableArrayWithLimit):
(WebKit::WebBackForwardList::forwardListAsImmutableArrayWithLimit):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::pluginInfoStoreDidLoadPlugins):
* UIProcess/WebDatabaseManagerProxy.cpp:
(WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
(WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
* UIProcess/WebKeyValueStorageManager.cpp:
(WebKit::didGetKeyValueStorageOrigins):
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::didChangeBackForwardList):
* UIProcess/WebPageContextMenuClient.cpp:
(WebKit::WebPageContextMenuClient::showContextMenu):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::relatedPages):
(WebKit::WebPageProxy::didFindStringMatches):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::originsWithApplicationCache):
* WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
(WebKit::InjectedBundleBackForwardListItem::children):
* WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
(WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::childFrames):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::trackedRepaintRects):
2013-11-12 Csaba Osztrogonác <ossy@webkit.org>
The last URTBF after r159108 to make GTK happy.
......
......@@ -38,14 +38,24 @@ WKTypeID WKArrayGetTypeID()
WKArrayRef WKArrayCreate(WKTypeRef* values, size_t numberOfValues)
{
RefPtr<ImmutableArray> array = ImmutableArray::create(reinterpret_cast<APIObject**>(const_cast<void**>(values)), numberOfValues);
return toAPI(array.release().leakRef());
Vector<RefPtr<APIObject>> elements;
elements.reserveInitialCapacity(numberOfValues);
for (size_t i = 0; i < numberOfValues; ++i)
elements.uncheckedAppend(const_cast<APIObject*>(static_cast<const APIObject*>(values[i])));
return toAPI(ImmutableArray::create(std::move(elements)).leakRef());
}
WKArrayRef WKArrayCreateAdoptingValues(WKTypeRef* values, size_t numberOfValues)
{
RefPtr<ImmutableArray> array = ImmutableArray::adopt(reinterpret_cast<APIObject**>(const_cast<void**>(values)), numberOfValues);
return toAPI(array.release().leakRef());
Vector<RefPtr<APIObject>> elements;
elements.reserveInitialCapacity(numberOfValues);
for (size_t i = 0; i < numberOfValues; ++i)
elements.uncheckedAppend(adoptRef(const_cast<APIObject*>(static_cast<const APIObject*>(values[i]))));
return toAPI(ImmutableArray::create(std::move(elements)).leakRef());
}
WKTypeRef WKArrayGetItemAtIndex(WKArrayRef arrayRef, size_t index)
......
......@@ -62,7 +62,7 @@ using namespace WebKit;
return [self retain];
auto entries = reinterpret_cast<ImmutableArray*>(&_array)->entries();
return ImmutableArray::adopt(entries).leakRef()->wrapper();
return ImmutableArray::create(std::move(entries)).leakRef()->wrapper();
}
#pragma mark WKObject protocol implementation
......
......@@ -30,38 +30,30 @@
namespace WebKit {
PassRefPtr<ImmutableArray> ImmutableArray::createStringArray(const Vector<String>& strings)
PassRefPtr<ImmutableArray> ImmutableArray::create()
{
Vector<RefPtr<APIObject>> elements;
elements.reserveInitialCapacity(strings.size());
for (const auto& string : strings)
elements.uncheckedAppend(WebString::create(string));
return adopt(elements);
return create(Vector<RefPtr<APIObject>>());
}
ImmutableArray::ImmutableArray()
PassRefPtr<ImmutableArray> ImmutableArray::create(Vector<RefPtr<APIObject>> elements)
{
return adoptRef(new ImmutableArray(std::move(elements)));
}
ImmutableArray::ImmutableArray(AdoptTag, APIObject** entries, size_t size)
: m_entries(size)
PassRefPtr<ImmutableArray> ImmutableArray::createStringArray(const Vector<String>& strings)
{
for (size_t i = 0; i < size; ++i)
m_entries[i] = adoptRef(entries[i]);
}
Vector<RefPtr<APIObject>> elements;
elements.reserveInitialCapacity(strings.size());
ImmutableArray::ImmutableArray(APIObject** entries, size_t size)
: m_entries(size)
{
for (size_t i = 0; i < size; ++i)
m_entries[i] = entries[i];
for (const auto& string : strings)
elements.uncheckedAppend(WebString::create(string));
return create(std::move(elements));
}
ImmutableArray::ImmutableArray(Vector<RefPtr<APIObject>>& entries)
ImmutableArray::ImmutableArray(Vector<RefPtr<APIObject>> elements)
: m_elements(std::move(elements))
{
m_entries.swap(entries);
}
ImmutableArray::~ImmutableArray()
......
......@@ -37,24 +37,8 @@ namespace WebKit {
class ImmutableArray : public TypedAPIObject<APIObject::TypeArray> {
public:
enum AdoptTag { Adopt };
static PassRefPtr<ImmutableArray> create()
{
return adoptRef(new ImmutableArray);
}
static PassRefPtr<ImmutableArray> create(APIObject** entries, size_t size)
{
return adoptRef(new ImmutableArray(entries, size));
}
static PassRefPtr<ImmutableArray> adopt(APIObject** entries, size_t size)
{
return adoptRef(new ImmutableArray(Adopt, entries, size));
}
static PassRefPtr<ImmutableArray> adopt(Vector<RefPtr<APIObject>>& entries)
{
return adoptRef(new ImmutableArray(entries));
}
static PassRefPtr<ImmutableArray> create();
static PassRefPtr<ImmutableArray> create(Vector<RefPtr<APIObject>> elements);
static PassRefPtr<ImmutableArray> createStringArray(const Vector<String>&);
......@@ -63,27 +47,24 @@ public:
template<typename T>
T* at(size_t i) const
{
if (m_entries[i]->type() != T::APIType)
if (m_elements[i]->type() != T::APIType)
return nullptr;
return static_cast<T*>(m_entries[i].get());
return static_cast<T*>(m_elements[i].get());
}
APIObject* at(size_t i) const { return m_entries[i].get(); }
size_t size() const { return m_entries.size(); }
APIObject* at(size_t i) const { return m_elements[i].get(); }
size_t size() const { return m_elements.size(); }
virtual bool isMutable() { return false; }
const Vector<RefPtr<APIObject>>& entries() const { return m_entries; }
Vector<RefPtr<APIObject>>& entries() { return m_entries; }
const Vector<RefPtr<APIObject>>& entries() const { return m_elements; }
Vector<RefPtr<APIObject>>& entries() { return m_elements; }
protected:
ImmutableArray();
ImmutableArray(AdoptTag, APIObject** entries, size_t);
ImmutableArray(APIObject** entries, size_t);
ImmutableArray(Vector<RefPtr<APIObject>>& entries);
ImmutableArray(Vector<RefPtr<APIObject>> elements);
Vector<RefPtr<APIObject>> m_entries;
Vector<RefPtr<APIObject>> m_elements;
};
} // namespace WebKit
......
......@@ -55,7 +55,7 @@ PassRefPtr<ImmutableArray> ImmutableDictionary::keys() const
for (const auto& key : m_map.keys())
keys.uncheckedAppend(WebString::create(key));
return ImmutableArray::adopt(keys);
return ImmutableArray::create(std::move(keys));
}
} // namespace WebKit
......@@ -29,6 +29,7 @@
namespace WebKit {
MutableArray::MutableArray()
: ImmutableArray(Vector<RefPtr<APIObject>>())
{
}
......@@ -38,17 +39,17 @@ MutableArray::~MutableArray()
void MutableArray::append(PassRefPtr<APIObject> item)
{
m_entries.append(item);
m_elements.append(item);
}
void MutableArray::reserveCapacity(unsigned capacity)
{
m_entries.reserveCapacity(capacity);
m_elements.reserveCapacity(capacity);
}
void MutableArray::removeItemAtIndex(unsigned index)
{
m_entries.remove(index);
m_elements.remove(index);
}
} // namespace WebKit
......@@ -87,7 +87,7 @@ void performAPICallbackWithSecurityOriginDataVector(const Vector<SecurityOriginD
securityOrigins.uncheckedAppend(std::move(origin));
}
callback->performCallbackWithReturnValue(ImmutableArray::adopt(securityOrigins).get());
callback->performCallbackWithReturnValue(ImmutableArray::create(std::move(securityOrigins)).get());
}
} // namespace WebKit
......@@ -283,7 +283,7 @@ public:
vector.append(element.release());
}
coder.m_root = ImmutableArray::adopt(vector);
coder.m_root = ImmutableArray::create(std::move(vector));
break;
}
case APIObject::TypeDictionary: {
......
......@@ -113,7 +113,7 @@ ImmutableArray* WebArchive::subresources()
for (const auto& subresource : m_legacyWebArchive->subresources())
subresources.uncheckedAppend(WebArchiveResource::create(subresource));
m_cachedSubresources = ImmutableArray::adopt(subresources);
m_cachedSubresources = ImmutableArray::create(std::move(subresources));
}
return m_cachedSubresources.get();
......@@ -128,7 +128,7 @@ ImmutableArray* WebArchive::subframeArchives()
for (const auto& subframeArchive : m_legacyWebArchive->subframeArchives())
subframeWebArchives.uncheckedAppend(WebArchive::create(static_cast<LegacyWebArchive*>(subframeArchive.get())));
m_cachedSubframeArchives = ImmutableArray::adopt(subframeWebArchives);
m_cachedSubframeArchives = ImmutableArray::create(std::move(subframeWebArchives));
}
return m_cachedSubframeArchives.get();
......
......@@ -72,7 +72,7 @@ PassRefPtr<ImmutableArray> WebContextMenuItem::submenuItemsAsImmutableArray() co
for (const auto& item : m_webContextMenuItemData.submenu())
submenuItems.uncheckedAppend(WebContextMenuItem::create(item));
return ImmutableArray::adopt(submenuItems);
return ImmutableArray::create(std::move(submenuItems));
}
APIObject* WebContextMenuItem::userData() const
......
......@@ -79,7 +79,7 @@ void WKContextGetInfoForInstalledPlugIns(WKContextRef contextRef, WKContextGetIn
for (const auto& plugin: plugins)
pluginInfoDictionaries.uncheckedAppend(createPluginInformationDictionary(plugin));
RefPtr<ImmutableArray> array = ImmutableArray::adopt(pluginInfoDictionaries);
RefPtr<ImmutableArray> array = ImmutableArray::create(std::move(pluginInfoDictionaries));
toImpl(contextRef)->ref();
dispatch_async(dispatch_get_main_queue(), ^() {
......
......@@ -91,7 +91,7 @@ void StatisticsRequest::completedRequest(uint64_t requestID, const StatisticsDat
for (const auto& statistic : data.webCoreCacheStatistics)
cacheStatistics.uncheckedAppend(createDictionaryFromHashMap(statistic));
m_responseDictionary->set("WebCoreCacheStatistics", ImmutableArray::adopt(cacheStatistics).get());
m_responseDictionary->set("WebCoreCacheStatistics", ImmutableArray::create(std::move(cacheStatistics)).get());
}
if (m_outstandingRequests.isEmpty()) {
......
......@@ -221,7 +221,7 @@ PassRefPtr<ImmutableArray> WebBackForwardList::backListAsImmutableArrayWithLimit
vector.uncheckedAppend(m_entries[i].get());
}
return ImmutableArray::adopt(vector);
return ImmutableArray::create(std::move(vector));
}
PassRefPtr<ImmutableArray> WebBackForwardList::forwardListAsImmutableArrayWithLimit(unsigned limit) const
......@@ -245,7 +245,7 @@ PassRefPtr<ImmutableArray> WebBackForwardList::forwardListAsImmutableArrayWithLi
vector.uncheckedAppend(m_entries[i].get());
}
return ImmutableArray::adopt(vector);
return ImmutableArray::create(std::move(vector));
}
void WebBackForwardList::clear()
......
......@@ -1272,7 +1272,7 @@ void WebContext::pluginInfoStoreDidLoadPlugins(PluginInfoStore* store)
mimeTypes.reserveInitialCapacity(pluginModule.info.mimes.size());
for (const auto& mimeClassInfo : pluginModule.info.mimes)
mimeTypes.uncheckedAppend(WebString::create(mimeClassInfo.type));
map.set(ASCIILiteral("mimes"), ImmutableArray::adopt(mimeTypes));
map.set(ASCIILiteral("mimes"), ImmutableArray::create(std::move(mimeTypes)));
#if PLATFORM(MAC)
map.set(ASCIILiteral("bundleId"), WebString::create(pluginModule.bundleIdentifier));
......@@ -1282,7 +1282,7 @@ void WebContext::pluginInfoStoreDidLoadPlugins(PluginInfoStore* store)
plugins.uncheckedAppend(ImmutableDictionary::adopt(map));
}
m_client.plugInInformationBecameAvailable(this, ImmutableArray::adopt(plugins).get());
m_client.plugInInformationBecameAvailable(this, ImmutableArray::create(std::move(plugins)).get());
}
#endif
......
......@@ -180,12 +180,12 @@ void WebDatabaseManagerProxy::didGetDatabasesByOrigin(const Vector<OriginAndData
originAndDatabasesMap.set(originKey(), origin);
originAndDatabasesMap.set(originQuotaKey(), WebUInt64::create(originAndDatabases.originQuota));
originAndDatabasesMap.set(originUsageKey(), WebUInt64::create(originAndDatabases.originUsage));
originAndDatabasesMap.set(databaseDetailsKey(), ImmutableArray::adopt(databases));
originAndDatabasesMap.set(databaseDetailsKey(), ImmutableArray::create(std::move(databases)));
result.uncheckedAppend(ImmutableDictionary::adopt(originAndDatabasesMap));
}
callback->performCallbackWithReturnValue(ImmutableArray::adopt(result).get());
callback->performCallbackWithReturnValue(ImmutableArray::create(std::move(result)).get());
}
void WebDatabaseManagerProxy::getDatabaseOrigins(PassRefPtr<ArrayCallback> prpCallback)
......@@ -211,7 +211,7 @@ void WebDatabaseManagerProxy::didGetDatabaseOrigins(const Vector<String>& origin
for (const auto& originIdentifier : originIdentifiers)
securityOrigins.uncheckedAppend(WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier));
callback->performCallbackWithReturnValue(ImmutableArray::adopt(securityOrigins).get());
callback->performCallbackWithReturnValue(ImmutableArray::create(std::move(securityOrigins)).get());
}
void WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin(const String& databaseIdentifier, WebSecurityOrigin* origin)
......
......@@ -75,7 +75,7 @@ static void didGetKeyValueStorageOrigins(const Vector<RefPtr<WebCore::SecurityOr
for (unsigned i = 0; i < securityOrigins.size(); ++i)
webSecurityOrigins.uncheckedAppend(WebSecurityOrigin::create(securityOrigins[i]));
callback->performCallbackWithReturnValue(ImmutableArray::adopt(webSecurityOrigins).get());
callback->performCallbackWithReturnValue(ImmutableArray::create(std::move(webSecurityOrigins)).get());
}
void WebKeyValueStorageManager::getKeyValueStorageOrigins(PassRefPtr<ArrayCallback> prpCallback)
......
......@@ -245,7 +245,7 @@ void WebLoaderClient::didChangeBackForwardList(WebPageProxy* page, WebBackForwar
RefPtr<ImmutableArray> removedItemsArray;
if (removedItems && !removedItems->isEmpty())
removedItemsArray = ImmutableArray::adopt(*removedItems);
removedItemsArray = ImmutableArray::create(std::move(*removedItems));
m_client.didChangeBackForwardList(toAPI(page), toAPI(addedItem), toAPI(removedItemsArray.get()), m_client.clientInfo);
}
......
......@@ -104,7 +104,7 @@ bool WebPageContextMenuClient::showContextMenu(WebPageProxy* page, const WebCore
for (const auto& menuItem : menuItemsVector)
menuItems.uncheckedAppend(WebContextMenuItem::create(menuItem));
m_client.showContextMenu(toAPI(page), toAPI(menuLocation), toAPI(ImmutableArray::adopt(menuItems).get()), m_client.clientInfo);
m_client.showContextMenu(toAPI(page), toAPI(menuLocation), toAPI(ImmutableArray::create(std::move(menuItems)).get()), m_client.clientInfo);
return true;
}
......
......@@ -400,7 +400,7 @@ PassRefPtr<ImmutableArray> WebPageProxy::relatedPages() const
result.uncheckedAppend(page);
}
return ImmutableArray::adopt(result);
return ImmutableArray::create(std::move(result));
}
void WebPageProxy::initializeLoaderClient(const WKPageLoaderClient* loadClient)
......@@ -3047,10 +3047,10 @@ void WebPageProxy::didFindStringMatches(const String& string, Vector<Vector<WebC
for (const auto& rect : rects)
apiRects.uncheckedAppend(WebRect::create(toAPI(rect)));
matches.uncheckedAppend(ImmutableArray::adopt(apiRects));
matches.uncheckedAppend(ImmutableArray::create(std::move(apiRects)));
}
m_findMatchesClient.didFindStringMatches(this, string, ImmutableArray::adopt(matches).get(), firstIndexAfterSelection);
m_findMatchesClient.didFindStringMatches(this, string, ImmutableArray::create(std::move(matches)).get(), firstIndexAfterSelection);
}
void WebPageProxy::didFailToFindString(const String& string)
......
......@@ -414,7 +414,7 @@ PassRefPtr<ImmutableArray> InjectedBundle::originsWithApplicationCache()
for (const auto& origin : origins)
originIdentifiers.uncheckedAppend(WebString::create(origin->databaseIdentifier()));
return ImmutableArray::adopt(originIdentifiers);
return ImmutableArray::create(std::move(originIdentifiers));
}
int InjectedBundle::numberOfPages(WebFrame* frame, double pageWidthInPixels, double pageHeightInPixels)
......
......@@ -40,7 +40,7 @@ PassRefPtr<ImmutableArray> InjectedBundleBackForwardListItem::children() const
for (const auto& child : m_item->children())
children.uncheckedAppend(InjectedBundleBackForwardListItem::create(child));
return ImmutableArray::adopt(children);
return ImmutableArray::create(std::move(children));
}
} // namespace WebKit
......@@ -136,7 +136,7 @@ void InjectedBundlePageFormClient::didAssociateFormControls(WebPage* page, const
for (const auto& element : elements)
elementHandles.uncheckedAppend(InjectedBundleNodeHandle::getOrCreate(element.get()));
m_client.didAssociateFormControls(toAPI(page), toAPI(ImmutableArray::adopt(elementHandles).get()), m_client.clientInfo);
m_client.didAssociateFormControls(toAPI(page), toAPI(ImmutableArray::create(std::move(elementHandles)).get()), m_client.clientInfo);
}
bool InjectedBundlePageFormClient::shouldNotifyOnFormChanges(WebPage* page)
......
......@@ -431,7 +431,7 @@ PassRefPtr<ImmutableArray> WebFrame::childFrames()
vector.uncheckedAppend(webFrame);
}
return ImmutableArray::adopt(vector);
return ImmutableArray::create(std::move(vector));
}
String WebFrame::layerTreeAsText() const
......
......@@ -668,7 +668,7 @@ PassRefPtr<ImmutableArray> WebPage::trackedRepaintRects()
for (const auto& repaintRect : view->trackedRepaintRects())
repaintRects.uncheckedAppend(WebRect::create(toAPI(repaintRect)));
return ImmutableArray::adopt(repaintRects);
return ImmutableArray::create(std::move(repaintRects));
}
PluginView* WebPage::focusedPluginViewForFrame(Frame& frame)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment