OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 void PerformanceBase::clearResourceTimings() { | 233 void PerformanceBase::clearResourceTimings() { |
234 resource_timing_buffer_.clear(); | 234 resource_timing_buffer_.clear(); |
235 } | 235 } |
236 | 236 |
237 void PerformanceBase::setResourceTimingBufferSize(unsigned size) { | 237 void PerformanceBase::setResourceTimingBufferSize(unsigned size) { |
238 resource_timing_buffer_size_ = size; | 238 resource_timing_buffer_size_ = size; |
239 if (IsResourceTimingBufferFull()) | 239 if (IsResourceTimingBufferFull()) |
240 DispatchEvent(Event::Create(EventTypeNames::resourcetimingbufferfull)); | 240 DispatchEvent(Event::Create(EventTypeNames::resourcetimingbufferfull)); |
241 } | 241 } |
242 | 242 |
243 void PerformanceBase::clearFrameTimings() { | |
244 frame_timing_buffer_.clear(); | |
245 } | |
246 | |
247 void PerformanceBase::setFrameTimingBufferSize(unsigned size) { | |
248 frame_timing_buffer_size_ = size; | |
249 if (IsFrameTimingBufferFull()) | |
250 DispatchEvent(Event::Create(EventTypeNames::frametimingbufferfull)); | |
251 } | |
252 | |
253 bool PerformanceBase::PassesTimingAllowCheck( | 243 bool PerformanceBase::PassesTimingAllowCheck( |
254 const ResourceResponse& response, | 244 const ResourceResponse& response, |
255 const SecurityOrigin& initiator_security_origin, | 245 const SecurityOrigin& initiator_security_origin, |
256 const AtomicString& original_timing_allow_origin, | 246 const AtomicString& original_timing_allow_origin, |
257 ExecutionContext* context) { | 247 ExecutionContext* context) { |
258 RefPtr<SecurityOrigin> resource_origin = | 248 RefPtr<SecurityOrigin> resource_origin = |
259 SecurityOrigin::Create(response.Url()); | 249 SecurityOrigin::Create(response.Url()); |
260 if (resource_origin->IsSameSchemeHostPort(&initiator_security_origin)) | 250 if (resource_origin->IsSameSchemeHostPort(&initiator_security_origin)) |
261 return true; | 251 return true; |
262 | 252 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
429 resource_timing_buffer_.push_back(&entry); | 419 resource_timing_buffer_.push_back(&entry); |
430 | 420 |
431 if (IsResourceTimingBufferFull()) | 421 if (IsResourceTimingBufferFull()) |
432 DispatchEvent(Event::Create(EventTypeNames::resourcetimingbufferfull)); | 422 DispatchEvent(Event::Create(EventTypeNames::resourcetimingbufferfull)); |
433 } | 423 } |
434 | 424 |
435 bool PerformanceBase::IsResourceTimingBufferFull() { | 425 bool PerformanceBase::IsResourceTimingBufferFull() { |
436 return resource_timing_buffer_.size() >= resource_timing_buffer_size_; | 426 return resource_timing_buffer_.size() >= resource_timing_buffer_size_; |
437 } | 427 } |
438 | 428 |
439 void PerformanceBase::AddFrameTimingBuffer(PerformanceEntry& entry) { | 429 void PerformanceBase::AddFrameTimingBuffer(PerformanceEntry& entry) { |
panicker
2017/07/06 06:09:28
this should be deleted too
npm
2017/07/06 21:48:05
Done.
| |
440 frame_timing_buffer_.push_back(&entry); | 430 frame_timing_buffer_.push_back(&entry); |
441 | |
442 if (IsFrameTimingBufferFull()) | |
443 DispatchEvent(Event::Create(EventTypeNames::frametimingbufferfull)); | |
444 } | |
445 | |
446 bool PerformanceBase::IsFrameTimingBufferFull() { | |
447 return frame_timing_buffer_.size() >= frame_timing_buffer_size_; | |
448 } | 431 } |
449 | 432 |
450 void PerformanceBase::AddLongTaskTiming(double start_time, | 433 void PerformanceBase::AddLongTaskTiming(double start_time, |
451 double end_time, | 434 double end_time, |
452 const String& name, | 435 const String& name, |
453 const String& frame_src, | 436 const String& frame_src, |
454 const String& frame_id, | 437 const String& frame_id, |
455 const String& frame_name) { | 438 const String& frame_name) { |
456 if (!HasObserverFor(PerformanceEntry::kLongTask)) | 439 if (!HasObserverFor(PerformanceEntry::kLongTask)) |
457 return; | 440 return; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
615 visitor->Trace(server_timing_buffer_); | 598 visitor->Trace(server_timing_buffer_); |
616 visitor->Trace(first_paint_timing_); | 599 visitor->Trace(first_paint_timing_); |
617 visitor->Trace(first_contentful_paint_timing_); | 600 visitor->Trace(first_contentful_paint_timing_); |
618 visitor->Trace(observers_); | 601 visitor->Trace(observers_); |
619 visitor->Trace(active_observers_); | 602 visitor->Trace(active_observers_); |
620 visitor->Trace(suspended_observers_); | 603 visitor->Trace(suspended_observers_); |
621 EventTargetWithInlineData::Trace(visitor); | 604 EventTargetWithInlineData::Trace(visitor); |
622 } | 605 } |
623 | 606 |
624 } // namespace blink | 607 } // namespace blink |
OLD | NEW |