2008-03-21 Kevin McCullough <kmccullough@apple.com>
authorkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2008 21:05:50 +0000 (21:05 +0000)
committerkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2008 21:05:50 +0000 (21:05 +0000)
        Reviewed by Sam.

        -<rdar://problem/5712804> XMLHttpRequests do not show response contents, preview images (14313)
        -<rdar://problem/5712931> XMLHttpRequests should be shown separately and grouped (14315)
        -<rdar://problem/5732836> XMLHttpRequest: Inspector should show network activity/XHR in Console (17233)
        - Instrument the InspectorController to cache XHR resrouces since they are not cached by WebCore.
        The resources will be kept in the same map as all other resources so they will have the exact
        same lifecycle.

        * ChangeLog:
        * page/InspectorController.cpp:
        (WebCore::InspectorCachedXMLHttpRequestResource::type):
        (WebCore::InspectorCachedXMLHttpRequestResource::setType):
        (WebCore::InspectorCachedXMLHttpRequestResource::data):
        (WebCore::InspectorCachedXMLHttpRequestResource::setData):
        (WebCore::InspectorCachedXMLHttpRequestResource::encoding):
        (WebCore::InspectorCachedXMLHttpRequestResource::setEncoding):
        (WebCore::InspectorCachedXMLHttpRequestResource::create):
        (WebCore::InspectorCachedXMLHttpRequestResource::InspectorCachedXMLHttpRequestResource):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::send):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31218 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/InspectorController.cpp

index 2c04ab3..5ffc761 100644 (file)
@@ -1,3 +1,27 @@
+2008-03-21  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by Sam.
+
+        -<rdar://problem/5712804> XMLHttpRequests do not show response contents, preview images (14313)
+        -<rdar://problem/5712931> XMLHttpRequests should be shown separately and grouped (14315)
+        -<rdar://problem/5732836> XMLHttpRequest: Inspector should show network activity/XHR in Console (17233)
+        - Instrument the InspectorController to cache XHR resrouces since they are not cached by WebCore.
+        The resources will be kept in the same map as all other resources so they will have the exact
+        same lifecycle. 
+
+        * ChangeLog:
+        * page/InspectorController.cpp:
+        (WebCore::InspectorCachedXMLHttpRequestResource::type):
+        (WebCore::InspectorCachedXMLHttpRequestResource::setType):
+        (WebCore::InspectorCachedXMLHttpRequestResource::data):
+        (WebCore::InspectorCachedXMLHttpRequestResource::setData):
+        (WebCore::InspectorCachedXMLHttpRequestResource::encoding):
+        (WebCore::InspectorCachedXMLHttpRequestResource::setEncoding):
+        (WebCore::InspectorCachedXMLHttpRequestResource::create):
+        (WebCore::InspectorCachedXMLHttpRequestResource::InspectorCachedXMLHttpRequestResource):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::send):
+
 2008-03-21  Rodney Dawes  <dobey@wayofthemonkey.com>
 
         Reviewed by Holger.
index cc8c9dc..2c458cc 100644 (file)
@@ -120,12 +120,12 @@ struct InspectorResource : public RefCounted<InspectorResource> {
         return adoptRef(new InspectorResource(identifier, documentLoader, frame));
     }
     
-    ~InspectorResource()
+    virtual ~InspectorResource()
     {
         setScriptObject(0, 0);
     }
 
-    Type type() const
+    virtual Type type() const
     {
         if (requestURL == loader->requestURL())
             return Doc;
@@ -186,8 +186,8 @@ struct InspectorResource : public RefCounted<InspectorResource> {
     double startTime;
     double responseReceivedTime;
     double endTime;
-    
-private:
+
+protected:
     InspectorResource(long long identifier, DocumentLoader* documentLoader, Frame* frame)
         : identifier(identifier)
         , loader(documentLoader)
@@ -208,6 +208,37 @@ private:
 };
 
 #pragma mark -
+#pragma mark InspectorCachedXMLHttpRequestResource Class
+
+struct InspectorCachedXMLHttpRequestResource : public InspectorResource {
+
+    static PassRefPtr<InspectorResource> create(long long identifier, DocumentLoader* documentLoader, Frame* frame)
+    {
+        return adoptRef(new InspectorCachedXMLHttpRequestResource(identifier, documentLoader, frame));
+    }
+
+    virtual Type type() const { return m_type; }
+    void setType(Type type) { m_type = type; }
+
+    SharedBuffer* data() const { return m_data.get(); }
+    void setData(SharedBuffer* data) { m_data = data; }
+
+    String encoding() const { return m_encoding; }
+    void setEncoding(String encoding) { m_encoding = encoding; }
+    
+private:
+    InspectorCachedXMLHttpRequestResource(long long identifier, DocumentLoader* documentLoader, Frame* frame)
+        : InspectorResource(identifier, documentLoader, frame)
+    {
+    }
+
+    Type m_type;
+    String m_encoding;
+    RefPtr<SharedBuffer> m_data;
+};
+
+
+#pragma mark -
 #pragma mark InspectorDatabaseResource Struct
 
 #if ENABLE(DATABASE)