| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebBlobRegistry_h | 31 #ifndef WebBlobRegistry_h |
| 32 #define WebBlobRegistry_h | 32 #define WebBlobRegistry_h |
| 33 | 33 |
| 34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
| 35 #include "WebThreadSafeData.h" | 35 #include "WebThreadSafeData.h" |
| 36 | 36 |
| 37 #include <memory> | 37 #include <memory> |
| 38 | 38 |
| 39 namespace base { |
| 40 class SingleThreadTaskRunner; |
| 41 } |
| 42 |
| 39 namespace blink { | 43 namespace blink { |
| 40 | 44 |
| 41 class WebBlobData; | 45 class WebBlobData; |
| 42 class WebString; | 46 class WebString; |
| 43 class WebURL; | 47 class WebURL; |
| 44 | 48 |
| 45 // Acts as singleton facade for all Blob interactions ouside of blink. This | 49 // Acts as singleton facade for all Blob interactions ouside of blink. This |
| 46 // includes blob: | 50 // includes blob: |
| 47 // * creation, | 51 // * creation, |
| 48 // * reference counting, | 52 // * reference counting, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 75 uint64_t length, | 79 uint64_t length, |
| 76 double expected_modification_time) = 0; | 80 double expected_modification_time) = 0; |
| 77 | 81 |
| 78 // Builds the blob. All calls to append* are invalid after calling this | 82 // Builds the blob. All calls to append* are invalid after calling this |
| 79 // method. | 83 // method. |
| 80 virtual void Build() = 0; | 84 virtual void Build() = 0; |
| 81 }; | 85 }; |
| 82 | 86 |
| 83 virtual ~WebBlobRegistry() {} | 87 virtual ~WebBlobRegistry() {} |
| 84 | 88 |
| 89 virtual base::SingleThreadTaskRunner* GetIORunner() { return nullptr; } |
| 90 |
| 85 // TODO(dmurph): Deprecate and migrate to createBuilder | 91 // TODO(dmurph): Deprecate and migrate to createBuilder |
| 86 virtual void RegisterBlobData(const WebString& uuid, const WebBlobData&) {} | 92 virtual void RegisterBlobData(const WebString& uuid, const WebBlobData&) {} |
| 87 | 93 |
| 88 // The blob is finalized (and sent to the browser) on calling build() on the | 94 // The blob is finalized (and sent to the browser) on calling build() on the |
| 89 // Builder object. | 95 // Builder object. |
| 90 virtual std::unique_ptr<Builder> CreateBuilder( | 96 virtual std::unique_ptr<Builder> CreateBuilder( |
| 91 const WebString& uuid, | 97 const WebString& uuid, |
| 92 const WebString& content_type) = 0; | 98 const WebString& content_type) = 0; |
| 93 | 99 |
| 94 virtual void AddBlobDataRef(const WebString& uuid) {} | 100 virtual void AddBlobDataRef(const WebString& uuid) {} |
| (...skipping 25 matching lines...) Expand all Loading... |
| 120 // so it won't receive any more data. | 126 // so it won't receive any more data. |
| 121 virtual void AbortStream(const WebURL&) = 0; | 127 virtual void AbortStream(const WebURL&) = 0; |
| 122 | 128 |
| 123 // Unregisters a stream referred by the URL. | 129 // Unregisters a stream referred by the URL. |
| 124 virtual void UnregisterStreamURL(const WebURL&) = 0; | 130 virtual void UnregisterStreamURL(const WebURL&) = 0; |
| 125 }; | 131 }; |
| 126 | 132 |
| 127 } // namespace blink | 133 } // namespace blink |
| 128 | 134 |
| 129 #endif // WebBlobRegistry_h | 135 #endif // WebBlobRegistry_h |
| OLD | NEW |