summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/copresence/copresence_translations.cc
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2016-03-24 13:52:17 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-24 20:54:01 +0000
commit1cb4c0e1be53447096ae11f820bb408b71184682 (patch)
tree7c02b5e09c2c0c08a7faaf6e1eb1ef30aa23d013 /chrome/browser/extensions/api/copresence/copresence_translations.cc
parent5ca8b4fa7b1f9d53be5f5f1a30b4cecf1c1c4fa5 (diff)
downloadchromium_src-1cb4c0e1be53447096ae11f820bb408b71184682.zip
chromium_src-1cb4c0e1be53447096ae11f820bb408b71184682.tar.gz
chromium_src-1cb4c0e1be53447096ae11f820bb408b71184682.tar.bz2
[Extensions] Convert APIs to use movable types [3]
Generated extensions code used to rely on linked_ptrs for non-copyable types in containers. Now, we can make these types movable. Update the following APIs to use movable types in this CL: - browser.idl - browsing_data.json - cast_devices_private.idl - cast_streaming_receiver_session.idl - cast_streaming_rtp_stream.idl - cast_streaming_session.idl - cast_streaming_udp_transport.idl - certificate_provider.idl - certificate_provider_internal.idl - chrome_web_view_internal.json - chromeos_info_private.json - cloud_print_private.json - command_line_private.json - commands.json - content_settings.json - context_menus.json - context_menus_internal.json - cookies.json - copresence.idl - copresence_private.idl BUG=595949 Review URL: https://codereview.chromium.org/1828683002 Cr-Commit-Position: refs/heads/master@{#383142}
Diffstat (limited to 'chrome/browser/extensions/api/copresence/copresence_translations.cc')
-rw-r--r--chrome/browser/extensions/api/copresence/copresence_translations.cc44
1 files changed, 20 insertions, 24 deletions
diff --git a/chrome/browser/extensions/api/copresence/copresence_translations.cc b/chrome/browser/extensions/api/copresence/copresence_translations.cc
index 779040e..3537e2c 100644
--- a/chrome/browser/extensions/api/copresence/copresence_translations.cc
+++ b/chrome/browser/extensions/api/copresence/copresence_translations.cc
@@ -197,37 +197,33 @@ bool AddUnsubscribeToRequest(const std::string& app_id,
return true;
}
-bool PrepareReportRequestProto(
- const std::vector<linked_ptr<Operation>>& operations,
- const std::string& app_id,
- SubscriptionToAppMap* apps_by_subscription_id,
- ReportRequest* request) {
- for (const linked_ptr<Operation>& op : operations) {
- DCHECK(op.get());
-
+bool PrepareReportRequestProto(const std::vector<Operation>& operations,
+ const std::string& app_id,
+ SubscriptionToAppMap* apps_by_subscription_id,
+ ReportRequest* request) {
+ for (const Operation& op : operations) {
// Verify our object has exactly one operation.
- if (static_cast<int>(op->publish != nullptr) +
- static_cast<int>(op->subscribe != nullptr) +
- static_cast<int>(op->unpublish != nullptr) +
- static_cast<int>(op->unsubscribe != nullptr) != 1) {
+ if (static_cast<int>(op.publish != nullptr) +
+ static_cast<int>(op.subscribe != nullptr) +
+ static_cast<int>(op.unpublish != nullptr) +
+ static_cast<int>(op.unsubscribe != nullptr) !=
+ 1) {
return false;
}
- if (op->publish) {
- if (!AddPublishToRequest(app_id, *(op->publish), request))
+ if (op.publish) {
+ if (!AddPublishToRequest(app_id, *(op.publish), request))
return false;
- } else if (op->subscribe) {
- if (!AddSubscribeToRequest(
- app_id, *(op->subscribe), apps_by_subscription_id, request))
+ } else if (op.subscribe) {
+ if (!AddSubscribeToRequest(app_id, *(op.subscribe),
+ apps_by_subscription_id, request))
return false;
- } else if (op->unpublish) {
- if (!AddUnpublishToRequest(op->unpublish->unpublish_id, request))
+ } else if (op.unpublish) {
+ if (!AddUnpublishToRequest(op.unpublish->unpublish_id, request))
return false;
- } else { // if (op->unsubscribe)
- if (!AddUnsubscribeToRequest(app_id,
- op->unsubscribe->unsubscribe_id,
- apps_by_subscription_id,
- request))
+ } else { // if (op.unsubscribe)
+ if (!AddUnsubscribeToRequest(app_id, op.unsubscribe->unsubscribe_id,
+ apps_by_subscription_id, request))
return false;
}
}