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

Unified Diff: components/gcm_driver/gcm_driver_desktop.cc

Issue 1616113003: List message decryption failures on chrome://gcm-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after CL 1619053003 Created 4 years, 11 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
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop.h ('k') | components/gcm_driver/gcm_driver_desktop_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_driver_desktop.cc
diff --git a/components/gcm_driver/gcm_driver_desktop.cc b/components/gcm_driver/gcm_driver_desktop.cc
index b967feac46094e52ee6f2f2364c0a269cf8db9fe..2ff4187cb13f3a865dedc0edd63793aeb8983d9a 100644
--- a/components/gcm_driver/gcm_driver_desktop.cc
+++ b/components/gcm_driver/gcm_driver_desktop.cc
@@ -107,6 +107,9 @@ class GCMDriverDesktop::IOWorker : public GCMClient::Delegate {
const std::string& authorized_entity,
const std::string& scope);
+ void RecordDecryptionFailure(const std::string& app_id,
+ GCMEncryptionProvider::DecryptionFailure reason);
+
// For testing purpose. Can be called from UI thread. Use with care.
GCMClient* gcm_client_for_testing() const { return gcm_client_.get(); }
@@ -496,6 +499,13 @@ void GCMDriverDesktop::IOWorker::RemoveHeartbeatInterval(
gcm_client_->RemoveHeartbeatInterval(scope);
}
+void GCMDriverDesktop::IOWorker::RecordDecryptionFailure(
+ const std::string& app_id,
+ GCMEncryptionProvider::DecryptionFailure reason) {
+ DCHECK(io_thread_->RunsTasksOnCurrentThread());
+ gcm_client_->RecordDecryptionFailure(app_id, reason);
+}
+
GCMDriverDesktop::GCMDriverDesktop(
scoped_ptr<GCMClientFactory> gcm_client_factory,
const GCMClient::ChromeBuildInfo& chrome_build_info,
@@ -722,6 +732,17 @@ void GCMDriverDesktop::DoSend(const std::string& app_id,
message));
}
+void GCMDriverDesktop::RecordDecryptionFailure(
+ const std::string& app_id,
+ GCMEncryptionProvider::DecryptionFailure reason) {
+ DCHECK(ui_thread_->RunsTasksOnCurrentThread());
+ io_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&GCMDriverDesktop::IOWorker::RecordDecryptionFailure,
+ base::Unretained(io_worker_.get()),
+ app_id, reason));
+}
+
GCMClient* GCMDriverDesktop::GetGCMClientForTesting() const {
DCHECK(ui_thread_->RunsTasksOnCurrentThread());
return io_worker_ ? io_worker_->gcm_client_for_testing() : NULL;
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop.h ('k') | components/gcm_driver/gcm_driver_desktop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698