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

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

Issue 2799093004: Enable ServerTiming support
Patch Set: update code formatting and comments Created 3 years, 8 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
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") 84 if (entryType == "paint")
85 return Paint; 85 return Paint;
86 if (entryType == "server")
87 return Server;
86 return Invalid; 88 return Invalid;
87 } 89 }
88 90
89 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const { 91 ScriptValue PerformanceEntry::toJSONForBinding(ScriptState* scriptState) const {
90 V8ObjectBuilder result(scriptState); 92 V8ObjectBuilder result(scriptState);
91 buildJSONValue(result); 93 buildJSONValue(result);
92 return result.scriptValue(); 94 return result.scriptValue();
93 } 95 }
94 96
95 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const { 97 void PerformanceEntry::buildJSONValue(V8ObjectBuilder& builder) const {
96 builder.addString("name", name()); 98 builder.addString("name", name());
97 builder.addString("entryType", entryType()); 99 builder.addString("entryType", entryType());
98 builder.addNumber("startTime", startTime()); 100 builder.addNumber("startTime", startTime());
99 builder.addNumber("duration", duration()); 101 builder.addNumber("duration", duration());
100 } 102 }
101 103
102 } // namespace blink 104 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698