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

Unified Diff: chrome/browser/extensions/extension_app_api.cc

Issue 8567018: Limit number of notifications that can be received by the client. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/extension_app_api.cc
===================================================================
--- chrome/browser/extensions/extension_app_api.cc (revision 109957)
+++ chrome/browser/extensions/extension_app_api.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/extension_app_api.h"
#include "base/values.h"
+#include "base/time.h"
#include "chrome/browser/extensions/app_notification_manager.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -17,6 +18,7 @@
const char kLinkTextKey[] = "linkText";
const char kLinkUrlKey[] = "linkUrl";
const char kTitleKey[] = "title";
+const char kCreationKey[] = "creation_timestamp_ms";
asargent_no_longer_on_chrome 2011/11/17 23:40:14 nit: remove this
elvin 2011/11/18 00:10:18 Done.
const char kInvalidExtensionIdError[] =
"Invalid extension id";
@@ -46,8 +48,13 @@
if (details->HasKey(kBodyTextKey))
EXTENSION_FUNCTION_VALIDATE(details->GetString(kBodyTextKey, &body));
+ double creation_timestamp_ms;
+ if (details->HasKey(kCreationKey))
+ EXTENSION_FUNCTION_VALIDATE(details->GetDouble(kCreationKey,
+ &creation_timestamp_ms));
asargent_no_longer_on_chrome 2011/11/17 23:40:14 nit: remove this block since we're just passing Ti
elvin 2011/11/18 00:10:18 Done.
+
scoped_ptr<AppNotification> item(new AppNotification(
- true, "", id, title, body));
+ true, base::Time::Now(), "", id, title, body));
if (details->HasKey(kLinkUrlKey)) {
std::string link_url;

Powered by Google App Engine
This is Rietveld 408576698