summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 18:15:01 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 18:15:01 +0000
commit751cef05106cef2269e2d2e2383b6627f4b20318 (patch)
treee2937cea1b816a9dd998a24a539ffea03b375d27 /webkit
parent08fb74a9f12f59c531cc5d7acdb0afea183dba12 (diff)
downloadchromium_src-751cef05106cef2269e2d2e2383b6627f4b20318.zip
chromium_src-751cef05106cef2269e2d2e2383b6627f4b20318.tar.gz
chromium_src-751cef05106cef2269e2d2e2383b6627f4b20318.tar.bz2
Reverting 11640.
Reverting for now. Will try again later git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11645 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/feed.h46
-rw-r--r--webkit/glue/webframe.h5
-rw-r--r--webkit/glue/webframe_impl.cc63
-rw-r--r--webkit/glue/webframe_impl.h1
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 571b281..d35376e 100644
--- a/webkit/glue/webframe.h
+++ b/webkit/glue/webframe.h
@@ -9,7 +9,6 @@
#include "skia/ext/bitmap_platform_device.h"
#include "skia/ext/platform_canvas.h"
#include "webkit/glue/console_message_level.h"
-#include "webkit/glue/feed.h"
#include "webkit/glue/find_in_page_request.h"
class GURL;
@@ -130,10 +129,6 @@ class WebFrame {
// the page does not have a valid document, an empty GURL is returned.
virtual GURL GetOSDDURL() 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 62b27a8..4f71ec3 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -135,7 +135,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/webdatasource_impl.h"
@@ -486,68 +485,6 @@ GURL WebFrameImpl::GetOSDDURL() const {
return GURL();
}
-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 e49802f..ed7ee15 100644
--- a/webkit/glue/webframe_impl.h
+++ b/webkit/glue/webframe_impl.h
@@ -99,7 +99,6 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> {
virtual GURL GetURL() const;
virtual GURL GetFavIconURL() const;
virtual GURL GetOSDDURL() const;
- virtual scoped_refptr<class FeedList> GetFeedList() const;
virtual WebDataSource* GetDataSource() const;
virtual WebDataSource* GetProvisionalDataSource() const;
virtual void StopLoading();