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

Side by Side Diff: content/browser/notifications/notification_database_data_conversions.cc

Issue 1851933002: Convert //url to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU fixup 7 Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/notifications/notification_database_data_conversions.h " 5 #include "content/browser/notifications/notification_database_data_conversions.h "
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory>
10
9 #include "base/logging.h" 11 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
11 #include "base/time/time.h" 13 #include "base/time/time.h"
12 #include "content/browser/notifications/notification_database_data.pb.h" 14 #include "content/browser/notifications/notification_database_data.pb.h"
13 #include "content/public/browser/notification_database_data.h" 15 #include "content/public/browser/notification_database_data.h"
14 16
15 namespace content { 17 namespace content {
16 18
17 bool DeserializeNotificationDatabaseData(const std::string& input, 19 bool DeserializeNotificationDatabaseData(const std::string& input,
18 NotificationDatabaseData* output) { 20 NotificationDatabaseData* output) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 notification_data->actions.push_back(action); 79 notification_data->actions.push_back(action);
78 } 80 }
79 81
80 return true; 82 return true;
81 } 83 }
82 84
83 bool SerializeNotificationDatabaseData(const NotificationDatabaseData& input, 85 bool SerializeNotificationDatabaseData(const NotificationDatabaseData& input,
84 std::string* output) { 86 std::string* output) {
85 DCHECK(output); 87 DCHECK(output);
86 88
87 scoped_ptr<NotificationDatabaseDataProto::NotificationData> payload( 89 std::unique_ptr<NotificationDatabaseDataProto::NotificationData> payload(
88 new NotificationDatabaseDataProto::NotificationData()); 90 new NotificationDatabaseDataProto::NotificationData());
89 91
90 const PlatformNotificationData& notification_data = input.notification_data; 92 const PlatformNotificationData& notification_data = input.notification_data;
91 93
92 payload->set_title(base::UTF16ToUTF8(notification_data.title)); 94 payload->set_title(base::UTF16ToUTF8(notification_data.title));
93 95
94 switch (notification_data.direction) { 96 switch (notification_data.direction) {
95 case PlatformNotificationData::DIRECTION_LEFT_TO_RIGHT: 97 case PlatformNotificationData::DIRECTION_LEFT_TO_RIGHT:
96 payload->set_direction( 98 payload->set_direction(
97 NotificationDatabaseDataProto::NotificationData::LEFT_TO_RIGHT); 99 NotificationDatabaseDataProto::NotificationData::LEFT_TO_RIGHT);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 message.set_notification_id(input.notification_id); 139 message.set_notification_id(input.notification_id);
138 message.set_origin(input.origin.spec()); 140 message.set_origin(input.origin.spec());
139 message.set_service_worker_registration_id( 141 message.set_service_worker_registration_id(
140 input.service_worker_registration_id); 142 input.service_worker_registration_id);
141 message.set_allocated_notification_data(payload.release()); 143 message.set_allocated_notification_data(payload.release());
142 144
143 return message.SerializeToString(output); 145 return message.SerializeToString(output);
144 } 146 }
145 147
146 } // namespace content 148 } // namespace content
OLDNEW
« no previous file with comments | « components/password_manager/core/common/credential_manager_types.h ('k') | content/child/request_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698