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; | |
88 return kInvalid; | 86 return kInvalid; |
89 } | 87 } |
90 | 88 |
91 ScriptValue PerformanceEntry::toJSONForBinding( | 89 ScriptValue PerformanceEntry::toJSONForBinding( |
92 ScriptState* script_state) const { | 90 ScriptState* script_state) const { |
93 V8ObjectBuilder result(script_state); | 91 V8ObjectBuilder result(script_state); |
94 BuildJSONValue(result); | 92 BuildJSONValue(script_state, result); |
95 return result.GetScriptValue(); | 93 return result.GetScriptValue(); |
96 } | 94 } |
97 | 95 |
98 void PerformanceEntry::BuildJSONValue(V8ObjectBuilder& builder) const { | 96 void PerformanceEntry::BuildJSONValue(ScriptState* script_state, |
| 97 V8ObjectBuilder& builder) const { |
99 builder.AddString("name", name()); | 98 builder.AddString("name", name()); |
100 builder.AddString("entryType", entryType()); | 99 builder.AddString("entryType", entryType()); |
101 builder.AddNumber("startTime", startTime()); | 100 builder.AddNumber("startTime", startTime()); |
102 builder.AddNumber("duration", duration()); | 101 builder.AddNumber("duration", duration()); |
103 } | 102 } |
104 | 103 |
105 } // namespace blink | 104 } // namespace blink |
OLD | NEW |