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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 if (entryType == "mark") | 72 if (entryType == "mark") |
73 return Mark; | 73 return Mark; |
74 if (entryType == "measure") | 74 if (entryType == "measure") |
75 return Measure; | 75 return Measure; |
76 if (entryType == "render") | 76 if (entryType == "render") |
77 return Render; | 77 return Render; |
78 if (entryType == "resource") | 78 if (entryType == "resource") |
79 return Resource; | 79 return Resource; |
80 if (entryType == "navigation") | 80 if (entryType == "navigation") |
81 return Navigation; | 81 return Navigation; |
| 82 if (entryType == "taskattribution") |
| 83 return TaskAttribution; |
82 return Invalid; | 84 return Invalid; |
83 } | 85 } |
84 | 86 |
85 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const { | 87 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const { |
86 V8ObjectBuilder result(scriptState); | 88 V8ObjectBuilder result(scriptState); |
87 buildJSONValue(result); | 89 buildJSONValue(result); |
88 return result.scriptValue(); | 90 return result.scriptValue(); |
89 } | 91 } |
90 | 92 |
91 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const { | 93 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const { |
92 builder.addString("name", name()); | 94 builder.addString("name", name()); |
93 builder.addString("entryType", entryType()); | 95 builder.addString("entryType", entryType()); |
94 builder.addNumber("startTime", startTime()); | 96 builder.addNumber("startTime", startTime()); |
95 builder.addNumber("duration", duration()); | 97 builder.addNumber("duration", duration()); |
96 } | 98 } |
97 | 99 |
98 } // namespace blink | 100 } // namespace blink |
OLD | NEW |