Web Inspector: Native Memory Instrumentation: replace String with const char* in MemoryObjectInfo
https://bugs.webkit.org/show_bug.cgi?id=110599

Reviewed by Yury Semikhatsky.

Due to potentially dynamic nature of names and classNames we need to make a copy of the strings
that were given us via MemoryInstrumentation calls.
So I extended client api with registerString method that pushes the strings
down to the serializer.

Source/WebCore:

* css/InspectorCSSOMWrappers.h:
* inspector/HeapGraphSerializer.cpp:
(WebCore::HeapGraphSerializer::HeapGraphSerializer):
(WebCore::HeapGraphSerializer::reportNodeImpl):
(WebCore::HeapGraphSerializer::reportEdgeImpl):
(WebCore::HeapGraphSerializer::registerString):
(WebCore::HeapGraphSerializer::registerTypeString):
(WebCore::HeapGraphSerializer::addRootNode):
* inspector/HeapGraphSerializer.h:
(HeapGraphSerializer):
* inspector/MemoryInstrumentationImpl.cpp:
(WebCore::MemoryInstrumentationClientImpl::registerString):
(WebCore):
* inspector/MemoryInstrumentationImpl.h:
(MemoryInstrumentationClientImpl):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::reportMemoryUsage):

Source/WTF:

* wtf/MemoryInstrumentation.h:
(MemoryInstrumentationClient):
* wtf/MemoryObjectInfo.h:
(WTF::MemoryObjectInfo::MemoryObjectInfo):
(WTF::MemoryObjectInfo::setClassName):
(WTF::MemoryObjectInfo::classNameId):
(WTF::MemoryObjectInfo::setName):
(WTF::MemoryObjectInfo::nameId):
(MemoryObjectInfo):

Tools:

* TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp:
* TestWebKitAPI/Tests/WebCore/HeapGraphSerializerTest.cpp:
(TestWebKitAPI::Helper::Helper):
(Helper):
(TestWebKitAPI::Helper::addNode):
(TestWebKitAPI::TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143913 268f45cc-cd09-0410-ab3c-d52691b4dbfc