Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: third_party/WebKit/Source/core/timing/PerformanceUserTiming.cpp

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 25 matching lines...) Expand all
36 #include "wtf/text/StringHash.h" 36 #include "wtf/text/StringHash.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 namespace { 40 namespace {
41 41
42 using RestrictedKeyMap = HashMap<String, NavigationTimingFunction>; 42 using RestrictedKeyMap = HashMap<String, NavigationTimingFunction>;
43 43
44 RestrictedKeyMap* createRestrictedKeyMap() { 44 RestrictedKeyMap* createRestrictedKeyMap() {
45 RestrictedKeyMap* map = new RestrictedKeyMap(); 45 RestrictedKeyMap* map = new RestrictedKeyMap();
46 map->add("navigationStart", &PerformanceTiming::navigationStart); 46 map->insert("navigationStart", &PerformanceTiming::navigationStart);
47 map->add("unloadEventStart", &PerformanceTiming::unloadEventStart); 47 map->insert("unloadEventStart", &PerformanceTiming::unloadEventStart);
48 map->add("unloadEventEnd", &PerformanceTiming::unloadEventEnd); 48 map->insert("unloadEventEnd", &PerformanceTiming::unloadEventEnd);
49 map->add("redirectStart", &PerformanceTiming::redirectStart); 49 map->insert("redirectStart", &PerformanceTiming::redirectStart);
50 map->add("redirectEnd", &PerformanceTiming::redirectEnd); 50 map->insert("redirectEnd", &PerformanceTiming::redirectEnd);
51 map->add("fetchStart", &PerformanceTiming::fetchStart); 51 map->insert("fetchStart", &PerformanceTiming::fetchStart);
52 map->add("domainLookupStart", &PerformanceTiming::domainLookupStart); 52 map->insert("domainLookupStart", &PerformanceTiming::domainLookupStart);
53 map->add("domainLookupEnd", &PerformanceTiming::domainLookupEnd); 53 map->insert("domainLookupEnd", &PerformanceTiming::domainLookupEnd);
54 map->add("connectStart", &PerformanceTiming::connectStart); 54 map->insert("connectStart", &PerformanceTiming::connectStart);
55 map->add("connectEnd", &PerformanceTiming::connectEnd); 55 map->insert("connectEnd", &PerformanceTiming::connectEnd);
56 map->add("secureConnectionStart", &PerformanceTiming::secureConnectionStart); 56 map->insert("secureConnectionStart",
57 map->add("requestStart", &PerformanceTiming::requestStart); 57 &PerformanceTiming::secureConnectionStart);
58 map->add("responseStart", &PerformanceTiming::responseStart); 58 map->insert("requestStart", &PerformanceTiming::requestStart);
59 map->add("responseEnd", &PerformanceTiming::responseEnd); 59 map->insert("responseStart", &PerformanceTiming::responseStart);
60 map->add("domLoading", &PerformanceTiming::domLoading); 60 map->insert("responseEnd", &PerformanceTiming::responseEnd);
61 map->add("domInteractive", &PerformanceTiming::domInteractive); 61 map->insert("domLoading", &PerformanceTiming::domLoading);
62 map->add("domContentLoadedEventStart", 62 map->insert("domInteractive", &PerformanceTiming::domInteractive);
63 &PerformanceTiming::domContentLoadedEventStart); 63 map->insert("domContentLoadedEventStart",
64 map->add("domContentLoadedEventEnd", 64 &PerformanceTiming::domContentLoadedEventStart);
65 &PerformanceTiming::domContentLoadedEventEnd); 65 map->insert("domContentLoadedEventEnd",
66 map->add("domComplete", &PerformanceTiming::domComplete); 66 &PerformanceTiming::domContentLoadedEventEnd);
67 map->add("loadEventStart", &PerformanceTiming::loadEventStart); 67 map->insert("domComplete", &PerformanceTiming::domComplete);
68 map->add("loadEventEnd", &PerformanceTiming::loadEventEnd); 68 map->insert("loadEventStart", &PerformanceTiming::loadEventStart);
69 map->insert("loadEventEnd", &PerformanceTiming::loadEventEnd);
69 return map; 70 return map;
70 } 71 }
71 72
72 const RestrictedKeyMap& restrictedKeyMap() { 73 const RestrictedKeyMap& restrictedKeyMap() {
73 DEFINE_THREAD_SAFE_STATIC_LOCAL(RestrictedKeyMap, map, 74 DEFINE_THREAD_SAFE_STATIC_LOCAL(RestrictedKeyMap, map,
74 createRestrictedKeyMap()); 75 createRestrictedKeyMap());
75 return map; 76 return map;
76 } 77 }
77 78
78 } // namespace 79 } // namespace
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 return getEntrySequenceByName(m_measuresMap, name); 246 return getEntrySequenceByName(m_measuresMap, name);
246 } 247 }
247 248
248 DEFINE_TRACE(UserTiming) { 249 DEFINE_TRACE(UserTiming) {
249 visitor->trace(m_performance); 250 visitor->trace(m_performance);
250 visitor->trace(m_marksMap); 251 visitor->trace(m_marksMap);
251 visitor->trace(m_measuresMap); 252 visitor->trace(m_measuresMap);
252 } 253 }
253 254
254 } // namespace blink 255 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698