| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
| 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 class InitialLoadObserver : public NotificationObserver { | 30 class InitialLoadObserver : public NotificationObserver { |
| 31 public: | 31 public: |
| 32 InitialLoadObserver(size_t tab_count, AutomationProvider* automation); | 32 InitialLoadObserver(size_t tab_count, AutomationProvider* automation); |
| 33 ~InitialLoadObserver(); | 33 ~InitialLoadObserver(); |
| 34 | 34 |
| 35 virtual void Observe(NotificationType type, | 35 virtual void Observe(NotificationType type, |
| 36 const NotificationSource& source, | 36 const NotificationSource& source, |
| 37 const NotificationDetails& details); | 37 const NotificationDetails& details); |
| 38 | 38 |
| 39 // Caller owns the return value and is responsible for deleting it. | |
| 40 // Example return value: | |
| 41 // {'tabs': [{'start_time_ms': 1, 'stop_time_ms': 2.5}, | |
| 42 // {'start_time_ms': 0.5, 'stop_time_ms': 3}]} | |
| 43 // stop_time_ms values may be null if WaitForInitialLoads has not finished. | |
| 44 // Only includes entries for the |tab_count| tabs we are monitoring. | |
| 45 // There is no defined ordering of the return value. | |
| 46 DictionaryValue* GetTimingInformation() const; | |
| 47 | |
| 48 private: | 39 private: |
| 49 class TabTime; | |
| 50 typedef std::map<uintptr_t, TabTime> TabTimeMap; | |
| 51 typedef std::set<uintptr_t> TabSet; | 40 typedef std::set<uintptr_t> TabSet; |
| 52 | 41 |
| 53 void ConditionMet(); | 42 void ConditionMet(); |
| 54 | 43 |
| 55 NotificationRegistrar registrar_; | 44 NotificationRegistrar registrar_; |
| 56 | 45 |
| 57 AutomationProvider* automation_; | 46 AutomationProvider* automation_; |
| 58 size_t outstanding_tab_count_; | 47 size_t outstanding_tab_count_; |
| 59 base::TimeTicks init_time_; | 48 TabSet loading_tabs_; |
| 60 TabTimeMap loading_tabs_; | |
| 61 TabSet finished_tabs_; | 49 TabSet finished_tabs_; |
| 62 | 50 |
| 63 DISALLOW_COPY_AND_ASSIGN(InitialLoadObserver); | 51 DISALLOW_COPY_AND_ASSIGN(InitialLoadObserver); |
| 64 }; | 52 }; |
| 65 | 53 |
| 66 // Watches for NewTabUI page loads for performance timing purposes. | 54 // Watches for NewTabUI page loads for performance timing purposes. |
| 67 class NewTabUILoadObserver : public NotificationObserver { | 55 class NewTabUILoadObserver : public NotificationObserver { |
| 68 public: | 56 public: |
| 69 explicit NewTabUILoadObserver(AutomationProvider* automation); | 57 explicit NewTabUILoadObserver(AutomationProvider* automation); |
| 70 ~NewTabUILoadObserver(); | 58 ~NewTabUILoadObserver(); |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 private: | 614 private: |
| 627 NotificationRegistrar registrar_; | 615 NotificationRegistrar registrar_; |
| 628 AutomationProvider* automation_; | 616 AutomationProvider* automation_; |
| 629 IPC::Message* reply_message_; | 617 IPC::Message* reply_message_; |
| 630 NavigationController* controller_; | 618 NavigationController* controller_; |
| 631 | 619 |
| 632 DISALLOW_COPY_AND_ASSIGN(OmniboxAcceptNotificationObserver); | 620 DISALLOW_COPY_AND_ASSIGN(OmniboxAcceptNotificationObserver); |
| 633 }; | 621 }; |
| 634 | 622 |
| 635 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ | 623 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ |
| OLD | NEW |