Title: [109360] trunk/Source/WebCore
Revision
109360
Author
[email protected]
Date
2012-03-01 10:06:06 -0800 (Thu, 01 Mar 2012)

Log Message

        Some trivial file stream cleanup
        https://bugs.webkit.org/show_bug.cgi?id=79955

        Reviewed by Sam Weinig.

        No change in functionality.

        * fileapi/FileStreamProxy.cpp: Tweaked comment, and added copyright for earlier changes.

        * fileapi/FileStreamProxy.h: Added a FIXME telling that this should be in platform.

        * platform/AsyncFileStream.h: Tweaked includes and added a FIXME about this to stop being
        a subclass.

        * platform/FileStreamClient.h: Removed obvious comments, and added ones explaing in-band
        error signals.

        * platform/network/BlobResourceHandle.cpp: Removed an include outside of platform, and an
        unused constant.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (109359 => 109360)


--- trunk/Source/WebCore/ChangeLog	2012-03-01 18:05:45 UTC (rev 109359)
+++ trunk/Source/WebCore/ChangeLog	2012-03-01 18:06:06 UTC (rev 109360)
@@ -1,3 +1,25 @@
+2012-03-01  Alexey Proskuryakov  <[email protected]>
+
+        Some trivial file stream cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=79955
+
+        Reviewed by Sam Weinig.
+
+        No change in functionality.
+
+        * fileapi/FileStreamProxy.cpp: Tweaked comment, and added copyright for earlier changes.
+
+        * fileapi/FileStreamProxy.h: Added a FIXME telling that this should be in platform.
+
+        * platform/AsyncFileStream.h: Tweaked includes and added a FIXME about this to stop being
+        a subclass.
+
+        * platform/FileStreamClient.h: Removed obvious comments, and added ones explaing in-band
+        error signals.
+
+        * platform/network/BlobResourceHandle.cpp: Removed an include outside of platform, and an
+        unused constant.
+
 2012-03-01  Shinya Kawanaka  <[email protected]>
 
         Appending ShadowRoot into an element should not cause crash.

Modified: trunk/Source/WebCore/fileapi/FileStreamProxy.cpp (109359 => 109360)


--- trunk/Source/WebCore/fileapi/FileStreamProxy.cpp	2012-03-01 18:05:45 UTC (rev 109359)
+++ trunk/Source/WebCore/fileapi/FileStreamProxy.cpp	2012-03-01 18:06:06 UTC (rev 109360)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Google Inc.  All rights reserved.
+ * Copyright (C) 2012 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -37,6 +38,7 @@
 #include "Blob.h"
 #include "CrossThreadTask.h"
 #include "FileStream.h"
+#include "FileStreamClient.h"
 #include "FileThread.h"
 #include "FileThreadTask.h"
 #include "PlatformString.h"
@@ -55,7 +57,7 @@
 {
     RefPtr<FileStreamProxy> proxy = adoptRef(new FileStreamProxy(context, client));
 
-    // Hold an ref so that the instance will not get deleted while there are tasks on the file thread.
+    // Hold a reference so that the instance will not get deleted while there are tasks on the file thread.
     // This is balanced by the deref in derefProxyOnContext below.
     proxy->ref();
 

Modified: trunk/Source/WebCore/fileapi/FileStreamProxy.h (109359 => 109360)


--- trunk/Source/WebCore/fileapi/FileStreamProxy.h	2012-03-01 18:05:45 UTC (rev 109359)
+++ trunk/Source/WebCore/fileapi/FileStreamProxy.h	2012-03-01 18:06:06 UTC (rev 109360)
@@ -48,6 +48,7 @@
 class ScriptExecutionContext;
 
 // A proxy module that asynchronously calls corresponding FileStream methods on the file thread.  Note: you must call stop() first and then release the reference to destruct the FileStreamProxy instance.
+// FIXME: Logically, this class is part of platform. ScriptExecutionContext is what keeps it outside for now.
 class FileStreamProxy : public AsyncFileStream {
 public:
     static PassRefPtr<FileStreamProxy> create(ScriptExecutionContext*, FileStreamClient*);
@@ -61,7 +62,7 @@
     virtual void write(const KURL& blobURL, long long position, int length);
     virtual void truncate(long long position);
 
-    // Stops the proxy and scedules it to be destructed.  All the pending tasks will be aborted and the file stream will be closed.
+    // Stops the proxy and schedules it to be destructed. All the pending tasks will be aborted and the file stream will be closed.
     // Note: the caller should deref the instance immediately after calling stop().
     virtual void stop();
 

Modified: trunk/Source/WebCore/platform/AsyncFileStream.h (109359 => 109360)


--- trunk/Source/WebCore/platform/AsyncFileStream.h	2012-03-01 18:05:45 UTC (rev 109359)
+++ trunk/Source/WebCore/platform/AsyncFileStream.h	2012-03-01 18:06:06 UTC (rev 109360)
@@ -33,14 +33,15 @@
 
 #if ENABLE(BLOB) || ENABLE(FILE_SYSTEM)
 
-#include "FileStreamClient.h"
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
 
+class FileStreamClient;
 class KURL;
 
+// FIXME: This should be merged with the only derived class (FileStreamProxy) once RunLoop is abstracted away in platform.
 class AsyncFileStream : public RefCounted<AsyncFileStream> {
 public:
     virtual ~AsyncFileStream() { }

Modified: trunk/Source/WebCore/platform/FileStreamClient.h (109359 => 109360)


--- trunk/Source/WebCore/platform/FileStreamClient.h	2012-03-01 18:05:45 UTC (rev 109359)
+++ trunk/Source/WebCore/platform/FileStreamClient.h	2012-03-01 18:06:06 UTC (rev 109360)
@@ -37,21 +37,16 @@
 
 class FileStreamClient {
 public:
-    // For reading.
-    virtual void didRead(int) { }
+    virtual void didOpen(bool) { } // false signals failure.
+    virtual void didStop() { }
+    virtual void didGetSize(long long) { } // -1 signals failure.
+    virtual void didRead(int) { } // -1 signals failure.
+    virtual void didWrite(int) { } // -1 signals failure.
+    virtual void didTruncate(bool) { } // false signals failure.
 
-    // For writing.
-    virtual void didWrite(int) { }
-    virtual void didTruncate(bool) { }
-
     // FIXME: To be removed when we switch to using BlobData.
     virtual void didStart() { }
 
-    // For both reading and writing.
-    virtual void didOpen(bool) { }
-    virtual void didStop() { }
-    virtual void didGetSize(long long) { }
-
 protected:
     virtual ~FileStreamClient() { }
 };

Modified: trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp (109359 => 109360)


--- trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp	2012-03-01 18:05:45 UTC (rev 109359)
+++ trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp	2012-03-01 18:06:06 UTC (rev 109360)
@@ -35,13 +35,13 @@
 #include "BlobResourceHandle.h"
 
 #include "AsyncFileStream.h"
-#include "BlobRegistryImpl.h"
+#include "BlobStorageData.h"
 #include "FileStream.h"
 #include "FileSystem.h"
 #include "HTTPParsers.h"
 #include "KURL.h"
 #include "ResourceError.h"
-#include "ResourceLoader.h"
+#include "ResourceHandleClient.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
 #include <wtf/MainThread.h>
@@ -49,7 +49,6 @@
 namespace WebCore {
 
 static const unsigned bufferSize = 1024;
-static const int maxVectorLength = 0x7fffffff;
 static const long long positionNotSpecified = -1;
 
 static const int httpOK = 200;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to