OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/loadtimes_extension_bindings.h" | 5 #include "chrome/renderer/loadtimes_extension_bindings.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/renderer/navigation_state.h" | 10 #include "chrome/renderer/navigation_state.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 navigation_state->first_paint_after_load_time().ToDoubleT())); | 127 navigation_state->first_paint_after_load_time().ToDoubleT())); |
128 load_times->Set( | 128 load_times->Set( |
129 v8::String::New("navigationType"), | 129 v8::String::New("navigationType"), |
130 v8::String::New(GetNavigationType(data_source->navigationType()))); | 130 v8::String::New(GetNavigationType(data_source->navigationType()))); |
131 load_times->Set( | 131 load_times->Set( |
132 v8::String::New("wasFetchedViaSpdy"), | 132 v8::String::New("wasFetchedViaSpdy"), |
133 v8::Boolean::New(navigation_state->was_fetched_via_spdy())); | 133 v8::Boolean::New(navigation_state->was_fetched_via_spdy())); |
134 load_times->Set( | 134 load_times->Set( |
135 v8::String::New("wasNpnNegotiated"), | 135 v8::String::New("wasNpnNegotiated"), |
136 v8::Boolean::New(navigation_state->was_npn_negotiated())); | 136 v8::Boolean::New(navigation_state->was_npn_negotiated())); |
| 137 load_times->Set( |
| 138 v8::String::New("wasAlternateProtocolAvailable"), |
| 139 v8::Boolean::New( |
| 140 navigation_state->was_alternate_protocol_available())); |
137 return load_times; | 141 return load_times; |
138 } | 142 } |
139 } | 143 } |
140 return v8::Null(); | 144 return v8::Null(); |
141 } | 145 } |
142 | 146 |
143 static v8::Handle<v8::Value> GetCSI(const v8::Arguments& args) { | 147 static v8::Handle<v8::Value> GetCSI(const v8::Arguments& args) { |
144 WebFrame* frame = WebFrame::frameForCurrentContext(); | 148 WebFrame* frame = WebFrame::frameForCurrentContext(); |
145 if (frame) { | 149 if (frame) { |
146 WebDataSource* data_source = frame->dataSource(); | 150 WebDataSource* data_source = frame->dataSource(); |
(...skipping 26 matching lines...) Expand all Loading... |
173 } | 177 } |
174 return v8::Null(); | 178 return v8::Null(); |
175 } | 179 } |
176 }; | 180 }; |
177 | 181 |
178 v8::Extension* LoadTimesExtension::Get() { | 182 v8::Extension* LoadTimesExtension::Get() { |
179 return new LoadTimesExtensionWrapper(); | 183 return new LoadTimesExtensionWrapper(); |
180 } | 184 } |
181 | 185 |
182 } // namespace extensions_v8 | 186 } // namespace extensions_v8 |
OLD | NEW |