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

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

Issue 2868793003: RE-add the ability to delete notification ids unknown by the display service. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | content/browser/notifications/platform_notification_context_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 5 #include "content/browser/notifications/notification_database.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 &notification_database_data); 321 &notification_database_data);
322 if (status != STATUS_OK) 322 if (status != STATUS_OK)
323 return status; 323 return status;
324 324
325 if (service_worker_registration_id != kInvalidServiceWorkerRegistrationId && 325 if (service_worker_registration_id != kInvalidServiceWorkerRegistrationId &&
326 notification_database_data.service_worker_registration_id != 326 notification_database_data.service_worker_registration_id !=
327 service_worker_registration_id) { 327 service_worker_registration_id) {
328 continue; 328 continue;
329 } 329 }
330 330
331 // Silently ignore the notification if it doesn't have an ID assigned.
332 // TODO(peter): Remove this clause when Chrome 55 has branched.
333 if (notification_database_data.notification_id.empty())
334 continue;
335
336 notification_data_vector->push_back(notification_database_data); 331 notification_data_vector->push_back(notification_database_data);
337 } 332 }
338 333
339 return LevelDBStatusToStatus(iter->status()); 334 return LevelDBStatusToStatus(iter->status());
340 } 335 }
341 336
342 NotificationDatabase::Status 337 NotificationDatabase::Status
343 NotificationDatabase::DeleteAllNotificationDataInternal( 338 NotificationDatabase::DeleteAllNotificationDataInternal(
344 const GURL& origin, 339 const GURL& origin,
345 const std::string& tag, 340 const std::string& tag,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 notification_database_data.notification_id); 383 notification_database_data.notification_id);
389 } 384 }
390 385
391 if (deleted_notification_ids->empty()) 386 if (deleted_notification_ids->empty())
392 return STATUS_OK; 387 return STATUS_OK;
393 388
394 return LevelDBStatusToStatus(db_->Write(leveldb::WriteOptions(), &batch)); 389 return LevelDBStatusToStatus(db_->Write(leveldb::WriteOptions(), &batch));
395 } 390 }
396 391
397 } // namespace content 392 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/notifications/platform_notification_context_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698