OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSIONS_API_DIAGNOSTICS_DIAGNOSTICS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DIAGNOSTICS_DIAGNOSTICS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DIAGNOSTICS_DIAGNOSTICS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAGNOSTICS_DIAGNOSTICS_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 DECLARE_EXTENSION_FUNCTION("diagnostics.sendPacket", | 31 DECLARE_EXTENSION_FUNCTION("diagnostics.sendPacket", |
32 DIAGNOSTICS_SENDPACKET); | 32 DIAGNOSTICS_SENDPACKET); |
33 | 33 |
34 DiagnosticsSendPacketFunction(); | 34 DiagnosticsSendPacketFunction(); |
35 | 35 |
36 protected: | 36 protected: |
37 virtual ~DiagnosticsSendPacketFunction(); | 37 virtual ~DiagnosticsSendPacketFunction(); |
38 | 38 |
39 // AsyncApiFunction: | 39 // AsyncApiFunction: |
40 virtual bool Prepare() OVERRIDE; | 40 virtual bool Prepare() override; |
41 // This methods will be implemented differently on different platforms. | 41 // This methods will be implemented differently on different platforms. |
42 virtual void AsyncWorkStart() OVERRIDE; | 42 virtual void AsyncWorkStart() override; |
43 virtual bool Respond() OVERRIDE; | 43 virtual bool Respond() override; |
44 | 44 |
45 private: | 45 private: |
46 void SendPingPacket(); | 46 void SendPingPacket(); |
47 void OnCompleted(SendPacketResultCode result_code, | 47 void OnCompleted(SendPacketResultCode result_code, |
48 const std::string& ip, | 48 const std::string& ip, |
49 double latency); | 49 double latency); |
50 | 50 |
51 scoped_ptr<extensions::api::diagnostics::SendPacket::Params> | 51 scoped_ptr<extensions::api::diagnostics::SendPacket::Params> |
52 parameters_; | 52 parameters_; |
53 }; | 53 }; |
54 | 54 |
55 } // namespace extensions | 55 } // namespace extensions |
56 | 56 |
57 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAGNOSTICS_DIAGNOSTICS_API_H_ | 57 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAGNOSTICS_DIAGNOSTICS_API_H_ |
OLD | NEW |