| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 if (equalIgnoringCase(entryType, "render")) | 79 if (equalIgnoringCase(entryType, "render")) |
| 80 return Render; | 80 return Render; |
| 81 if (equalIgnoringCase(entryType, "resource")) | 81 if (equalIgnoringCase(entryType, "resource")) |
| 82 return Resource; | 82 return Resource; |
| 83 return Invalid; | 83 return Invalid; |
| 84 } | 84 } |
| 85 | 85 |
| 86 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const | 86 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const |
| 87 { | 87 { |
| 88 V8ObjectBuilder result(scriptState); | 88 V8ObjectBuilder result(scriptState); |
| 89 result.addString("name", name()); | 89 buildJSONValue(result); |
| 90 result.addString("entryType", entryType()); | |
| 91 result.addNumber("startTime", startTime()); | |
| 92 result.addNumber("duration", duration()); | |
| 93 return result.scriptValue(); | 90 return result.scriptValue(); |
| 94 } | 91 } |
| 95 | 92 |
| 93 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const |
| 94 { |
| 95 builder.addString("name", name()); |
| 96 builder.addString("entryType", entryType()); |
| 97 builder.addNumber("startTime", startTime()); |
| 98 builder.addNumber("duration", duration()); |
| 99 } |
| 100 |
| 96 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |