[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 11:27:04 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 216da3bce1dc78794a7ea7eafbbf0f9a6ff8be53
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Jul 24 03:35:26 2010 +0000
2010-07-23 Kavita Kanetkar <kkanetkar at chromium.org>
Reviewed by Joseph Pecoraro.
Implement remaining Inspector support for chrome's appcache
https://bugs.webkit.org/show_bug.cgi?id=42426
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::getApplicationCaches):
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache):
(WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource):
* inspector/InspectorApplicationCacheAgent.h:
(WebCore::InspectorController::connectFrontend):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::fillResourceList):
(WebCore::ApplicationCacheHost::applicationCacheInfo):
* loader/appcache/ApplicationCacheHost.h: Changed creation + update times to double and moved appcache info here from InspectorApplicationCacheAgent.h
(WebCore::ApplicationCacheHost::CacheInfo::CacheInfo):
(WebCore::ApplicationCacheHost::ResourceInfo::ResourceInfo):
2010-07-23 Kavita Kanetkar <kkanetkar at chromium.org>
Reviewed by Joseph Pecoraro.
Implement remaining Inspector support for chrome's appcache
https://bugs.webkit.org/show_bug.cgi?id=42426
* src/ApplicationCacheHost.cpp: Plugging in chrome's appcache info.
(WebCore::ApplicationCacheHost::applicationCacheInfo):
(WebCore::ApplicationCacheHost::fillResourceList):
* src/js/InspectorControllerImpl.js:
(devtools.InspectorBackendImpl):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4d3b58d..4fa4efe 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-07-23 Kavita Kanetkar <kkanetkar at chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Implement remaining Inspector support for chrome's appcache
+ https://bugs.webkit.org/show_bug.cgi?id=42426
+
+ * inspector/InspectorApplicationCacheAgent.cpp:
+ (WebCore::InspectorApplicationCacheAgent::getApplicationCaches):
+ (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache):
+ (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
+ (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource):
+ * inspector/InspectorApplicationCacheAgent.h:
+ (WebCore::InspectorController::connectFrontend):
+ * loader/appcache/ApplicationCacheHost.cpp:
+ (WebCore::ApplicationCacheHost::fillResourceList):
+ (WebCore::ApplicationCacheHost::applicationCacheInfo):
+ * loader/appcache/ApplicationCacheHost.h: Changed creation + update times to double and moved appcache info here from InspectorApplicationCacheAgent.h
+ (WebCore::ApplicationCacheHost::CacheInfo::CacheInfo):
+ (WebCore::ApplicationCacheHost::ResourceInfo::ResourceInfo):
+
2010-07-23 Rafael Antognolli <antognolli at profusion.mobi>
Reviewed by Antonio Gomes.
diff --git a/WebCore/inspector/InspectorApplicationCacheAgent.cpp b/WebCore/inspector/InspectorApplicationCacheAgent.cpp
index 88238be..1ea7556 100644
--- a/WebCore/inspector/InspectorApplicationCacheAgent.cpp
+++ b/WebCore/inspector/InspectorApplicationCacheAgent.cpp
@@ -28,8 +28,7 @@
#if ENABLE(INSPECTOR) && ENABLE(OFFLINE_WEB_APPLICATIONS)
-#include "ApplicationCache.h"
-#include "ApplicationCacheResource.h"
+#include "ApplicationCacheHost.h"
#include "DocumentLoader.h"
#include "Frame.h"
#include "FrameLoader.h"
@@ -63,29 +62,6 @@ void InspectorApplicationCacheAgent::updateNetworkState(bool isNowOnline)
m_frontend->updateNetworkState(isNowOnline);
}
-void InspectorApplicationCacheAgent::fillResourceList(ApplicationCache* cache, ResourceInfoList* resources)
-{
-#if !PLATFORM(CHROMIUM)
- ASSERT(cache && cache->isComplete());
-#endif
- ApplicationCache::ResourceMap::const_iterator end = cache->end();
- for (ApplicationCache::ResourceMap::const_iterator it = cache->begin(); it != end; ++it) {
- RefPtr<ApplicationCacheResource> resource = it->second;
- unsigned type = resource->type();
- bool isMaster = type & ApplicationCacheResource::Master;
- bool isManifest = type & ApplicationCacheResource::Manifest;
- bool isExplicit = type & ApplicationCacheResource::Explicit;
- bool isForeign = type & ApplicationCacheResource::Foreign;
- bool isFallback = type & ApplicationCacheResource::Fallback;
-#if PLATFORM(CHROMIUM)
- int64_t estimatedSizeInStorage = 0;
-#else
- int64_t estimatedSizeInStorage = resource->estimatedSizeInStorage();
-#endif
- resources->append(InspectorApplicationCacheAgent::ResourceInfo(resource->url(), isMaster, isManifest, isFallback, isForeign, isExplicit, estimatedSizeInStorage));
- }
-}
-
void InspectorApplicationCacheAgent::getApplicationCaches(long callId)
{
DocumentLoader* documentLoader = m_inspectorController->inspectedPage()->mainFrame()->loader()->documentLoader();
@@ -95,25 +71,15 @@ void InspectorApplicationCacheAgent::getApplicationCaches(long callId)
}
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
- ApplicationCache* cache = host->applicationCacheForInspector();
- if (!cache
-#if !PLATFORM(CHROMIUM)
- || !cache->isComplete()
-#endif
- ) {
- m_frontend->didGetApplicationCaches(callId, ScriptValue::undefined());
- return;
- }
-
- // FIXME: Add "Creation Time" and "Update Time" to Application Caches.
- ApplicationCacheInfo info(cache->manifestResource()->url(), String(), String(), cache->estimatedSizeInStorage());
- ResourceInfoList resources;
- fillResourceList(cache, &resources);
+ ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
+
+ ApplicationCacheHost::ResourceInfoList resources;
+ host->fillResourceList(&resources);
m_frontend->didGetApplicationCaches(callId, buildObjectForApplicationCache(resources, info));
}
-ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ResourceInfoList& applicationCacheResources, const ApplicationCacheInfo& applicationCacheInfo)
+ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources, const ApplicationCacheHost::CacheInfo& applicationCacheInfo)
{
ScriptObject value = m_frontend->newScriptObject();
value.set("size", applicationCacheInfo.m_size);
@@ -125,19 +91,19 @@ ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCache(cons
return value;
}
-ScriptArray InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources(const ResourceInfoList& applicationCacheResources)
+ScriptArray InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources)
{
ScriptArray resources = m_frontend->newScriptArray();
- ResourceInfoList::const_iterator end = applicationCacheResources.end();
- ResourceInfoList::const_iterator it = applicationCacheResources.begin();
+ ApplicationCacheHost::ResourceInfoList::const_iterator end = applicationCacheResources.end();
+ ApplicationCacheHost::ResourceInfoList::const_iterator it = applicationCacheResources.begin();
for (int i = 0; it != end; ++it, i++)
resources.set(i, buildObjectForApplicationCacheResource(*it));
return resources;
}
-ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ResourceInfo& resourceInfo)
+ScriptObject InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo& resourceInfo)
{
ScriptObject value = m_frontend->newScriptObject();
value.set("name", resourceInfo.m_resource.string());
diff --git a/WebCore/inspector/InspectorApplicationCacheAgent.h b/WebCore/inspector/InspectorApplicationCacheAgent.h
index 79763f4..33cc2ed 100644
--- a/WebCore/inspector/InspectorApplicationCacheAgent.h
+++ b/WebCore/inspector/InspectorApplicationCacheAgent.h
@@ -28,13 +28,10 @@
#if ENABLE(INSPECTOR) && ENABLE(OFFLINE_WEB_APPLICATIONS)
#include "ApplicationCacheHost.h"
-#include "KURL.h"
-#include "PlatformString.h"
#include <wtf/Noncopyable.h>
namespace WebCore {
-class ApplicationCache;
class InspectorController;
class InspectorFrontend;
class ResourceResponse;
@@ -43,44 +40,6 @@ class ScriptObject;
class InspectorApplicationCacheAgent : public Noncopyable {
public:
- struct ApplicationCacheInfo {
- ApplicationCacheInfo(const KURL& manifest, const String& creationTime, const String& updateTime, long long size)
- : m_manifest(manifest)
- , m_creationTime(creationTime)
- , m_updateTime(updateTime)
- , m_size(size)
- {
- }
-
- KURL m_manifest;
- String m_creationTime;
- String m_updateTime;
- long long m_size;
- };
-
- struct ResourceInfo {
- ResourceInfo(const KURL& resource, bool isMaster, bool isManifest, bool isFallback, bool isForeign, bool isExplicit, long long size)
- : m_resource(resource)
- , m_isMaster(isMaster)
- , m_isManifest(isManifest)
- , m_isFallback(isFallback)
- , m_isForeign(isForeign)
- , m_isExplicit(isExplicit)
- , m_size(size)
- {
- }
-
- KURL m_resource;
- bool m_isMaster;
- bool m_isManifest;
- bool m_isFallback;
- bool m_isForeign;
- bool m_isExplicit;
- long long m_size;
- };
-
- typedef Vector<ResourceInfo> ResourceInfoList;
-
InspectorApplicationCacheAgent(InspectorController* inspectorController, InspectorFrontend* frontend);
~InspectorApplicationCacheAgent() { }
@@ -93,11 +52,9 @@ public:
void getApplicationCaches(long callId);
private:
- ScriptObject buildObjectForApplicationCache(const ResourceInfoList&, const ApplicationCacheInfo&);
- ScriptArray buildArrayForApplicationCacheResources(const ResourceInfoList&);
- ScriptObject buildObjectForApplicationCacheResource(const ResourceInfo&);
-
- void fillResourceList(ApplicationCache*, ResourceInfoList*);
+ ScriptObject buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationCacheHost::CacheInfo&);
+ ScriptArray buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList&);
+ ScriptObject buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&);
InspectorController* m_inspectorController;
InspectorFrontend* m_frontend;
diff --git a/WebCore/loader/appcache/ApplicationCacheHost.cpp b/WebCore/loader/appcache/ApplicationCacheHost.cpp
index f63de55..eca6861 100644
--- a/WebCore/loader/appcache/ApplicationCacheHost.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheHost.cpp
@@ -250,6 +250,37 @@ void ApplicationCacheHost::stopDeferringEvents()
m_defersEvents = false;
}
+#if ENABLE(INSPECTOR)
+void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources)
+{
+ ApplicationCache* cache = applicationCache();
+ if (!cache || !cache->isComplete())
+ return;
+
+ ApplicationCache::ResourceMap::const_iterator end = cache->end();
+ for (ApplicationCache::ResourceMap::const_iterator it = cache->begin(); it != end; ++it) {
+ RefPtr<ApplicationCacheResource> resource = it->second;
+ unsigned type = resource->type();
+ bool isMaster = type & ApplicationCacheResource::Master;
+ bool isManifest = type & ApplicationCacheResource::Manifest;
+ bool isExplicit = type & ApplicationCacheResource::Explicit;
+ bool isForeign = type & ApplicationCacheResource::Foreign;
+ bool isFallback = type & ApplicationCacheResource::Fallback;
+ resources->append(ResourceInfo(resource->url(), isMaster, isManifest, isFallback, isForeign, isExplicit, resource->estimatedSizeInStorage()));
+ }
+}
+
+ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo()
+{
+ ApplicationCache* cache = applicationCache();
+ if (!cache || !cache->isComplete())
+ return CacheInfo(KURL(), 0, 0, 0);
+
+ // FIXME: Add "Creation Time" and "Update Time" to Application Caches.
+ return CacheInfo(cache->manifestResource()->url(), 0, 0, cache->estimatedSizeInStorage());
+}
+#endif
+
void ApplicationCacheHost::dispatchDOMEvent(EventID id, int total, int done)
{
if (m_domApplicationCache) {
diff --git a/WebCore/loader/appcache/ApplicationCacheHost.h b/WebCore/loader/appcache/ApplicationCacheHost.h
index a5b55e9..c224172 100644
--- a/WebCore/loader/appcache/ApplicationCacheHost.h
+++ b/WebCore/loader/appcache/ApplicationCacheHost.h
@@ -33,6 +33,7 @@
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+#include "KURL.h"
#include <wtf/Deque.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -40,10 +41,8 @@
#include <wtf/Vector.h>
namespace WebCore {
- class ApplicationCache;
class DOMApplicationCache;
class DocumentLoader;
- class KURL;
class ResourceLoader;
class ResourceError;
class ResourceRequest;
@@ -52,6 +51,7 @@ namespace WebCore {
#if PLATFORM(CHROMIUM)
class ApplicationCacheHostInternal;
#else
+ class ApplicationCache;
class ApplicationCacheGroup;
class ApplicationCacheResource;
class ApplicationCacheStorage;
@@ -80,6 +80,40 @@ namespace WebCore {
OBSOLETE_EVENT // Must remain the last value, this is used to size arrays.
};
+#if ENABLE(INSPECTOR)
+ struct CacheInfo {
+ CacheInfo(const KURL& manifest, double creationTime, double updateTime, long long size)
+ : m_manifest(manifest)
+ , m_creationTime(creationTime)
+ , m_updateTime(updateTime)
+ , m_size(size) { }
+ KURL m_manifest;
+ double m_creationTime;
+ double m_updateTime;
+ long long m_size;
+ };
+
+ struct ResourceInfo {
+ ResourceInfo(const KURL& resource, bool isMaster, bool isManifest, bool isFallback, bool isForeign, bool isExplicit, long long size)
+ : m_resource(resource)
+ , m_isMaster(isMaster)
+ , m_isManifest(isManifest)
+ , m_isFallback(isFallback)
+ , m_isForeign(isForeign)
+ , m_isExplicit(isExplicit)
+ , m_size(size) { }
+ KURL m_resource;
+ bool m_isMaster;
+ bool m_isManifest;
+ bool m_isFallback;
+ bool m_isForeign;
+ bool m_isExplicit;
+ long long m_size;
+ };
+
+ typedef Vector<ResourceInfo> ResourceInfoList;
+#endif
+
ApplicationCacheHost(DocumentLoader*);
~ApplicationCacheHost();
@@ -112,7 +146,10 @@ namespace WebCore {
void stopDeferringEvents(); // Also raises the events that have been queued up.
- ApplicationCache* applicationCacheForInspector() const { return applicationCache(); }
+#if ENABLE(INSPECTOR)
+ void fillResourceList(ResourceInfoList*);
+ CacheInfo applicationCacheInfo();
+#endif
private:
bool isApplicationCacheEnabled();
@@ -135,7 +172,6 @@ namespace WebCore {
#if PLATFORM(CHROMIUM)
friend class ApplicationCacheHostInternal;
OwnPtr<ApplicationCacheHostInternal> m_internal;
- ApplicationCache* applicationCache() const { return 0; } // FIXME: Implement for Chromium Web Inspector Support.
#else
friend class ApplicationCacheGroup;
friend class ApplicationCacheStorage;
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index f3b31ae..9f695aa 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
+2010-07-23 Kavita Kanetkar <kkanetkar at chromium.org>
+
+ Reviewed by Joseph Pecoraro.
+
+ Implement remaining Inspector support for chrome's appcache
+ https://bugs.webkit.org/show_bug.cgi?id=42426
+
+ * src/ApplicationCacheHost.cpp: Plugging in chrome's appcache info.
+ (WebCore::ApplicationCacheHost::applicationCacheInfo):
+ (WebCore::ApplicationCacheHost::fillResourceList):
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+
2010-07-23 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Reviewed by Yury Semikhatsky.
diff --git a/WebKit/chromium/src/ApplicationCacheHost.cpp b/WebKit/chromium/src/ApplicationCacheHost.cpp
index b90126f..f76d174 100644
--- a/WebKit/chromium/src/ApplicationCacheHost.cpp
+++ b/WebKit/chromium/src/ApplicationCacheHost.cpp
@@ -37,11 +37,15 @@
#include "DocumentLoader.h"
#include "DOMApplicationCache.h"
#include "Frame.h"
+#include "InspectorApplicationCacheAgent.h"
+#include "InspectorController.h"
+#include "Page.h"
#include "ProgressEvent.h"
#include "Settings.h"
#include "WebURL.h"
#include "WebURLError.h"
#include "WebURLResponse.h"
+#include "WebVector.h"
#include "WrappedResourceRequest.h"
#include "WrappedResourceResponse.h"
@@ -206,6 +210,32 @@ void ApplicationCacheHost::notifyDOMApplicationCache(EventID id, int total, int
dispatchDOMEvent(id, total, done);
}
+#if ENABLE(INSPECTOR)
+ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo()
+{
+ if (!m_internal)
+ return CacheInfo(KURL(), 0, 0, 0);
+
+ WebKit::WebApplicationCacheHost::CacheInfo webInfo;
+ m_internal->m_outerHost->getAssociatedCacheInfo(&webInfo);
+ return CacheInfo(webInfo.manifestURL, webInfo.creationTime, webInfo.updateTime, webInfo.totalSize);
+}
+
+void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources)
+{
+ if (!m_internal)
+ return;
+
+ WebKit::WebVector<WebKit::WebApplicationCacheHost::ResourceInfo> webResources;
+ m_internal->m_outerHost->getResourceList(&webResources);
+ for (int i = 0; i < webResources.size(); ++i) {
+ resources->append(ResourceInfo(
+ webResources[i].url, webResources[i].isMaster, webResources[i].isManifest, webResources[i].isFallback,
+ webResources[i].isForeign, webResources[i].isExplicit, webResources[i].size));
+ }
+}
+#endif
+
void ApplicationCacheHost::stopDeferringEvents()
{
RefPtr<DocumentLoader> protect(documentLoader());
diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js
index bed009e..3ff902a 100644
--- a/WebKit/chromium/src/js/InspectorControllerImpl.js
+++ b/WebKit/chromium/src/js/InspectorControllerImpl.js
@@ -56,6 +56,7 @@ devtools.InspectorBackendImpl = function()
this.installInspectorControllerDelegate_("enableTimeline");
this.installInspectorControllerDelegate_("getChildNodes");
this.installInspectorControllerDelegate_("getCookies");
+ this.installInspectorControllerDelegate_("getApplicationCaches");
this.installInspectorControllerDelegate_("getDatabaseTableNames");
this.installInspectorControllerDelegate_("getDOMStorageEntries");
this.installInspectorControllerDelegate_("getEventListenersForNode");
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list