OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 double PerformanceEntry::startTime() const { | 58 double PerformanceEntry::startTime() const { |
59 return m_startTime; | 59 return m_startTime; |
60 } | 60 } |
61 | 61 |
62 double PerformanceEntry::duration() const { | 62 double PerformanceEntry::duration() const { |
63 return m_duration; | 63 return m_duration; |
64 } | 64 } |
65 | 65 |
66 PerformanceEntry::EntryType PerformanceEntry::toEntryTypeEnum( | 66 PerformanceEntry::EntryType PerformanceEntry::toEntryTypeEnum( |
67 const String& entryType) { | 67 const String& entryType) { |
68 if (equalIgnoringCase(entryType, "composite")) | 68 if (entryType == "composite") |
69 return Composite; | 69 return Composite; |
70 if (equalIgnoringCase(entryType, "longtask")) | 70 if (entryType == "longtask") |
71 return LongTask; | 71 return LongTask; |
72 if (equalIgnoringCase(entryType, "mark")) | 72 if (entryType == "mark") |
73 return Mark; | 73 return Mark; |
74 if (equalIgnoringCase(entryType, "measure")) | 74 if (entryType == "measure") |
75 return Measure; | 75 return Measure; |
76 if (equalIgnoringCase(entryType, "render")) | 76 if (entryType == "render") |
77 return Render; | 77 return Render; |
78 if (equalIgnoringCase(entryType, "resource")) | 78 if (entryType == "resource") |
79 return Resource; | 79 return Resource; |
80 return Invalid; | 80 return Invalid; |
81 } | 81 } |
82 | 82 |
83 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const { | 83 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const { |
84 V8ObjectBuilder result(scriptState); | 84 V8ObjectBuilder result(scriptState); |
85 buildJSONValue(result); | 85 buildJSONValue(result); |
86 return result.scriptValue(); | 86 return result.scriptValue(); |
87 } | 87 } |
88 | 88 |
89 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const { | 89 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const { |
90 builder.addString("name", name()); | 90 builder.addString("name", name()); |
91 builder.addString("entryType", entryType()); | 91 builder.addString("entryType", entryType()); |
92 builder.addNumber("startTime", startTime()); | 92 builder.addNumber("startTime", startTime()); |
93 builder.addNumber("duration", duration()); | 93 builder.addNumber("duration", duration()); |
94 } | 94 } |
95 | 95 |
96 } // namespace blink | 96 } // namespace blink |
OLD | NEW |