[webkit-reviews] review granted: [Bug 179361] Web Inspector: Eliminate unnecessary hash lookups with NetworkResourceData : [Attachment 326187] [PATCH] Proposed Fix

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 7 01:11:15 PST 2017


Sam Weinig <sam at webkit.org> has granted Joseph Pecoraro <joepeck at webkit.org>'s
request for review:
Bug 179361: Web Inspector: Eliminate unnecessary hash lookups with
NetworkResourceData
https://bugs.webkit.org/show_bug.cgi?id=179361

Attachment 326187: [PATCH] Proposed Fix

https://bugs.webkit.org/attachment.cgi?id=326187&action=review




--- Comment #2 from Sam Weinig <sam at webkit.org> ---
Comment on attachment 326187
  --> https://bugs.webkit.org/attachment.cgi?id=326187
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=326187&action=review

> Source/WebCore/inspector/NetworkResourcesData.cpp:131
> +    auto* resourceData = new ResourceData(requestId, loaderId);
> +    resourceData->setType(type);
> +    m_requestIdToResourceDataMap.set(requestId, resourceData);

An additional cleanup that you might want to do is change
m_requestIdToResourceDataMap to store a std::unique_ptr rather than a raw ptr
for its value.

> Source/WebCore/inspector/NetworkResourcesData.cpp:134
> +void NetworkResourcesData::resourceCreated(const String& requestId, const
String& loaderId, CachedResource* cachedResource)

Can this take the CachedResource by reference?

> Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:351
> +    String loaderId = m_pageAgent->loaderId(&loader);

Can use auto.

> Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:444
> +    String frameId = m_pageAgent->frameId(loader.frame());
> +    String loaderId = m_pageAgent->loaderId(&loader);

Can use auto.

> Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:531
> +    String loaderId = m_pageAgent->loaderId(&loader);
> +    String frameId = m_pageAgent->frameId(loader.frame());

Can use auto.


More information about the webkit-reviews mailing list