| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/page_load_metrics/metrics_web_contents_observer.h" | 5 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 RecordInternalError(ERR_IPC_FROM_BAD_URL_SCHEME); | 591 RecordInternalError(ERR_IPC_FROM_BAD_URL_SCHEME); |
| 592 error = true; | 592 error = true; |
| 593 } | 593 } |
| 594 | 594 |
| 595 if (error) | 595 if (error) |
| 596 return; | 596 return; |
| 597 | 597 |
| 598 if (render_frame_host->GetParent() != nullptr) { | 598 if (render_frame_host->GetParent() != nullptr) { |
| 599 // Child frames may send PageLoadMetadata updates, but not PageLoadTiming | 599 // Child frames may send PageLoadMetadata updates, but not PageLoadTiming |
| 600 // updates. | 600 // updates. |
| 601 if (!timing.IsEmpty()) | 601 if (!IsEmpty(timing)) |
| 602 RecordInternalError(ERR_TIMING_IPC_FROM_SUBFRAME); | 602 RecordInternalError(ERR_TIMING_IPC_FROM_SUBFRAME); |
| 603 committed_load_->UpdateChildFrameMetadata(metadata); | 603 committed_load_->UpdateChildFrameMetadata(metadata); |
| 604 return; | 604 return; |
| 605 } | 605 } |
| 606 | 606 |
| 607 committed_load_->UpdateTiming(timing, metadata); | 607 committed_load_->UpdateTiming(timing, metadata); |
| 608 | 608 |
| 609 for (auto& observer : testing_observers_) | 609 for (auto& observer : testing_observers_) |
| 610 observer.OnTimingUpdated(true /* is_main_frame */, timing, metadata); | 610 observer.OnTimingUpdated(true /* is_main_frame */, timing, metadata); |
| 611 } | 611 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 642 observer_->RemoveTestingObserver(this); | 642 observer_->RemoveTestingObserver(this); |
| 643 observer_ = nullptr; | 643 observer_ = nullptr; |
| 644 } | 644 } |
| 645 } | 645 } |
| 646 | 646 |
| 647 void MetricsWebContentsObserver::TestingObserver::OnGoingAway() { | 647 void MetricsWebContentsObserver::TestingObserver::OnGoingAway() { |
| 648 observer_ = nullptr; | 648 observer_ = nullptr; |
| 649 } | 649 } |
| 650 | 650 |
| 651 } // namespace page_load_metrics | 651 } // namespace page_load_metrics |
| OLD | NEW |