summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authornkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-08 12:26:13 +0000
committernkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-08 12:26:13 +0000
commitd31f8a126dd50a6deebea4e2e6ad8fc0ed2a5ad3 (patch)
tree240b8bd75541d78c2cd448d3caf32fae54f67d4b /google_apis
parent639569a49e6efeb8028235edc5d68b880f399982 (diff)
downloadchromium_src-d31f8a126dd50a6deebea4e2e6ad8fc0ed2a5ad3.zip
chromium_src-d31f8a126dd50a6deebea4e2e6ad8fc0ed2a5ad3.tar.gz
chromium_src-d31f8a126dd50a6deebea4e2e6ad8fc0ed2a5ad3.tar.bz2
Revert of Enable auto-refreshing of the gcm-internals page whenever a GCM activity is recorded. (https://codereview.chromium.org/266913015/)
Reason for revert: Introduces crash on sign in on Chrome OS. BUG=371297 https://code.google.com/p/chromium/issues/detail?id=371297 Original issue's description: > Enable auto-refreshing of the gcm-internals page whenever a GCM activity is recorded. > > BUG=341256 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=268976 TBR=jianli@chromium.org,zea@chromium.org,juyik@chromium.org NOTREECHECKS=true NOTRY=true BUG=341256 Review URL: https://codereview.chromium.org/273753005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gcm/gcm_client.h4
-rw-r--r--google_apis/gcm/gcm_client_impl.cc8
-rw-r--r--google_apis/gcm/gcm_client_impl.h8
-rw-r--r--google_apis/gcm/gcm_client_impl_unittest.cc1
-rw-r--r--google_apis/gcm/monitoring/gcm_stats_recorder.cc16
-rw-r--r--google_apis/gcm/monitoring/gcm_stats_recorder.h21
6 files changed, 5 insertions, 53 deletions
diff --git a/google_apis/gcm/gcm_client.h b/google_apis/gcm/gcm_client.h
index ff9eb41..28c9ef2 100644
--- a/google_apis/gcm/gcm_client.h
+++ b/google_apis/gcm/gcm_client.h
@@ -156,10 +156,6 @@ class GCM_EXPORT GCMClient {
// finished loading from the GCM store and retrieved the device check-in
// from the server if it hadn't yet.
virtual void OnGCMReady() = 0;
-
- // Called when activities are being recorded and a new activity has just
- // been recorded.
- virtual void OnActivityRecorded() = 0;
};
GCMClient();
diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc
index 953baa9..a0a2142 100644
--- a/google_apis/gcm/gcm_client_impl.cc
+++ b/google_apis/gcm/gcm_client_impl.cc
@@ -176,7 +176,7 @@ void GCMClientImpl::Initialize(
const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
const scoped_refptr<net::URLRequestContextGetter>&
url_request_context_getter,
- GCMClient::Delegate* delegate) {
+ Delegate* delegate) {
DCHECK_EQ(UNINITIALIZED, state_);
DCHECK(url_request_context_getter);
DCHECK(delegate);
@@ -195,8 +195,6 @@ void GCMClientImpl::Initialize(
delegate_ = delegate;
- recorder_.SetDelegate(this);
-
state_ = INITIALIZED;
}
@@ -629,10 +627,6 @@ GCMClient::GCMStatistics GCMClientImpl::GetStatistics() const {
return stats;
}
-void GCMClientImpl::OnActivityRecorded() {
- delegate_->OnActivityRecorded();
-}
-
void GCMClientImpl::OnMessageReceivedFromMCS(const gcm::MCSMessage& message) {
switch (message.tag()) {
case kLoginResponseTag:
diff --git a/google_apis/gcm/gcm_client_impl.h b/google_apis/gcm/gcm_client_impl.h
index 47ef48a..85f206b 100644
--- a/google_apis/gcm/gcm_client_impl.h
+++ b/google_apis/gcm/gcm_client_impl.h
@@ -73,8 +73,7 @@ class GCM_EXPORT GCMInternalsBuilder {
// with MCS) and other pieces of GCM infrastructure like Registration and
// Checkins. It also allows for registering user delegates that host
// applications that send and receive messages.
-class GCM_EXPORT GCMClientImpl
- : public GCMClient, public GCMStatsRecorder::Delegate {
+class GCM_EXPORT GCMClientImpl : public GCMClient {
public:
explicit GCMClientImpl(scoped_ptr<GCMInternalsBuilder> internals_builder);
virtual ~GCMClientImpl();
@@ -87,7 +86,7 @@ class GCM_EXPORT GCMClientImpl
const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
const scoped_refptr<net::URLRequestContextGetter>&
url_request_context_getter,
- GCMClient::Delegate* delegate) OVERRIDE;
+ Delegate* delegate) OVERRIDE;
virtual void Load() OVERRIDE;
virtual void Stop() OVERRIDE;
virtual void CheckOut() OVERRIDE;
@@ -100,7 +99,6 @@ class GCM_EXPORT GCMClientImpl
virtual void SetRecording(bool recording) OVERRIDE;
virtual void ClearActivityLogs() OVERRIDE;
virtual GCMStatistics GetStatistics() const OVERRIDE;
- virtual void OnActivityRecorded() OVERRIDE;
private:
// State representation of the GCMClient.
@@ -237,7 +235,7 @@ class GCM_EXPORT GCMClientImpl
// State of the GCM Client Implementation.
State state_;
- GCMClient::Delegate* delegate_;
+ Delegate* delegate_;
// Device checkin info (android ID and security token used by device).
CheckinInfo device_checkin_info_;
diff --git a/google_apis/gcm/gcm_client_impl_unittest.cc b/google_apis/gcm/gcm_client_impl_unittest.cc
index d0b278f..ba49590 100644
--- a/google_apis/gcm/gcm_client_impl_unittest.cc
+++ b/google_apis/gcm/gcm_client_impl_unittest.cc
@@ -250,7 +250,6 @@ class GCMClientImplTest : public testing::Test,
const std::string& app_id,
const gcm::GCMClient::SendErrorDetails& send_error_details) OVERRIDE;
virtual void OnGCMReady() OVERRIDE;
- virtual void OnActivityRecorded() OVERRIDE {}
GCMClientImpl* gcm_client() const { return gcm_client_.get(); }
FakeMCSClient* mcs_client() const {
diff --git a/google_apis/gcm/monitoring/gcm_stats_recorder.cc b/google_apis/gcm/monitoring/gcm_stats_recorder.cc
index 8d1d2aa..649720f 100644
--- a/google_apis/gcm/monitoring/gcm_stats_recorder.cc
+++ b/google_apis/gcm/monitoring/gcm_stats_recorder.cc
@@ -184,7 +184,7 @@ GCMStatsRecorder::RecordedActivities::RecordedActivities() {
GCMStatsRecorder::RecordedActivities::~RecordedActivities() {
}
-GCMStatsRecorder::GCMStatsRecorder() : is_recording_(false), delegate_(NULL) {
+GCMStatsRecorder::GCMStatsRecorder() : is_recording_(false) {
}
GCMStatsRecorder::~GCMStatsRecorder() {
@@ -194,10 +194,6 @@ void GCMStatsRecorder::SetRecording(bool recording) {
is_recording_ = recording;
}
-void GCMStatsRecorder::SetDelegate(Delegate* delegate) {
- delegate_ = delegate;
-}
-
void GCMStatsRecorder::Clear() {
checkin_activities_.clear();
connection_activities_.clear();
@@ -206,11 +202,6 @@ void GCMStatsRecorder::Clear() {
sending_activities_.clear();
}
-void GCMStatsRecorder::NotifyActivityRecorded() {
- if (delegate_)
- delegate_->OnActivityRecorded();
-}
-
void GCMStatsRecorder::RecordCheckin(
const std::string& event,
const std::string& details) {
@@ -219,7 +210,6 @@ void GCMStatsRecorder::RecordCheckin(
&checkin_activities_, data);
inserted_data->event = event;
inserted_data->details = details;
- NotifyActivityRecorded();
}
void GCMStatsRecorder::RecordCheckinInitiated(uint64 android_id) {
@@ -261,7 +251,6 @@ void GCMStatsRecorder::RecordConnection(
&connection_activities_, data);
inserted_data->event = event;
inserted_data->details = details;
- NotifyActivityRecorded();
}
void GCMStatsRecorder::RecordConnectionInitiated(const std::string& host) {
@@ -311,7 +300,6 @@ void GCMStatsRecorder::RecordRegistration(
inserted_data->sender_ids = sender_ids;
inserted_data->event = event;
inserted_data->details = details;
- NotifyActivityRecorded();
}
void GCMStatsRecorder::RecordRegistrationSent(
@@ -390,7 +378,6 @@ void GCMStatsRecorder::RecordReceiving(
inserted_data->message_byte_size = message_byte_size;
inserted_data->event = event;
inserted_data->details = details;
- NotifyActivityRecorded();
}
void GCMStatsRecorder::RecordDataMessageReceived(
@@ -460,7 +447,6 @@ void GCMStatsRecorder::RecordSending(const std::string& app_id,
inserted_data->message_id = message_id;
inserted_data->event = event;
inserted_data->details = details;
- NotifyActivityRecorded();
}
void GCMStatsRecorder::RecordDataSentToWire(
diff --git a/google_apis/gcm/monitoring/gcm_stats_recorder.h b/google_apis/gcm/monitoring/gcm_stats_recorder.h
index bc2afb2..ffee1ae 100644
--- a/google_apis/gcm/monitoring/gcm_stats_recorder.h
+++ b/google_apis/gcm/monitoring/gcm_stats_recorder.h
@@ -95,15 +95,6 @@ class GCM_EXPORT GCMStatsRecorder {
std::vector<GCMStatsRecorder::SendingActivity> sending_activities;
};
- // A delegate interface that allows the GCMStatsRecorder instance to interact
- // with its container.
- class Delegate {
- public:
- // Called when the GCMStatsRecorder is recording activities and a new
- // activity has just been recorded.
- virtual void OnActivityRecorded() = 0;
- };
-
GCMStatsRecorder();
virtual ~GCMStatsRecorder();
@@ -115,9 +106,6 @@ class GCM_EXPORT GCMStatsRecorder {
// Turns recording on/off.
void SetRecording(bool recording);
- // Set a delegate to receive callback from the recorder.
- void SetDelegate(Delegate* delegate);
-
// Clear all recorded activities.
void Clear();
@@ -231,27 +219,19 @@ class GCM_EXPORT GCMStatsRecorder {
}
protected:
- // Notify the recorder delegate, if it exists, that an activity has been
- // recorded.
- void NotifyActivityRecorded();
-
void RecordCheckin(const std::string& event,
const std::string& details);
-
void RecordConnection(const std::string& event,
const std::string& details);
-
void RecordRegistration(const std::string& app_id,
const std::string& sender_id,
const std::string& event,
const std::string& details);
-
void RecordReceiving(const std::string& app_id,
const std::string& from,
int message_byte_size,
const std::string& event,
const std::string& details);
-
void RecordSending(const std::string& app_id,
const std::string& receiver_id,
const std::string& message_id,
@@ -259,7 +239,6 @@ class GCM_EXPORT GCMStatsRecorder {
const std::string& details);
bool is_recording_;
- Delegate* delegate_;
std::deque<CheckinActivity> checkin_activities_;
std::deque<ConnectionActivity> connection_activities_;