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

Unified Diff: chrome/browser/google_apis/request_registry.h

Issue 17175017: Get rid of RequestRegistry (part 6): get rid of RequestRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix Created 7 years, 6 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/google_apis/request_registry.h
diff --git a/chrome/browser/google_apis/request_registry.h b/chrome/browser/google_apis/request_registry.h
deleted file mode 100644
index 1331f913ff7ffa0986557cc394d88b65bc9e1c84..0000000000000000000000000000000000000000
--- a/chrome/browser/google_apis/request_registry.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2012 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_GOOGLE_APIS_REQUEST_REGISTRY_H_
-#define CHROME_BROWSER_GOOGLE_APIS_REQUEST_REGISTRY_H_
-
-#include "base/basictypes.h"
-#include "base/id_map.h"
-
-namespace google_apis {
-
-// Unique ID to identify each request.
-typedef int32 RequestID;
-
-// This class tracks all the in-flight Google API requests and manage
-// their lifetime.
-class RequestRegistry {
- public:
- RequestRegistry();
- ~RequestRegistry();
-
- // Base class for requests that this registry class can maintain.
- // NotifyStart() passes the ownership of the Request object to the registry.
- // In particular, calling NotifyFinish() causes the registry to delete the
- // Request object itself.
- class Request {
- public:
- explicit Request(RequestRegistry* registry);
- virtual ~Request();
-
- protected:
- // Notifies the registry about current status.
- void NotifyStart();
- void NotifyFinish();
-
- private:
- RequestRegistry* const registry_;
- RequestID id_;
- };
-
- private:
- // Handlers for notifications from Requests.
- friend class Request;
- // Notifies that an request has started. This method passes the ownership of
- // the request to the registry. A fresh request ID is returned to *id.
- void OnRequestStart(Request* request, RequestID* id);
- void OnRequestFinish(RequestID request_id);
-
- typedef IDMap<Request, IDMapOwnPointer> RequestIDMap;
- RequestIDMap in_flight_requests_;
-
- DISALLOW_COPY_AND_ASSIGN(RequestRegistry);
-};
-
-} // namespace google_apis
-
-#endif // CHROME_BROWSER_GOOGLE_APIS_REQUEST_REGISTRY_H_
« no previous file with comments | « chrome/browser/google_apis/base_requests_unittest.cc ('k') | chrome/browser/google_apis/request_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698