diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 22:48:08 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 22:48:08 +0000 |
commit | cbc0e9cc6651df9bb4a256c30c7d4a8fce36d066 (patch) | |
tree | 04db665d0a50888ece0b9e5c83695b7860381827 /webkit | |
parent | 81cf6f77e3bf3a413220d9b28ba83d85567d9048 (diff) | |
download | chromium_src-cbc0e9cc6651df9bb4a256c30c7d4a8fce36d066.zip chromium_src-cbc0e9cc6651df9bb4a256c30c7d4a8fce36d066.tar.gz chromium_src-cbc0e9cc6651df9bb4a256c30c7d4a8fce36d066.tar.bz2 |
Fix bug 9812: Remove current RSS code in favor of new more generalized
PageAction code that serves the same purpose (and more).
BUG=9812
TEST=No test needed, this shouldn't result in any noticable difference
since the RSS parsing was disabled.
Review URL: http://codereview.chromium.org/100356
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15247 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/feed.h | 46 | ||||
-rw-r--r-- | webkit/glue/webframe.h | 5 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.cc | 63 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.h | 1 |
4 files changed, 0 insertions, 115 deletions
diff --git a/webkit/glue/feed.h b/webkit/glue/feed.h deleted file mode 100644 index e475c4a..0000000 --- a/webkit/glue/feed.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -#ifndef CHROME_COMMON_FEED_H_ -#define CHROME_COMMON_FEED_H_ - -#include <string> -#include <vector> - -#include "base/ref_counted.h" -#include "googleurl/src/gurl.h" - -struct FeedItem { - // The feed title. - std::wstring title; - // The feed type, for example: "application/rss+xml". The type can be blank. - std::wstring type; - // The URL to subscribe to the feed. - GURL url; -}; - -class FeedList : public base::RefCounted<FeedList> { - public: - // We limit the number of feeds that can be sent so that a rouge renderer - // doesn't cause excessive memory usage in the browser process by specifying - // a huge number of RSS feeds for the browser to parse. - static const size_t kMaxFeeds = 50; - - FeedList() {} - - void Add(const FeedItem &item) { - list_.push_back(item); - } - - const std::vector<FeedItem>& list() const { - return list_; - } - - private: - std::vector<FeedItem> list_; - - DISALLOW_COPY_AND_ASSIGN(FeedList); -}; - -#endif // CHROME_COMMON_FEED_H_ diff --git a/webkit/glue/webframe.h b/webkit/glue/webframe.h index 67a1013..e1495fa 100644 --- a/webkit/glue/webframe.h +++ b/webkit/glue/webframe.h @@ -9,7 +9,6 @@ #include "googleurl/src/gurl.h" #include "skia/ext/bitmap_platform_device.h" #include "skia/ext/platform_canvas.h" -#include "webkit/glue/feed.h" class WebAppCacheContext; class WebDataSource; @@ -146,10 +145,6 @@ class WebFrame { // Return the minPrefWidth of the content contained in the current Document virtual int GetContentsPreferredWidth() const = 0; - // Return the list of feeds specified in the document for the frame. If - // the page does not have a valid document, an empty list is returned. - virtual scoped_refptr<class FeedList> GetFeedList() const = 0; - // Returns the committed data source, which is the last data source that has // successfully started loading. Will return NULL if no provisional data // has been committed. diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 3b87d4f..d6b39fc 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -143,7 +143,6 @@ MSVC_POP_WARNING(); #include "webkit/glue/alt_error_page_resource_fetcher.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/dom_operations_private.h" -#include "webkit/glue/feed.h" #include "webkit/glue/glue_serialize.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/webappcachecontext.h" @@ -563,68 +562,6 @@ int WebFrameImpl::GetContentsPreferredWidth() const { } } -scoped_refptr<FeedList> WebFrameImpl::GetFeedList() const { - scoped_refptr<FeedList> feedlist = new FeedList(); - - WebCore::FrameLoader* frame_loader = frame_->loader(); - if (frame_loader->state() != WebCore::FrameStateComplete || - !frame_->document() || - !frame_->document()->head() || - frame_->tree()->parent()) - return feedlist; - - // We only consider HTML documents with <head> tags. - // (Interestingly, isHTMLDocument() returns false for some pages -- - // perhaps an XHTML thing? It doesn't really matter because head() is - // a method on Documents anyway.) - WebCore::HTMLHeadElement* head = frame_->document()->head(); - if (!head) - return feedlist; - - // Iterate through all children of the <head>, looking for feed links. - for (WebCore::Node* node = head->firstChild(); - node; node = node->nextSibling()) { - // Skip over all nodes except <link ...>. - if (!node->isHTMLElement()) - continue; - if (!static_cast<WebCore::Element*>(node)->hasLocalName("link")) - continue; - - const WebCore::HTMLLinkElement* link = - static_cast<WebCore::HTMLLinkElement*>(node); - - // Look at the 'rel' tag and see if we have a feed. - std::wstring rel = webkit_glue::StringToStdWString(link->rel()); - bool is_feed = false; - if (LowerCaseEqualsASCII(rel, "feed") || - LowerCaseEqualsASCII(rel, "feed alternate")) { - // rel="feed" or rel="alternate feed" always means this is a feed. - is_feed = true; - } else if (LowerCaseEqualsASCII(rel, "alternate")) { - // Otherwise, rel="alternate" may mean a feed if it has a certain mime - // type. - std::wstring link_type = webkit_glue::StringToStdWString(link->type()); - TrimWhitespace(link_type, TRIM_ALL, &link_type); - if (LowerCaseEqualsASCII(link_type, "application/atom+xml") || - LowerCaseEqualsASCII(link_type, "application/rss+xml")) { - is_feed = true; - } - } - - if (is_feed) { - FeedItem feedItem; - feedItem.title = webkit_glue::StringToStdWString(link->title()); - TrimWhitespace(feedItem.title, TRIM_ALL, &feedItem.title); - feedItem.type = webkit_glue::StringToStdWString(link->type()); - TrimWhitespace(feedItem.type, TRIM_ALL, &feedItem.type); - feedItem.url = webkit_glue::KURLToGURL(link->href()); - feedlist->Add(feedItem); - } - } - - return feedlist; -} - bool WebFrameImpl::GetPreviousHistoryState(std::string* history_state) const { // We use the previous item here because documentState (filled-out forms) // only get saved to history when it becomes the previous item. The caller diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index 61162f7..c3cbbb4 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -102,7 +102,6 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { virtual GURL GetFavIconURL() const; virtual GURL GetOSDDURL() const; virtual int GetContentsPreferredWidth() const; - virtual scoped_refptr<class FeedList> GetFeedList() const; virtual WebDataSource* GetDataSource() const; virtual WebDataSource* GetProvisionalDataSource() const; virtual void StopLoading(); |