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

Unified Diff: trunk/src/chrome/browser/services/gcm/gcm_profile_service.cc

Issue 240583002: Revert 264313 "Add activity recording capability to gcm internal..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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: trunk/src/chrome/browser/services/gcm/gcm_profile_service.cc
===================================================================
--- trunk/src/chrome/browser/services/gcm/gcm_profile_service.cc (revision 264317)
+++ trunk/src/chrome/browser/services/gcm/gcm_profile_service.cc (working copy)
@@ -176,8 +176,7 @@
void Send(const std::string& app_id,
const std::string& receiver_id,
const GCMClient::OutgoingMessage& message);
- void GetGCMStatistics(bool clear_logs);
- void SetGCMRecording(bool recording);
+ void RequestGCMStatistics();
// For testing purpose. Can be called from UI thread. Use with care.
GCMClient* gcm_client_for_testing() const { return gcm_client_.get(); }
@@ -373,42 +372,23 @@
gcm_client_->Send(app_id, receiver_id, message);
}
-void GCMProfileService::IOWorker::GetGCMStatistics(bool clear_logs) {
+void GCMProfileService::IOWorker::RequestGCMStatistics() {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
gcm::GCMClient::GCMStatistics stats;
if (gcm_client_.get()) {
- if (clear_logs)
- gcm_client_->ClearActivityLogs();
+ stats.gcm_client_created = true;
stats = gcm_client_->GetStatistics();
}
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,
- base::Bind(&GCMProfileService::GetGCMStatisticsFinished,
+ base::Bind(&GCMProfileService::RequestGCMStatisticsFinished,
service_,
stats));
}
-void GCMProfileService::IOWorker::SetGCMRecording(bool recording) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
- gcm::GCMClient::GCMStatistics stats;
-
- if (gcm_client_.get()) {
- gcm_client_->SetRecording(recording);
- stats = gcm_client_->GetStatistics();
- stats.gcm_client_created = true;
- }
-
- content::BrowserThread::PostTask(
- content::BrowserThread::UI,
- FROM_HERE,
- base::Bind(&GCMProfileService::GetGCMStatisticsFinished,
- service_,
- stats));
-}
-
std::string GCMProfileService::GetGCMEnabledStateString(GCMEnabledState state) {
switch (state) {
case GCMProfileService::ALWAYS_ENABLED:
@@ -708,8 +688,8 @@
return gcm_client_ready_;
}
-void GCMProfileService::GetGCMStatistics(
- GetGCMStatisticsCallback callback, bool clear_logs) {
+void GCMProfileService::RequestGCMStatistics(
+ RequestGCMStatisticsCallback callback) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -717,24 +697,10 @@
content::BrowserThread::PostTask(
content::BrowserThread::IO,
FROM_HERE,
- base::Bind(&GCMProfileService::IOWorker::GetGCMStatistics,
- io_worker_,
- clear_logs));
+ base::Bind(&GCMProfileService::IOWorker::RequestGCMStatistics,
+ io_worker_));
}
-void GCMProfileService::SetGCMRecording(
- GetGCMStatisticsCallback callback, bool recording) {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
-
- request_gcm_statistics_callback_ = callback;
- content::BrowserThread::PostTask(
- content::BrowserThread::IO,
- FROM_HERE,
- base::Bind(&GCMProfileService::IOWorker::SetGCMRecording,
- io_worker_,
- recording));
-}
-
void GCMProfileService::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
@@ -938,9 +904,10 @@
return iter == app_handlers_.end() ? &default_app_handler_ : iter->second;
}
-void GCMProfileService::GetGCMStatisticsFinished(
+void GCMProfileService::RequestGCMStatisticsFinished(
GCMClient::GCMStatistics stats) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
request_gcm_statistics_callback_.Run(stats);
}
« no previous file with comments | « trunk/src/chrome/browser/services/gcm/gcm_profile_service.h ('k') | trunk/src/chrome/browser/ui/webui/gcm_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698