summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/tools/CodeProfile.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/tools/CodeProfile.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/tools/CodeProfile.h')
-rw-r--r--Source/JavaScriptCore/tools/CodeProfile.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/JavaScriptCore/tools/CodeProfile.h b/Source/JavaScriptCore/tools/CodeProfile.h
index 6b0a30689..4fa357d50 100644
--- a/Source/JavaScriptCore/tools/CodeProfile.h
+++ b/Source/JavaScriptCore/tools/CodeProfile.h
@@ -23,8 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CodeProfile_h
-#define CodeProfile_h
+#pragma once
#include "SourceCode.h"
#include "TieredMMapArray.h"
@@ -37,11 +36,11 @@ class CodeProfile {
public:
CodeProfile(const SourceCode& source, CodeProfile* parent)
: m_file(source.provider()->url().utf8())
- , m_lineNo(source.firstLine())
+ , m_lineNumber(source.firstLine().oneBasedInt())
, m_parent(parent)
{
if (parent)
- parent->addChild(this);
+ parent->addChild(std::unique_ptr<CodeProfile>(this));
}
void sample(void* pc, void** framePointer);
@@ -52,9 +51,9 @@ public:
return m_parent;
}
- void addChild(CodeProfile* child)
+ void addChild(std::unique_ptr<CodeProfile> child)
{
- m_children.append(adoptPtr(child));
+ m_children.append(WTFMove(child));
}
private:
@@ -80,15 +79,12 @@ private:
};
CString m_file;
- unsigned m_lineNo;
+ unsigned m_lineNumber;
CodeProfile* m_parent;
- Vector< OwnPtr<CodeProfile>> m_children;
+ Vector<std::unique_ptr<CodeProfile>> m_children;
TieredMMapArray<CodeRecord> m_samples;
static const char* s_codeTypeNames[NumberOfCodeTypes];
};
-}
-
-#endif // CodeProfile_h
-
+} // namespace JSC