| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // WebStorageNamespace represents a collection of StorageAreas. Typically, you'll have | 40 // WebStorageNamespace represents a collection of StorageAreas. Typically, you'll have |
| 41 // multiple StorageNamespaces to represent the SessionStorage for each tab and a single | 41 // multiple StorageNamespaces to represent the SessionStorage for each tab and a single |
| 42 // StorageNamespace to represent LocalStorage for the entire browser. | 42 // StorageNamespace to represent LocalStorage for the entire browser. |
| 43 class WebStorageNamespace { | 43 class WebStorageNamespace { |
| 44 public: | 44 public: |
| 45 // Create a new WebStorageNamespace. LocalStorageNamespaces require a path to specify | 45 // Create a new WebStorageNamespace. LocalStorageNamespaces require a path to specify |
| 46 // where the SQLite databases that make LocalStorage data persistent are located. | 46 // where the SQLite databases that make LocalStorage data persistent are located. |
| 47 // If path is empty, data will not persist. You should call delete on the returned | 47 // If path is empty, data will not persist. You should call delete on the returned |
| 48 // object when you're finished. | 48 // object when you're finished. |
| 49 WEBKIT_API static WebStorageNamespace* createLocalStorageNamespace(const WebString& backingDirectoryPath); | 49 WEBKIT_API static WebStorageNamespace* createLocalStorageNamespace(const WebString& backingDirectoryPath, unsigned quota); |
| 50 WEBKIT_API static WebStorageNamespace* createSessionStorageNamespace(); | 50 WEBKIT_API static WebStorageNamespace* createSessionStorageNamespace(); |
| 51 | 51 |
| 52 static const unsigned noQuota = UINT_MAX; |
| 53 |
| 52 virtual ~WebStorageNamespace() { } | 54 virtual ~WebStorageNamespace() { } |
| 53 | 55 |
| 54 // Create a new WebStorageArea object. Two subsequent calls with the same origin | 56 // Create a new WebStorageArea object. Two subsequent calls with the same origin |
| 55 // will return two different WebStorageArea objects that share the same backing store. | 57 // will return two different WebStorageArea objects that share the same backing store. |
| 56 // You should call delete on the returned object when you're finished. | 58 // You should call delete on the returned object when you're finished. |
| 57 virtual WebStorageArea* createStorageArea(const WebString& origin) = 0; | 59 virtual WebStorageArea* createStorageArea(const WebString& origin) = 0; |
| 58 | 60 |
| 59 // Copy a StorageNamespace. This only makes sense in the case of SessionStorage. | 61 // Copy a StorageNamespace. This only makes sense in the case of SessionStorage. |
| 60 virtual WebStorageNamespace* copy() = 0; | 62 virtual WebStorageNamespace* copy() = 0; |
| 61 | 63 |
| 62 // Shutdown the StorageNamespace. Write all StorageArea's to disk and disallow new | 64 // Shutdown the StorageNamespace. Write all StorageArea's to disk and disallow new |
| 63 // write activity. | 65 // write activity. |
| 64 virtual void close() = 0; | 66 virtual void close() = 0; |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 } // namespace WebKit | 69 } // namespace WebKit |
| 68 | 70 |
| 69 #endif // WebStorageNamespace_h | 71 #endif // WebStorageNamespace_h |
| OLD | NEW |