Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: sync/engine/net/server_connection_manager.h

Issue 23717047: Retry: sync: Gracefully handle early shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor comment and style improvements Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sync/engine/net/server_connection_manager.h
diff --git a/sync/engine/net/server_connection_manager.h b/sync/engine/net/server_connection_manager.h
index f9c4a544dfe62085c09dd0bdc9b0cb0ba95eb2e8..3d2c2d7aec70c7c3c1a1b55aa69cbffc8e585c37 100644
--- a/sync/engine/net/server_connection_manager.h
+++ b/sync/engine/net/server_connection_manager.h
@@ -16,6 +16,7 @@
#include "base/threading/non_thread_safe.h"
#include "base/threading/thread_checker.h"
#include "sync/base/sync_export.h"
+#include "sync/internal_api/public/base/cancelation_observer.h"
#include "sync/syncable/syncable_id.h"
namespace sync_pb {
@@ -24,6 +25,8 @@ class ClientToServerMessage;
namespace syncer {
+class CancelationSignal;
+
namespace syncable {
class Directory;
}
@@ -125,7 +128,7 @@ class SYNC_EXPORT_PRIVATE ScopedServerStatusWatcher
// Use this class to interact with the sync server.
// The ServerConnectionManager currently supports POSTing protocol buffers.
//
-class SYNC_EXPORT_PRIVATE ServerConnectionManager {
+class SYNC_EXPORT_PRIVATE ServerConnectionManager : public CancelationObserver {
public:
// buffer_in - will be POSTed
// buffer_out - string will be overwritten with response
@@ -183,7 +186,8 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
ServerConnectionManager(const std::string& server,
int port,
bool use_ssl,
- bool use_oauth2_token);
+ bool use_oauth2_token,
+ CancelationSignal* cancelation_signal);
virtual ~ServerConnectionManager();
@@ -219,7 +223,7 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
// We expect this to get called on a different thread than the valid
// ThreadChecker thread, as we want to kill any pending http traffic without
// having to wait for the request to complete.
- virtual void TerminateAllIO();
+ virtual void OnStopRequested() OVERRIDE FINAL;
void set_client_id(const std::string& client_id) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -342,6 +346,9 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
void NotifyStatusChanged();
+ CancelationSignal* const cancelation_signal_;
+ bool signal_handler_registered_;
+
DISALLOW_COPY_AND_ASSIGN(ServerConnectionManager);
};

Powered by Google App Engine
This is Rietveld 408576698