OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SYNC_DRIVER_SYNC_STOPPED_REPORTER_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_STOPPED_REPORTER_H_ |
6 #define COMPONENTS_SYNC_DRIVER_SYNC_STOPPED_REPORTER_H_ | 6 #define COMPONENTS_SYNC_DRIVER_SYNC_STOPPED_REPORTER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "net/url_request/url_fetcher.h" | 10 #include "net/url_request/url_fetcher.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 47 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
48 | 48 |
49 private: | 49 private: |
50 // Convert the base sync URL into the sync event URL. | 50 // Convert the base sync URL into the sync event URL. |
51 static GURL GetSyncEventURL(const GURL& sync_service_url); | 51 static GURL GetSyncEventURL(const GURL& sync_service_url); |
52 | 52 |
53 // Callback for a request timing out. | 53 // Callback for a request timing out. |
54 void OnTimeout(); | 54 void OnTimeout(); |
55 | 55 |
56 // Handles timing out requests. | 56 // Handles timing out requests. |
57 base::OneShotTimer<SyncStoppedReporter> timer_; | 57 base::OneShotTimer timer_; |
58 | 58 |
59 // The URL for the sync server's event RPC. | 59 // The URL for the sync server's event RPC. |
60 const GURL sync_event_url_; | 60 const GURL sync_event_url_; |
61 | 61 |
62 // The user agent for the browser. | 62 // The user agent for the browser. |
63 const std::string user_agent_; | 63 const std::string user_agent_; |
64 | 64 |
65 // Stored to simplify the API; needed for URLFetcher::Create(). | 65 // Stored to simplify the API; needed for URLFetcher::Create(). |
66 scoped_refptr<net::URLRequestContextGetter> request_context_; | 66 scoped_refptr<net::URLRequestContextGetter> request_context_; |
67 | 67 |
68 // The current URLFetcher. Null unless a request is in progress. | 68 // The current URLFetcher. Null unless a request is in progress. |
69 scoped_ptr<net::URLFetcher> fetcher_; | 69 scoped_ptr<net::URLFetcher> fetcher_; |
70 | 70 |
71 // A callback for request completion or timeout. | 71 // A callback for request completion or timeout. |
72 ResultCallback callback_; | 72 ResultCallback callback_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(SyncStoppedReporter); | 74 DISALLOW_COPY_AND_ASSIGN(SyncStoppedReporter); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace browser_sync | 77 } // namespace browser_sync |
78 | 78 |
79 #endif // COMPONENTS_SYNC_DRIVER_SYNC_STOPPED_REPORTER_H_ | 79 #endif // COMPONENTS_SYNC_DRIVER_SYNC_STOPPED_REPORTER_H_ |
OLD | NEW |