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

Unified Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc

Issue 2849493002: [EasyUnlock] Fixing the setup connection finder and message format. (Closed)
Patch Set: date Created 3 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: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc
index e8a219c868a99f3128ceab20e3b661ed5cc9d8f7..421f4f19cc4672301c889e20d8206c2496c7d5e0 100644
--- a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc
@@ -99,11 +99,10 @@ bool EasyUnlockPrivateConnectionManager::Disconnect(const Extension* extension,
bool EasyUnlockPrivateConnectionManager::SendMessage(
const Extension* extension,
int connection_id,
- const std::string& payload) {
+ const std::string& message_body) {
Connection* connection = GetConnection(extension->id(), connection_id);
if (connection && connection->IsConnected()) {
- connection->SendMessage(base::MakeUnique<WireMessage>(
- payload, std::string(kEasyUnlockFeatureName)));
+ connection->SendMessage(base::MakeUnique<WireMessage>(message_body));
return true;
}
return false;
@@ -128,15 +127,10 @@ void EasyUnlockPrivateConnectionManager::OnConnectionStatusChanged(
void EasyUnlockPrivateConnectionManager::OnMessageReceived(
const Connection& connection,
const WireMessage& message) {
- if (message.feature() != std::string(kEasyUnlockFeatureName)) {
- // Only process messages received as part of EasyUnlock.
- return;
- }
-
std::string event_name = api::easy_unlock_private::OnDataReceived::kEventName;
events::HistogramValue histogram_value =
events::EASY_UNLOCK_PRIVATE_ON_DATA_RECEIVED;
- std::vector<char> data(message.payload().begin(), message.payload().end());
+ std::vector<char> data(message.body().begin(), message.body().end());
std::unique_ptr<base::ListValue> args =
api::easy_unlock_private::OnDataReceived::Create(0, data);
DispatchConnectionEvent(event_name, histogram_value, &connection,

Powered by Google App Engine
This is Rietveld 408576698