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

Unified Diff: sync/notifier/gcm_network_channel.cc

Issue 270873002: Extract GCMClient data types into separate gcm_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload 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
« no previous file with comments | « sync/notifier/gcm_network_channel.h ('k') | sync/notifier/gcm_network_channel_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/gcm_network_channel.cc
diff --git a/sync/notifier/gcm_network_channel.cc b/sync/notifier/gcm_network_channel.cc
index ca5677da381499f0818aff3a86a84d37a3432b29..d4125a98f15601b012f316aaebd507572da7ece3 100644
--- a/sync/notifier/gcm_network_channel.cc
+++ b/sync/notifier/gcm_network_channel.cc
@@ -125,9 +125,9 @@ void GCMNetworkChannel::Register() {
void GCMNetworkChannel::OnRegisterComplete(
const std::string& registration_id,
- gcm::GCMClient::Result result) {
+ gcm::Result result) {
DCHECK(CalledOnValidThread());
- if (result == gcm::GCMClient::SUCCESS) {
+ if (result == gcm::RESULT_SUCCESS) {
DCHECK(!registration_id.empty());
DVLOG(2) << "Got registration_id";
register_backoff_entry_->Reset();
@@ -138,10 +138,10 @@ void GCMNetworkChannel::OnRegisterComplete(
DVLOG(2) << "Register failed: " << result;
// Retry in case of transient error.
switch (result) {
- case gcm::GCMClient::NETWORK_ERROR:
- case gcm::GCMClient::SERVER_ERROR:
- case gcm::GCMClient::TTL_EXCEEDED:
- case gcm::GCMClient::UNKNOWN_ERROR: {
+ case gcm::RESULT_NETWORK_ERROR:
+ case gcm::RESULT_SERVER_ERROR:
+ case gcm::RESULT_TTL_EXCEEDED:
+ case gcm::RESULT_UNKNOWN_ERROR: {
register_backoff_entry_->InformOfRequest(false);
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
@@ -384,7 +384,7 @@ GCMNetworkChannelDiagnostic::GCMNetworkChannelDiagnostic(
: parent_(parent),
last_message_empty_echo_token_(false),
last_post_response_code_(0),
- registration_result_(gcm::GCMClient::UNKNOWN_ERROR),
+ registration_result_(gcm::RESULT_UNKNOWN_ERROR),
sent_messages_count_(0) {}
scoped_ptr<base::DictionaryValue>
@@ -410,17 +410,17 @@ GCMNetworkChannelDiagnostic::CollectDebugData() const {
}
std::string GCMNetworkChannelDiagnostic::GCMClientResultToString(
- const gcm::GCMClient::Result result) const {
+ const gcm::Result result) const {
#define ENUM_CASE(x) case x: return #x; break;
switch (result) {
- ENUM_CASE(gcm::GCMClient::SUCCESS);
- ENUM_CASE(gcm::GCMClient::NETWORK_ERROR);
- ENUM_CASE(gcm::GCMClient::SERVER_ERROR);
- ENUM_CASE(gcm::GCMClient::TTL_EXCEEDED);
- ENUM_CASE(gcm::GCMClient::UNKNOWN_ERROR);
- ENUM_CASE(gcm::GCMClient::NOT_SIGNED_IN);
- ENUM_CASE(gcm::GCMClient::INVALID_PARAMETER);
- ENUM_CASE(gcm::GCMClient::ASYNC_OPERATION_PENDING);
+ ENUM_CASE(gcm::RESULT_SUCCESS);
+ ENUM_CASE(gcm::RESULT_NETWORK_ERROR);
+ ENUM_CASE(gcm::RESULT_SERVER_ERROR);
+ ENUM_CASE(gcm::RESULT_TTL_EXCEEDED);
+ ENUM_CASE(gcm::RESULT_UNKNOWN_ERROR);
+ ENUM_CASE(gcm::RESULT_NOT_SIGNED_IN);
+ ENUM_CASE(gcm::RESULT_INVALID_PARAMETER);
+ ENUM_CASE(gcm::RESULT_ASYNC_OPERATION_PENDING);
}
NOTREACHED();
return "";
« no previous file with comments | « sync/notifier/gcm_network_channel.h ('k') | sync/notifier/gcm_network_channel_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698