Bug 1166492 - Return UniquePtr<char[]> from profiler_get_profile to avoid double copying. (r=mstange)
This commit is contained in:
@@ -2566,10 +2566,9 @@ PluginModuleChild::RecvStopProfiler()
|
||||
bool
|
||||
PluginModuleChild::AnswerGetProfile(nsCString* aProfile)
|
||||
{
|
||||
char* profile = profiler_get_profile();
|
||||
UniquePtr<char[]> profile = profiler_get_profile();
|
||||
if (profile != nullptr) {
|
||||
*aProfile = nsCString(profile, strlen(profile));
|
||||
free(profile);
|
||||
*aProfile = nsCString(profile.get(), strlen(profile.get()));
|
||||
} else {
|
||||
*aProfile = nsCString("", 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user