Chromium Code Reviews| Index: chrome/browser/extensions/api/ping_private/ping_private_api.h |
| diff --git a/chrome/browser/extensions/api/ping_private/ping_private_api.h b/chrome/browser/extensions/api/ping_private/ping_private_api.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6df8f0f9888367d1322efcc0569ef5447087b674 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/ping_private/ping_private_api.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_API_PING_PRIVATE_PING_PRIVATE_API_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_API_PING_PRIVATE_PING_PRIVATE_API_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/memory/ref_counted.h" |
|
xiaowenx
2013/06/17 06:19:38
The code uses scoped_ptr<>, should it include "bas
Bei Zhang
2013/06/17 07:30:54
Done.
|
| +#include "chrome/browser/extensions/api/api_function.h" |
| +#include "chrome/browser/extensions/api/api_resource_manager.h" |
| +#include "chrome/common/extensions/api/ping_private.h" |
| + |
| +namespace extensions { |
| + |
| +class PingPrivateSendPacketFunction : public AsyncApiFunction { |
| + public: |
| + DECLARE_EXTENSION_FUNCTION("pingPrivate.sendPacket", PINGPRIVATE_SENDPACKET); |
| + PingPrivateSendPacketFunction(); |
| + |
| + protected: |
| + virtual ~PingPrivateSendPacketFunction(); |
| + |
| + virtual bool Prepare() OVERRIDE; |
| + |
| + virtual void AsyncWorkStart() OVERRIDE; |
| + |
| + virtual bool Respond() OVERRIDE; |
| + |
| + private: |
| + void OnComplete(bool succeed, std::string ip, int latency); |
|
xiaowenx
2013/06/17 06:19:38
const std::string& ip?
Bei Zhang
2013/06/17 07:30:54
Done.
|
| + |
| + scoped_ptr<extensions::api::ping_private::SendPacket::Params> parameters_; |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_API_PING_PRIVATE_PING_PRIVATE_API_H_ |