OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_GCM_DRIVER_FAKE_GCM_CLIENT_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_FAKE_GCM_CLIENT_H_ |
6 #define COMPONENTS_GCM_DRIVER_FAKE_GCM_CLIENT_H_ | 6 #define COMPONENTS_GCM_DRIVER_FAKE_GCM_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void RemoveAccountMapping(const std::string& account_id) override; | 70 void RemoveAccountMapping(const std::string& account_id) override; |
71 void SetLastTokenFetchTime(const base::Time& time) override; | 71 void SetLastTokenFetchTime(const base::Time& time) override; |
72 void UpdateHeartbeatTimer(std::unique_ptr<base::Timer> timer) override; | 72 void UpdateHeartbeatTimer(std::unique_ptr<base::Timer> timer) override; |
73 void AddInstanceIDData(const std::string& app_id, | 73 void AddInstanceIDData(const std::string& app_id, |
74 const std::string& instance_id, | 74 const std::string& instance_id, |
75 const std::string& extra_data) override; | 75 const std::string& extra_data) override; |
76 void RemoveInstanceIDData(const std::string& app_id) override; | 76 void RemoveInstanceIDData(const std::string& app_id) override; |
77 void GetInstanceIDData(const std::string& app_id, | 77 void GetInstanceIDData(const std::string& app_id, |
78 std::string* instance_id, | 78 std::string* instance_id, |
79 std::string* extra_data) override; | 79 std::string* extra_data) override; |
| 80 bool CategoryHasSubtype(const std::string& category) override; |
80 void AddHeartbeatInterval(const std::string& scope, int interval_ms) override; | 81 void AddHeartbeatInterval(const std::string& scope, int interval_ms) override; |
81 void RemoveHeartbeatInterval(const std::string& scope) override; | 82 void RemoveHeartbeatInterval(const std::string& scope) override; |
82 | 83 |
83 // Initiate the start that has been delayed. | 84 // Initiate the start that has been delayed. |
84 // Called on UI thread. | 85 // Called on UI thread. |
85 void PerformDelayedStart(); | 86 void PerformDelayedStart(); |
86 | 87 |
87 // Simulate receiving something from the server. | 88 // Simulate receiving something from the server. |
88 // Called on UI thread. | 89 // Called on UI thread. |
89 void ReceiveMessage(const std::string& app_id, | 90 void ReceiveMessage(const std::string& app_id, |
(...skipping 16 matching lines...) Expand all Loading... |
106 void SendFinished(const std::string& app_id, const OutgoingMessage& message); | 107 void SendFinished(const std::string& app_id, const OutgoingMessage& message); |
107 void MessageReceived(const std::string& app_id, | 108 void MessageReceived(const std::string& app_id, |
108 const IncomingMessage& message); | 109 const IncomingMessage& message); |
109 void MessagesDeleted(const std::string& app_id); | 110 void MessagesDeleted(const std::string& app_id); |
110 void MessageSendError(const std::string& app_id, | 111 void MessageSendError(const std::string& app_id, |
111 const SendErrorDetails& send_error_details); | 112 const SendErrorDetails& send_error_details); |
112 void SendAcknowledgement(const std::string& app_id, | 113 void SendAcknowledgement(const std::string& app_id, |
113 const std::string& message_id); | 114 const std::string& message_id); |
114 | 115 |
115 Delegate* delegate_; | 116 Delegate* delegate_; |
| 117 std::string category_for_subtypes_; |
116 bool started_; | 118 bool started_; |
117 StartMode start_mode_; | 119 StartMode start_mode_; |
118 StartModeOverridding start_mode_overridding_; | 120 StartModeOverridding start_mode_overridding_; |
119 scoped_refptr<base::SequencedTaskRunner> ui_thread_; | 121 scoped_refptr<base::SequencedTaskRunner> ui_thread_; |
120 scoped_refptr<base::SequencedTaskRunner> io_thread_; | 122 scoped_refptr<base::SequencedTaskRunner> io_thread_; |
121 std::map<std::string, std::pair<std::string, std::string>> instance_id_data_; | 123 std::map<std::string, std::pair<std::string, std::string>> instance_id_data_; |
122 GCMStatsRecorderImpl recorder_; | 124 GCMStatsRecorderImpl recorder_; |
123 base::WeakPtrFactory<FakeGCMClient> weak_ptr_factory_; | 125 base::WeakPtrFactory<FakeGCMClient> weak_ptr_factory_; |
124 | 126 |
125 DISALLOW_COPY_AND_ASSIGN(FakeGCMClient); | 127 DISALLOW_COPY_AND_ASSIGN(FakeGCMClient); |
126 }; | 128 }; |
127 | 129 |
128 } // namespace gcm | 130 } // namespace gcm |
129 | 131 |
130 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_CLIENT_H_ | 132 #endif // COMPONENTS_GCM_DRIVER_FAKE_GCM_CLIENT_H_ |
OLD | NEW |