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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (entry_type == "render") | 76 if (entry_type == "render") |
77 return kRender; | 77 return kRender; |
78 if (entry_type == "resource") | 78 if (entry_type == "resource") |
79 return kResource; | 79 return kResource; |
80 if (entry_type == "navigation") | 80 if (entry_type == "navigation") |
81 return kNavigation; | 81 return kNavigation; |
82 if (entry_type == "taskattribution") | 82 if (entry_type == "taskattribution") |
83 return kTaskAttribution; | 83 return kTaskAttribution; |
84 if (entry_type == "paint") | 84 if (entry_type == "paint") |
85 return kPaint; | 85 return kPaint; |
| 86 if (entry_type == "server") |
| 87 return kServer; |
86 return kInvalid; | 88 return kInvalid; |
87 } | 89 } |
88 | 90 |
89 ScriptValue PerformanceEntry::toJSONForBinding( | 91 ScriptValue PerformanceEntry::toJSONForBinding( |
90 ScriptState* script_state) const { | 92 ScriptState* script_state) const { |
91 V8ObjectBuilder result(script_state); | 93 V8ObjectBuilder result(script_state); |
92 BuildJSONValue(result); | 94 BuildJSONValue(result); |
93 return result.GetScriptValue(); | 95 return result.GetScriptValue(); |
94 } | 96 } |
95 | 97 |
96 void PerformanceEntry::BuildJSONValue(V8ObjectBuilder& builder) const { | 98 void PerformanceEntry::BuildJSONValue(V8ObjectBuilder& builder) const { |
97 builder.AddString("name", name()); | 99 builder.AddString("name", name()); |
98 builder.AddString("entryType", entryType()); | 100 builder.AddString("entryType", entryType()); |
99 builder.AddNumber("startTime", startTime()); | 101 builder.AddNumber("startTime", startTime()); |
100 builder.AddNumber("duration", duration()); | 102 builder.AddNumber("duration", duration()); |
101 } | 103 } |
102 | 104 |
103 } // namespace blink | 105 } // namespace blink |
OLD | NEW |