| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 double PerformanceEntry::duration() const | 66 double PerformanceEntry::duration() const |
| 67 { | 67 { |
| 68 return m_duration; | 68 return m_duration; |
| 69 } | 69 } |
| 70 | 70 |
| 71 PerformanceEntry::EntryType PerformanceEntry::toEntryTypeEnum(const String& entr
yType) | 71 PerformanceEntry::EntryType PerformanceEntry::toEntryTypeEnum(const String& entr
yType) |
| 72 { | 72 { |
| 73 if (equalIgnoringCase(entryType, "composite")) | 73 if (equalIgnoringCase(entryType, "composite")) |
| 74 return Composite; | 74 return Composite; |
| 75 if (equalIgnoringCase(entryType, "longtask")) |
| 76 return LongTask; |
| 75 if (equalIgnoringCase(entryType, "mark")) | 77 if (equalIgnoringCase(entryType, "mark")) |
| 76 return Mark; | 78 return Mark; |
| 77 if (equalIgnoringCase(entryType, "measure")) | 79 if (equalIgnoringCase(entryType, "measure")) |
| 78 return Measure; | 80 return Measure; |
| 79 if (equalIgnoringCase(entryType, "render")) | 81 if (equalIgnoringCase(entryType, "render")) |
| 80 return Render; | 82 return Render; |
| 81 if (equalIgnoringCase(entryType, "resource")) | 83 if (equalIgnoringCase(entryType, "resource")) |
| 82 return Resource; | 84 return Resource; |
| 83 return Invalid; | 85 return Invalid; |
| 84 } | 86 } |
| 85 | 87 |
| 86 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const | 88 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const |
| 87 { | 89 { |
| 88 V8ObjectBuilder result(scriptState); | 90 V8ObjectBuilder result(scriptState); |
| 89 buildJSONValue(result); | 91 buildJSONValue(result); |
| 90 return result.scriptValue(); | 92 return result.scriptValue(); |
| 91 } | 93 } |
| 92 | 94 |
| 93 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const | 95 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const |
| 94 { | 96 { |
| 95 builder.addString("name", name()); | 97 builder.addString("name", name()); |
| 96 builder.addString("entryType", entryType()); | 98 builder.addString("entryType", entryType()); |
| 97 builder.addNumber("startTime", startTime()); | 99 builder.addNumber("startTime", startTime()); |
| 98 builder.addNumber("duration", duration()); | 100 builder.addNumber("duration", duration()); |
| 99 } | 101 } |
| 100 | 102 |
| 101 } // namespace blink | 103 } // namespace blink |
| OLD | NEW |