| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Intel Inc. All rights reserved. | 2 * Copyright (C) 2012 Intel 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 return entry; | 124 return entry; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void UserTiming::clearMarks(const String& markName) { | 127 void UserTiming::clearMarks(const String& markName) { |
| 128 clearPeformanceEntries(m_marksMap, markName); | 128 clearPeformanceEntries(m_marksMap, markName); |
| 129 } | 129 } |
| 130 | 130 |
| 131 double UserTiming::findExistingMarkStartTime(const String& markName, | 131 double UserTiming::findExistingMarkStartTime(const String& markName, |
| 132 ExceptionState& exceptionState) { | 132 ExceptionState& exceptionState) { |
| 133 if (m_marksMap.contains(markName)) | 133 if (m_marksMap.contains(markName)) |
| 134 return m_marksMap.get(markName).last()->startTime(); | 134 return m_marksMap.get(markName).back()->startTime(); |
| 135 | 135 |
| 136 if (restrictedKeyMap().contains(markName) && m_performance->timing()) { | 136 if (restrictedKeyMap().contains(markName) && m_performance->timing()) { |
| 137 double value = static_cast<double>( | 137 double value = static_cast<double>( |
| 138 (m_performance->timing()->*(restrictedKeyMap().get(markName)))()); | 138 (m_performance->timing()->*(restrictedKeyMap().get(markName)))()); |
| 139 if (!value) { | 139 if (!value) { |
| 140 exceptionState.throwDOMException( | 140 exceptionState.throwDOMException( |
| 141 InvalidAccessError, "'" + markName + | 141 InvalidAccessError, "'" + markName + |
| 142 "' is empty: either the event hasn't " | 142 "' is empty: either the event hasn't " |
| 143 "happened yet, or it would provide " | 143 "happened yet, or it would provide " |
| 144 "cross-origin timing information."); | 144 "cross-origin timing information."); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 return getEntrySequenceByName(m_measuresMap, name); | 245 return getEntrySequenceByName(m_measuresMap, name); |
| 246 } | 246 } |
| 247 | 247 |
| 248 DEFINE_TRACE(UserTiming) { | 248 DEFINE_TRACE(UserTiming) { |
| 249 visitor->trace(m_performance); | 249 visitor->trace(m_performance); |
| 250 visitor->trace(m_marksMap); | 250 visitor->trace(m_marksMap); |
| 251 visitor->trace(m_measuresMap); | 251 visitor->trace(m_measuresMap); |
| 252 } | 252 } |
| 253 | 253 |
| 254 } // namespace blink | 254 } // namespace blink |
| OLD | NEW |