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

Unified Diff: html/HTMLHtmlElement.cpp

Issue 113554: For local review prior to sending to webkit (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: '' Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « html/HTMLHtmlElement.h ('k') | loader/FrameLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: html/HTMLHtmlElement.cpp
===================================================================
--- html/HTMLHtmlElement.cpp (revision 44202)
+++ html/HTMLHtmlElement.cpp (working copy)
@@ -23,14 +23,49 @@
#include "config.h"
#include "HTMLHtmlElement.h"
-#include "ApplicationCacheGroup.h"
#include "Document.h"
#include "HTMLNames.h"
+// FIXME: The use of these two flags to should be a temporary situation.
+// Eventually we should use ENABLE(APPLICATION_CACHE) for this feature in
+// all cases.
+#if ENABLE(OFFLINE_WEB_APPLICATIONS) && ENABLE(APPLICATION_CACHE)
+#error APPLICATION_CACHE and OFFLINE_WEB_APPLICATIONS are mutually exclusive flags
+#endif
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+#include "ApplicationCacheGroup.h"
+#elif ENABLE(APPLICATION_CACHE)
+#include "Frame.h"
+#include "FrameLoader.h"
+#endif
+
namespace WebCore {
using namespace HTMLNames;
+#if ENABLE(OFFLINE_WEB_APPLICATIONS) || ENABLE(APPLICATION_CACHE)
+
+static void selectCacheWithoutManifest(Frame* frame)
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ ApplicationCacheGroup::selectCacheWithoutManifestURL(frame);
+#elif ENABLE(APPLICATION_CACHE)
+ frame->loader()->selectApplicationCacheWithoutManifest();
+#endif
+}
+
+static void selectCacheWithManifest(Frame* frame, const KURL& manifestURL)
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ ApplicationCacheGroup::selectCache(frame, manifestURL);
+#elif ENABLE(APPLICATION_CACHE)
+ frame->loader()->selectApplicationCacheWithManifest(manifestURL);
+#endif
+}
+
+#endif // ENABLE(OFFLINE_WEB_APPLICATIONS) || ENABLE(APPLICATION_CACHE)
+
HTMLHtmlElement::HTMLHtmlElement(const QualifiedName& tagName, Document* doc)
: HTMLElement(tagName, doc)
{
@@ -57,7 +92,7 @@
newChild->hasTagName(framesetTag) || newChild->hasTagName(noframesTag);
}
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+#if ENABLE(OFFLINE_WEB_APPLICATIONS) || ENABLE(APPLICATION_CACHE)
void HTMLHtmlElement::insertedIntoDocument()
{
HTMLElement::insertedIntoDocument();
@@ -70,10 +105,10 @@
// Check the manifest attribute
AtomicString manifest = getAttribute(manifestAttr);
- if (manifest.isNull())
- ApplicationCacheGroup::selectCacheWithoutManifestURL(document()->frame());
+ if (manifest.isNull() || manifest.isEmpty())
+ selectCacheWithoutManifest(document()->frame());
else
- ApplicationCacheGroup::selectCache(document()->frame(), document()->completeURL(manifest));
+ selectCacheWithManifest(document()->frame(), document()->completeURL(manifest));
}
#endif
« no previous file with comments | « html/HTMLHtmlElement.h ('k') | loader/FrameLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698