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

Unified Diff: chrome/browser/services/gcm/fake_gcm_profile_service.cc

Issue 278493002: Split GCMDriver into platform-specific implementations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed jianli's review comments Created 6 years, 7 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/services/gcm/fake_gcm_profile_service.cc
diff --git a/chrome/browser/services/gcm/fake_gcm_profile_service.cc b/chrome/browser/services/gcm/fake_gcm_profile_service.cc
index cbcf74d5746bc444203c72275f2328d6827e13df..5e4bffcd4c3be64218e6885ced78936aca998b27 100644
--- a/chrome/browser/services/gcm/fake_gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/fake_gcm_profile_service.cc
@@ -9,22 +9,20 @@
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "components/gcm_driver/fake_gcm_client_factory.h"
+#include "components/gcm_driver/fake_gcm_driver.h"
+#include "components/gcm_driver/gcm_driver.h"
#include "content/public/browser/browser_context.h"
namespace gcm {
namespace {
-class FakeGCMDriver : public GCMDriver {
+class CustomFakeGCMDriver : public FakeGCMDriver {
public:
- explicit FakeGCMDriver(FakeGCMProfileService* service);
- virtual ~FakeGCMDriver();
-
- // GCMDriver overrides.
- virtual void Shutdown() OVERRIDE;
- virtual void AddAppHandler(const std::string& app_id,
- GCMAppHandler* handler) OVERRIDE;
- virtual void RemoveAppHandler(const std::string& app_id) OVERRIDE;
+ explicit CustomFakeGCMDriver(FakeGCMProfileService* service);
+ virtual ~CustomFakeGCMDriver();
+
+ // GCMDriver overrides:
virtual void Register(const std::string& app_id,
const std::vector<std::string>& sender_ids,
const RegisterCallback& callback) OVERRIDE;
@@ -38,27 +36,17 @@ class FakeGCMDriver : public GCMDriver {
private:
FakeGCMProfileService* service_;
- DISALLOW_COPY_AND_ASSIGN(FakeGCMDriver);
+ DISALLOW_COPY_AND_ASSIGN(CustomFakeGCMDriver);
};
-FakeGCMDriver::FakeGCMDriver(FakeGCMProfileService* service)
+CustomFakeGCMDriver::CustomFakeGCMDriver(FakeGCMProfileService* service)
: service_(service) {
}
-FakeGCMDriver::~FakeGCMDriver() {
-}
-
-void FakeGCMDriver::Shutdown() {
-}
-
-void FakeGCMDriver::AddAppHandler(const std::string& app_id,
- GCMAppHandler* handler) {
-}
-
-void FakeGCMDriver::RemoveAppHandler(const std::string& app_id) {
+CustomFakeGCMDriver::~CustomFakeGCMDriver() {
}
-void FakeGCMDriver::Register(const std::string& app_id,
+void CustomFakeGCMDriver::Register(const std::string& app_id,
const std::vector<std::string>& sender_ids,
const RegisterCallback& callback) {
base::MessageLoop::current()->PostTask(
@@ -70,7 +58,7 @@ void FakeGCMDriver::Register(const std::string& app_id,
callback));
}
-void FakeGCMDriver::Unregister(const std::string& app_id,
+void CustomFakeGCMDriver::Unregister(const std::string& app_id,
const UnregisterCallback& callback) {
base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(
@@ -80,7 +68,7 @@ void FakeGCMDriver::Unregister(const std::string& app_id,
callback));
}
-void FakeGCMDriver::Send(const std::string& app_id,
+void CustomFakeGCMDriver::Send(const std::string& app_id,
const std::string& receiver_id,
const GCMClient::OutgoingMessage& message,
const SendCallback& callback) {
@@ -100,7 +88,7 @@ void FakeGCMDriver::Send(const std::string& app_id,
KeyedService* FakeGCMProfileService::Build(content::BrowserContext* context) {
Profile* profile = static_cast<Profile*>(context);
FakeGCMProfileService* service = new FakeGCMProfileService(profile);
- service->SetDriverForTesting(new FakeGCMDriver(service));
+ service->SetDriverForTesting(new CustomFakeGCMDriver(service));
return service;
}

Powered by Google App Engine
This is Rietveld 408576698