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 24 matching lines...) Expand all Loading... |
35 #include "modules/ModulesExport.h" | 35 #include "modules/ModulesExport.h" |
36 #include "platform/Supplementable.h" | 36 #include "platform/Supplementable.h" |
37 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
38 #include "public/platform/WebStorageQuotaType.h" | 38 #include "public/platform/WebStorageQuotaType.h" |
39 #include "wtf/Forward.h" | 39 #include "wtf/Forward.h" |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class ExecutionContext; | 43 class ExecutionContext; |
44 class Page; | 44 class Page; |
45 class ScriptPromise; | |
46 class ScriptState; | |
47 class StorageErrorCallback; | 45 class StorageErrorCallback; |
48 class StorageQuotaCallback; | 46 class StorageQuotaCallback; |
49 | 47 |
50 class StorageQuotaClient : public Supplement<Page> { | 48 class StorageQuotaClient : public Supplement<Page> { |
51 WTF_MAKE_NONCOPYABLE(StorageQuotaClient); | 49 WTF_MAKE_NONCOPYABLE(StorageQuotaClient); |
52 | 50 |
53 public: | 51 public: |
54 StorageQuotaClient() {} | 52 StorageQuotaClient() {} |
55 virtual ~StorageQuotaClient() {} | 53 virtual ~StorageQuotaClient() {} |
56 | 54 |
57 virtual void requestQuota(ScriptState*, | 55 virtual void requestQuota(ScriptState*, |
58 WebStorageQuotaType, | 56 WebStorageQuotaType, |
59 unsigned long long newQuotaInBytes, | 57 unsigned long long newQuotaInBytes, |
60 StorageQuotaCallback*, | 58 StorageQuotaCallback*, |
61 StorageErrorCallback*) = 0; | 59 StorageErrorCallback*) = 0; |
62 virtual ScriptPromise requestPersistentQuota( | |
63 ScriptState*, | |
64 unsigned long long newQuotaInBytes) = 0; | |
65 | 60 |
66 static const char* supplementName(); | 61 static const char* supplementName(); |
67 static StorageQuotaClient* from(ExecutionContext*); | 62 static StorageQuotaClient* from(ExecutionContext*); |
68 }; | 63 }; |
69 | 64 |
70 MODULES_EXPORT void provideStorageQuotaClientTo(Page&, StorageQuotaClient*); | 65 MODULES_EXPORT void provideStorageQuotaClientTo(Page&, StorageQuotaClient*); |
71 | 66 |
72 } // namespace blink | 67 } // namespace blink |
73 | 68 |
74 #endif // StorageQuotaClient_h | 69 #endif // StorageQuotaClient_h |
OLD | NEW |