OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_FEED_H_ |
| 6 #define CHROME_COMMON_FEED_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/ref_counted.h" |
| 12 #include "googleurl/src/gurl.h" |
| 13 |
| 14 struct FeedItem { |
| 15 // The feed title. |
| 16 std::wstring title; |
| 17 // The feed type, for example: "application/rss+xml". The type can be blank. |
| 18 std::wstring type; |
| 19 // The URL to subscribe to the feed. |
| 20 GURL url; |
| 21 }; |
| 22 |
| 23 class FeedList : public base::RefCounted<FeedList> { |
| 24 public: |
| 25 // We limit the number of feeds that can be sent so that a rouge renderer |
| 26 // doesn't cause excessive memory usage in the browser process by specifying |
| 27 // a huge number of RSS feeds for the browser to parse. |
| 28 static const size_t kMaxFeeds = 50; |
| 29 |
| 30 FeedList() {} |
| 31 |
| 32 void Add(const FeedItem &item) { |
| 33 list_.push_back(item); |
| 34 } |
| 35 |
| 36 const std::vector<FeedItem>& list() const { |
| 37 return list_; |
| 38 } |
| 39 |
| 40 private: |
| 41 std::vector<FeedItem> list_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(FeedList); |
| 44 }; |
| 45 |
| 46 #endif // CHROME_COMMON_FEED_H_ |
OLD | NEW |