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

Unified Diff: chrome/browser/sync/internal_api/syncapi_server_connection_manager.h

Issue 7792022: sync: abort active HTTP requests on shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 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: chrome/browser/sync/internal_api/syncapi_server_connection_manager.h
diff --git a/chrome/browser/sync/internal_api/syncapi_server_connection_manager.h b/chrome/browser/sync/internal_api/syncapi_server_connection_manager.h
index 35fb98e6bf685168dd06c98065eac3d8aee50045..539e2a6eacf5bf93c15dda54a4be11b4ab2a4154 100644
--- a/chrome/browser/sync/internal_api/syncapi_server_connection_manager.h
+++ b/chrome/browser/sync/internal_api/syncapi_server_connection_manager.h
@@ -8,34 +8,40 @@
#include <string>
+#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/sync/engine/net/server_connection_manager.h"
namespace sync_api {
class HttpPostProviderFactory;
+class HttpPostProviderInterface;
// This provides HTTP Post functionality through the interface provided
// to the sync API by the application hosting the syncer backend.
-class SyncAPIBridgedPost
- : public browser_sync::ServerConnectionManager::Post {
+class SyncAPIBridgedConnection
+ : public browser_sync::ServerConnectionManager::Connection {
public:
- SyncAPIBridgedPost(browser_sync::ServerConnectionManager* scm,
- HttpPostProviderFactory* factory);
+ SyncAPIBridgedConnection(browser_sync::ServerConnectionManager* scm,
+ HttpPostProviderFactory* factory);
- virtual ~SyncAPIBridgedPost();
+ virtual ~SyncAPIBridgedConnection();
virtual bool Init(const char* path,
const std::string& auth_token,
const std::string& payload,
- browser_sync::HttpResponse* response);
+ browser_sync::HttpResponse* response) OVERRIDE;
+
+ virtual void Abort() OVERRIDE;
private:
// Pointer to the factory we use for creating HttpPostProviders. We do not
// own |factory_|.
HttpPostProviderFactory* factory_;
- DISALLOW_COPY_AND_ASSIGN(SyncAPIBridgedPost);
+ HttpPostProviderInterface* post_provider_;
+
+ DISALLOW_COPY_AND_ASSIGN(SyncAPIBridgedConnection);
};
// A ServerConnectionManager subclass used by the syncapi layer. We use a
@@ -52,10 +58,13 @@ class SyncAPIServerConnectionManager
HttpPostProviderFactory* factory);
virtual ~SyncAPIServerConnectionManager();
- protected:
- virtual Post* MakePost();
+ // ServerConnectionManager overrides.
+ virtual Connection* MakeConnection() OVERRIDE;
private:
+ FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, EarlyAbortPost);
+ FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, AbortPost);
+
// A factory creating concrete HttpPostProviders for use whenever we need to
// issue a POST to sync servers.
scoped_ptr<HttpPostProviderFactory> post_provider_factory_;

Powered by Google App Engine
This is Rietveld 408576698