Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 10 matching lines...) Expand all Loading... | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef StorageQuotaClientImpl_h | 31 #ifndef WebScheduler_h |
| 32 #define StorageQuotaClientImpl_h | 32 #define WebScheduler_h |
| 33 | 33 |
| 34 #include "modules/quota/StorageQuotaClient.h" | 34 #include "WebThread.h" |
| 35 #include "wtf/Forward.h" | 35 |
| 36 namespace WebCore { | |
| 37 class Scheduler; | |
| 38 } | |
| 36 | 39 |
| 37 namespace blink { | 40 namespace blink { |
| 38 | 41 |
| 39 class StorageQuotaClientImpl : public NoBaseWillBeGarbageCollectedFinalized<Stor ageQuotaClientImpl>, public WebCore::StorageQuotaClient { | 42 class WebScheduler { |
| 40 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StorageQuotaClientImpl); | |
| 41 public: | 43 public: |
| 42 static PassOwnPtrWillBeRawPtr<StorageQuotaClientImpl> create(); | 44 BLINK_PLATFORM_EXPORT ~WebScheduler(); |
| 43 | 45 |
| 44 virtual ~StorageQuotaClientImpl(); | 46 BLINK_PLATFORM_EXPORT static WebScheduler create(); |
| 45 | 47 |
| 46 virtual void requestQuota(WebCore::ExecutionContext*, WebStorageQuotaType, u nsigned long long newQuotaInBytes, PassOwnPtr<WebCore::StorageQuotaCallback>, Pa ssOwnPtr<WebCore::StorageErrorCallback>) OVERRIDE; | 48 // Schedule a generic task to be run on the blink main thread. Takes |
| 47 virtual WebCore::ScriptPromise requestPersistentQuota(WebCore::ScriptState*, unsigned long long newQuotaInBytes) OVERRIDE; | 49 // ownership of |Task|. Can be called from any thread. |
| 50 BLINK_PLATFORM_EXPORT void postTask(WebThread::Task*); | |
| 48 | 51 |
| 49 virtual void trace(WebCore::Visitor* visitor) OVERRIDE { WebCore::StorageQuo taClient::trace(visitor); } | 52 // Schedule an input processing task to be run on the blink main thread. |
| 53 // Takes ownership of |Task|. Can be called from any thread. | |
| 54 BLINK_PLATFORM_EXPORT void postInputTask(WebThread::Task*); | |
| 55 | |
| 56 // Schedule a compositor task to run on the blink main thread. Takes | |
| 57 // ownership of |Task|. Can be called from any thread. | |
| 58 // TODO: Use WebFrameTime. | |
| 59 BLINK_PLATFORM_EXPORT void postCompositorTask(WebThread::Task*); | |
| 60 | |
| 61 // Schedule a BeginFrame task to run on the blink main thread. Takes | |
| 62 // ownership of |Task|. Can be called from any thread. Will maintain | |
| 63 // oredering with other compositor tasks. | |
| 64 // TODO: Use WebFrameTime. | |
| 65 BLINK_PLATFORM_EXPORT void postBeginFrameTask(WebThread::Task*, double frame Time, double deadline, double interval); | |
|
mithro-old
2014/07/08 10:38:11
If I understand correctly (which I'm never sure wi
| |
| 50 | 66 |
| 51 private: | 67 private: |
| 52 StorageQuotaClientImpl(); | 68 WebScheduler(); |
| 69 | |
| 70 WebCore::Scheduler* m_scheduler; | |
| 53 }; | 71 }; |
| 54 | 72 |
| 55 } // namespace blink | 73 } // namespace blink |
| 56 | 74 |
| 57 #endif // StorageQuotaClientImpl_h | 75 #endif // WebScheduler_h |
| OLD | NEW |