| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return entry; | 125 return entry; |
| 126 } | 126 } |
| 127 | 127 |
| 128 void UserTiming::clearMarks(const String& markName) { | 128 void UserTiming::clearMarks(const String& markName) { |
| 129 clearPeformanceEntries(m_marksMap, markName); | 129 clearPeformanceEntries(m_marksMap, markName); |
| 130 } | 130 } |
| 131 | 131 |
| 132 double UserTiming::findExistingMarkStartTime(const String& markName, | 132 double UserTiming::findExistingMarkStartTime(const String& markName, |
| 133 ExceptionState& exceptionState) { | 133 ExceptionState& exceptionState) { |
| 134 if (m_marksMap.contains(markName)) | 134 if (m_marksMap.contains(markName)) |
| 135 return m_marksMap.get(markName).back()->startTime(); | 135 return m_marksMap.at(markName).back()->startTime(); |
| 136 | 136 |
| 137 if (restrictedKeyMap().contains(markName) && m_performance->timing()) { | 137 if (restrictedKeyMap().contains(markName) && m_performance->timing()) { |
| 138 double value = static_cast<double>( | 138 double value = static_cast<double>( |
| 139 (m_performance->timing()->*(restrictedKeyMap().get(markName)))()); | 139 (m_performance->timing()->*(restrictedKeyMap().at(markName)))()); |
| 140 if (!value) { | 140 if (!value) { |
| 141 exceptionState.throwDOMException( | 141 exceptionState.throwDOMException( |
| 142 InvalidAccessError, "'" + markName + | 142 InvalidAccessError, "'" + markName + |
| 143 "' is empty: either the event hasn't " | 143 "' is empty: either the event hasn't " |
| 144 "happened yet, or it would provide " | 144 "happened yet, or it would provide " |
| 145 "cross-origin timing information."); | 145 "cross-origin timing information."); |
| 146 return 0.0; | 146 return 0.0; |
| 147 } | 147 } |
| 148 return value - m_performance->timing()->navigationStart(); | 148 return value - m_performance->timing()->navigationStart(); |
| 149 } | 149 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 return getEntrySequenceByName(m_measuresMap, name); | 246 return getEntrySequenceByName(m_measuresMap, name); |
| 247 } | 247 } |
| 248 | 248 |
| 249 DEFINE_TRACE(UserTiming) { | 249 DEFINE_TRACE(UserTiming) { |
| 250 visitor->trace(m_performance); | 250 visitor->trace(m_performance); |
| 251 visitor->trace(m_marksMap); | 251 visitor->trace(m_marksMap); |
| 252 visitor->trace(m_measuresMap); | 252 visitor->trace(m_measuresMap); |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace blink | 255 } // namespace blink |
| OLD | NEW |