summaryrefslogtreecommitdiff
path: root/chromium/components/send_tab_to_self
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/send_tab_to_self
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/send_tab_to_self')
-rw-r--r--chromium/components/send_tab_to_self/BUILD.gn2
-rw-r--r--chromium/components/send_tab_to_self/send_tab_to_self_bridge.cc82
-rw-r--r--chromium/components/send_tab_to_self/send_tab_to_self_metrics.cc17
-rw-r--r--chromium/components/send_tab_to_self/send_tab_to_self_metrics.h31
4 files changed, 0 insertions, 132 deletions
diff --git a/chromium/components/send_tab_to_self/BUILD.gn b/chromium/components/send_tab_to_self/BUILD.gn
index caa173f5cb9..134859eabb3 100644
--- a/chromium/components/send_tab_to_self/BUILD.gn
+++ b/chromium/components/send_tab_to_self/BUILD.gn
@@ -12,8 +12,6 @@ static_library("send_tab_to_self") {
"send_tab_to_self_bridge.h",
"send_tab_to_self_entry.cc",
"send_tab_to_self_entry.h",
- "send_tab_to_self_metrics.cc",
- "send_tab_to_self_metrics.h",
"send_tab_to_self_model.cc",
"send_tab_to_self_model.h",
"send_tab_to_self_model_observer.h",
diff --git a/chromium/components/send_tab_to_self/send_tab_to_self_bridge.cc b/chromium/components/send_tab_to_self/send_tab_to_self_bridge.cc
index 8cea6400080..28906d7d81a 100644
--- a/chromium/components/send_tab_to_self/send_tab_to_self_bridge.cc
+++ b/chromium/components/send_tab_to_self/send_tab_to_self_bridge.cc
@@ -11,7 +11,6 @@
#include "base/check_op.h"
#include "base/guid.h"
#include "base/memory/ptr_util.h"
-#include "base/metrics/histogram_macros.h"
#include "base/optional.h"
#include "base/strings/string_util.h"
#include "base/time/clock.h"
@@ -33,75 +32,12 @@ namespace send_tab_to_self {
namespace {
-// Status of the result of AddEntry.
-// These values are persisted to logs. Entries should not be renumbered and
-// numeric values should never be reused.
-enum class UMAAddEntryStatus {
- // The add entry call was successful.
- SUCCESS = 0,
- // The add entry call failed.
- FAILURE = 1,
- // The add entry call was a duplication.
- DUPLICATE = 2,
- // Update kMaxValue when new enums are added.
- kMaxValue = DUPLICATE,
-};
-// Status of if entries target the local device.
-// These values are persisted to logs. Entries should not be renumbered and
-// numeric values should never be reused.
-enum class UMANotifyLocalDevice {
- // The added entry was sent to the local machine.
- LOCAL = 0,
- // The added entry was targeted at a different machine.
- REMOTE = 1,
- // Update kMaxValue when new enums are added.
- kMaxValue = REMOTE,
-};
-
-// Status of the result of ApplySyncChanges
-// These values are persisted to logs. Entries should not be renumbered and
-// numeric values should never be reused.
-enum class UMAApplySyncChangesStatus {
- // The total number of entity changes received.
- TOTAL = 0,
- // The number of entity changes that are deletions.
- DELETE = 1,
- // The number of entity changes that are invalid.
- INVALID = 2,
- // The number of entity changes that are expired.
- EXPIRED = 3,
- // The number of entity changes that are sent to clients as deletions.
- NOTIFY_DELETED = 4,
- // The number of entity changes that are sent to clients as adds.
- NOTIFY_ADDED = 5,
- // The number of entity changes that are sent to clients as opened.
- NOTIFY_OPENED = 6,
- // Update kMaxValue when new enums are added.
- kMaxValue = NOTIFY_OPENED,
-};
-
using syncer::ModelTypeStore;
const base::TimeDelta kDedupeTime = base::TimeDelta::FromSeconds(5);
const base::TimeDelta kDeviceExpiration = base::TimeDelta::FromDays(10);
-const char kAddEntryStatus[] = "SendTabToSelf.Sync.AddEntryStatus";
-
-const char kNotifyLocalDevice[] = "SendTabToSelf.Sync.NotifyLocalDevice";
-
-const char kApplySyncChangesStatus[] =
- "SendTabToSelf.Sync.ApplySyncChangesStatus";
-
-// A helper function to log the status of ApplySyncChanges.
-void LogApplySyncChangesStatus(UMAApplySyncChangesStatus status) {
- UMA_HISTOGRAM_ENUMERATION(kApplySyncChangesStatus, status);
-}
-// A helper function to log the status of filtering for the current device.
-void LogLocalDeviceNotified(UMANotifyLocalDevice status) {
- UMA_HISTOGRAM_ENUMERATION(kNotifyLocalDevice, status);
-}
-
// Converts a time field from sync protobufs to a time object.
base::Time ProtoTimeToTime(int64_t proto_t) {
return base::Time::FromDeltaSinceWindowsEpoch(
@@ -204,10 +140,8 @@ base::Optional<syncer::ModelError> SendTabToSelfBridge::ApplySyncChanges(
store_->CreateWriteBatch();
for (const std::unique_ptr<syncer::EntityChange>& change : entity_changes) {
- LogApplySyncChangesStatus(UMAApplySyncChangesStatus::TOTAL);
const std::string& guid = change->storage_key();
if (change->type() == syncer::EntityChange::ACTION_DELETE) {
- LogApplySyncChangesStatus(UMAApplySyncChangesStatus::DELETE);
if (entries_.find(guid) != entries_.end()) {
if (mru_entry_ && mru_entry_->GetGUID() == guid) {
mru_entry_ = nullptr;
@@ -215,8 +149,6 @@ base::Optional<syncer::ModelError> SendTabToSelfBridge::ApplySyncChanges(
entries_.erase(change->storage_key());
batch->DeleteData(guid);
removed.push_back(change->storage_key());
-
- LogApplySyncChangesStatus(UMAApplySyncChangesStatus::NOTIFY_DELETED);
}
} else {
const sync_pb::SendTabToSelfSpecifics& specifics =
@@ -225,26 +157,19 @@ base::Optional<syncer::ModelError> SendTabToSelfBridge::ApplySyncChanges(
std::unique_ptr<SendTabToSelfEntry> remote_entry =
SendTabToSelfEntry::FromProto(specifics, clock_->Now());
if (!remote_entry) {
- LogApplySyncChangesStatus(UMAApplySyncChangesStatus::INVALID);
continue; // Skip invalid entries.
}
if (remote_entry->IsExpired(clock_->Now())) {
// Remove expired data from server.
-
- LogApplySyncChangesStatus(UMAApplySyncChangesStatus::EXPIRED);
change_processor()->Delete(guid, batch->GetMetadataChangeList());
} else {
SendTabToSelfEntry* local_entry =
GetMutableEntryByGUID(remote_entry->GetGUID());
SendTabToSelfLocal remote_entry_pb = remote_entry->AsLocalProto();
-
if (local_entry == nullptr) {
// This remote_entry is new. Add it to the model.
-
- LogApplySyncChangesStatus(UMAApplySyncChangesStatus::NOTIFY_ADDED);
added.push_back(remote_entry.get());
if (remote_entry->IsOpened()) {
- LogApplySyncChangesStatus(UMAApplySyncChangesStatus::NOTIFY_OPENED);
opened.push_back(remote_entry.get());
}
entries_[remote_entry->GetGUID()] = std::move(remote_entry);
@@ -371,12 +296,10 @@ const SendTabToSelfEntry* SendTabToSelfBridge::AddEntry(
const std::string& target_device_cache_guid) {
if (!change_processor()->IsTrackingMetadata()) {
// TODO(crbug.com/940512) handle failure case.
- UMA_HISTOGRAM_ENUMERATION(kAddEntryStatus, UMAAddEntryStatus::FAILURE);
return nullptr;
}
if (!url.is_valid()) {
- UMA_HISTOGRAM_ENUMERATION(kAddEntryStatus, UMAAddEntryStatus::FAILURE);
return nullptr;
}
@@ -387,7 +310,6 @@ const SendTabToSelfEntry* SendTabToSelfBridge::AddEntry(
if (mru_entry_ && url == mru_entry_->GetURL() &&
navigation_time == mru_entry_->GetOriginalNavigationTime() &&
shared_time - mru_entry_->GetSharedTime() < kDedupeTime) {
- UMA_HISTOGRAM_ENUMERATION(kAddEntryStatus, UMAAddEntryStatus::DUPLICATE);
return mru_entry_;
}
@@ -422,7 +344,6 @@ const SendTabToSelfEntry* SendTabToSelfBridge::AddEntry(
Commit(std::move(batch));
mru_entry_ = result;
- UMA_HISTOGRAM_ENUMERATION(kAddEntryStatus, UMAAddEntryStatus::SUCCESS);
return result;
}
@@ -559,9 +480,6 @@ void SendTabToSelfBridge::NotifyRemoteSendTabToSelfEntryAdded(
entry->GetTargetDeviceSyncCacheGuid()) &&
!entry->GetNotificationDismissed() && !entry->IsOpened()) {
new_local_entries.push_back(entry);
- LogLocalDeviceNotified(UMANotifyLocalDevice::LOCAL);
- } else {
- LogLocalDeviceNotified(UMANotifyLocalDevice::REMOTE);
}
}
diff --git a/chromium/components/send_tab_to_self/send_tab_to_self_metrics.cc b/chromium/components/send_tab_to_self/send_tab_to_self_metrics.cc
deleted file mode 100644
index 9f035f736e7..00000000000
--- a/chromium/components/send_tab_to_self/send_tab_to_self_metrics.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/send_tab_to_self/send_tab_to_self_metrics.h"
-
-#include "base/metrics/histogram_macros.h"
-
-namespace send_tab_to_self {
-
-const char kNotificationStatusHistogram[] = "SendTabToSelf.Notification";
-
-void RecordNotificationHistogram(SendTabToSelfNotification status) {
- UMA_HISTOGRAM_ENUMERATION(kNotificationStatusHistogram, status);
-}
-
-} // namespace send_tab_to_self
diff --git a/chromium/components/send_tab_to_self/send_tab_to_self_metrics.h b/chromium/components/send_tab_to_self/send_tab_to_self_metrics.h
deleted file mode 100644
index a8d0e86ef04..00000000000
--- a/chromium/components/send_tab_to_self/send_tab_to_self_metrics.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_SEND_TAB_TO_SELF_SEND_TAB_TO_SELF_METRICS_H_
-#define COMPONENTS_SEND_TAB_TO_SELF_SEND_TAB_TO_SELF_METRICS_H_
-
-namespace send_tab_to_self {
-
-// Metrics for measuring notification interaction.
-// These values are persisted to logs. Entries should not be renumbered and
-// numeric values should never be reused.
-extern const char kNotificationStatusHistogram[];
-enum class SendTabToSelfNotification {
- // The user opened a tab from a notification.
- kOpened = 0,
- // The user closed a notification.
- kDismissed = 1,
- // A notification was shown from a remotely added entry.
- kShown = 2,
- // 3 is once |kDismissedRemotely| and has been obsoleted.
- // Numeric values should skip 3.
- // Update kMaxValue when new enums are added.
- kMaxValue = kShown,
-};
-
-void RecordNotificationHistogram(SendTabToSelfNotification status);
-
-} // namespace send_tab_to_self
-
-#endif // COMPONENTS_SEND_TAB_TO_SELF_SEND_TAB_TO_SELF_METRICS_H_ \ No newline at end of file