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

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

Issue 2528513003: first-paint and first-contentful paint (Closed)
Patch Set: Got rid of DCHECK cause it breaks unit tests Created 3 years, 11 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 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 if (entryType == "measure") 74 if (entryType == "measure")
75 return Measure; 75 return Measure;
76 if (entryType == "render") 76 if (entryType == "render")
77 return Render; 77 return Render;
78 if (entryType == "resource") 78 if (entryType == "resource")
79 return Resource; 79 return Resource;
80 if (entryType == "navigation") 80 if (entryType == "navigation")
81 return Navigation; 81 return Navigation;
82 if (entryType == "taskattribution") 82 if (entryType == "taskattribution")
83 return TaskAttribution; 83 return TaskAttribution;
84 if (entryType == "paint")
85 return Paint;
84 return Invalid; 86 return Invalid;
85 } 87 }
86 88
87 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const { 89 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const {
88 V8ObjectBuilder result(scriptState); 90 V8ObjectBuilder result(scriptState);
89 buildJSONValue(result); 91 buildJSONValue(result);
90 return result.scriptValue(); 92 return result.scriptValue();
91 } 93 }
92 94
93 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const { 95 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const {
94 builder.addString("name", name()); 96 builder.addString("name", name());
95 builder.addString("entryType", entryType()); 97 builder.addString("entryType", entryType());
96 builder.addNumber("startTime", startTime()); 98 builder.addNumber("startTime", startTime());
97 builder.addNumber("duration", duration()); 99 builder.addNumber("duration", duration());
98 } 100 }
99 101
100 } // namespace blink 102 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698