| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_PING_SENDER_H_ |
| 6 #define CHROME_BROWSER_COMPONENT_UPDATER_PING_SENDER_H_ |
| 7 |
| 8 #include <string> |
| 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/component_updater/component_updater_service.h" |
| 12 #include "net/url_request/url_fetcher_delegate.h" |
| 13 |
| 14 struct CrxUpdateItem; |
| 15 |
| 16 namespace component_updater { |
| 17 |
| 18 // Sends a fire and forget ping. The instances of this class have no |
| 19 // ownership and they self-delete upon completion. |
| 20 class PingSender : public net::URLFetcherDelegate { |
| 21 public: |
| 22 explicit PingSender(ComponentUpdateService::Configurator* configurator); |
| 23 |
| 24 void SendPing(const CrxUpdateItem* item); |
| 25 |
| 26 private: |
| 27 virtual ~PingSender(); |
| 28 |
| 29 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| 30 |
| 31 std::string BuildPing(const CrxUpdateItem* item) const; |
| 32 static std::string BuildPingEvent(const CrxUpdateItem* item); |
| 33 |
| 34 scoped_ptr<net::URLFetcher> url_fetcher_; |
| 35 ComponentUpdateService::Configurator* configurator_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(PingSender); |
| 38 }; |
| 39 |
| 40 } // namespace component_updater |
| 41 |
| 42 #endif // CHROME_BROWSER_COMPONENT_UPDATER_PING_SENDER_H_ |
| 43 |
| OLD | NEW |