| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/renderer/document_state.h" | 10 #include "content/public/renderer/document_state.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 document_state->first_paint_after_load_time().ToDoubleT())); | 128 document_state->first_paint_after_load_time().ToDoubleT())); |
| 129 load_times->Set( | 129 load_times->Set( |
| 130 v8::String::New("navigationType"), | 130 v8::String::New("navigationType"), |
| 131 v8::String::New(GetNavigationType(data_source->navigationType()))); | 131 v8::String::New(GetNavigationType(data_source->navigationType()))); |
| 132 load_times->Set( | 132 load_times->Set( |
| 133 v8::String::New("wasFetchedViaSpdy"), | 133 v8::String::New("wasFetchedViaSpdy"), |
| 134 v8::Boolean::New(document_state->was_fetched_via_spdy())); | 134 v8::Boolean::New(document_state->was_fetched_via_spdy())); |
| 135 load_times->Set( | 135 load_times->Set( |
| 136 v8::String::New("wasNpnNegotiated"), | 136 v8::String::New("wasNpnNegotiated"), |
| 137 v8::Boolean::New(document_state->was_npn_negotiated())); | 137 v8::Boolean::New(document_state->was_npn_negotiated())); |
| 138 load_times->Set( |
| 139 v8::String::New("npnNegotiatedProtocol"), |
| 140 v8::String::New(document_state->npn_negotiated_protocol().c_str())); |
| 138 load_times->Set( | 141 load_times->Set( |
| 139 v8::String::New("wasAlternateProtocolAvailable"), | 142 v8::String::New("wasAlternateProtocolAvailable"), |
| 140 v8::Boolean::New( | 143 v8::Boolean::New( |
| 141 document_state->was_alternate_protocol_available())); | 144 document_state->was_alternate_protocol_available())); |
| 142 return load_times; | 145 return load_times; |
| 143 } | 146 } |
| 144 } | 147 } |
| 145 return v8::Null(); | 148 return v8::Null(); |
| 146 } | 149 } |
| 147 | 150 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 178 } | 181 } |
| 179 return v8::Null(); | 182 return v8::Null(); |
| 180 } | 183 } |
| 181 }; | 184 }; |
| 182 | 185 |
| 183 v8::Extension* LoadTimesExtension::Get() { | 186 v8::Extension* LoadTimesExtension::Get() { |
| 184 return new LoadTimesExtensionWrapper(); | 187 return new LoadTimesExtensionWrapper(); |
| 185 } | 188 } |
| 186 | 189 |
| 187 } // namespace extensions_v8 | 190 } // namespace extensions_v8 |
| OLD | NEW |