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

Side by Side Diff: chrome/renderer/loadtimes_extension_bindings.cc

Issue 2429063002: Implement nextHopProtocol in PerformanceResourceTiming and PerformanceNavigationTiming.
Patch Set: included changes for navigation timing 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 // Copyright (c) 2012 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/time.h" 9 #include "base/time/time.h"
10 #include "content/public/renderer/document_state.h" 10 #include "content/public/renderer/document_state.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // time being. 166 // time being.
167 double first_paint_after_load_time = 0.0; 167 double first_paint_after_load_time = 0.0;
168 std::string navigation_type = 168 std::string navigation_type =
169 GetNavigationType(data_source->navigationType()); 169 GetNavigationType(data_source->navigationType());
170 bool was_fetched_via_spdy = document_state->was_fetched_via_spdy(); 170 bool was_fetched_via_spdy = document_state->was_fetched_via_spdy();
171 bool was_alpn_negotiated = document_state->was_alpn_negotiated(); 171 bool was_alpn_negotiated = document_state->was_alpn_negotiated();
172 std::string alpn_negotiated_protocol = 172 std::string alpn_negotiated_protocol =
173 document_state->alpn_negotiated_protocol(); 173 document_state->alpn_negotiated_protocol();
174 bool was_alternate_protocol_available = 174 bool was_alternate_protocol_available =
175 document_state->was_alternate_protocol_available(); 175 document_state->was_alternate_protocol_available();
176 std::string connection_info = net::HttpResponseInfo::ConnectionInfoToString( 176 std::string connection_info = document_state->connection_info();
177 document_state->connection_info());
178 177
179 // Important: |frame|, |data_source| and |document_state| should not be 178 // Important: |frame|, |data_source| and |document_state| should not be
180 // referred to below this line, as JS setters below can invalidate these 179 // referred to below this line, as JS setters below can invalidate these
181 // pointers. 180 // pointers.
182 v8::Isolate* isolate = args.GetIsolate(); 181 v8::Isolate* isolate = args.GetIsolate();
183 v8::Local<v8::Context> ctx = isolate->GetCurrentContext(); 182 v8::Local<v8::Context> ctx = isolate->GetCurrentContext();
184 v8::Local<v8::Object> load_times = v8::Object::New(isolate); 183 v8::Local<v8::Object> load_times = v8::Object::New(isolate);
185 184
186 if (!load_times->SetAccessor( 185 if (!load_times->SetAccessor(
187 ctx, 186 ctx,
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 } 393 }
395 args.GetReturnValue().Set(csi); 394 args.GetReturnValue().Set(csi);
396 } 395 }
397 }; 396 };
398 397
399 v8::Extension* LoadTimesExtension::Get() { 398 v8::Extension* LoadTimesExtension::Get() {
400 return new LoadTimesExtensionWrapper(); 399 return new LoadTimesExtensionWrapper();
401 } 400 }
402 401
403 } // namespace extensions_v8 402 } // namespace extensions_v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698