| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebStorageNamespace_h | 31 #ifndef WebStorageNamespace_h |
| 32 #define WebStorageNamespace_h | 32 #define WebStorageNamespace_h |
| 33 | 33 |
| 34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class WebStorageArea; | 38 class WebStorageArea; |
| 39 class WebString; | 39 class WebSecurityOrigin; |
| 40 | 40 |
| 41 // WebStorageNamespace represents a collection of StorageAreas. Typically, | 41 // WebStorageNamespace represents a collection of StorageAreas. Typically, |
| 42 // you'll have multiple StorageNamespaces to represent the SessionStorage for | 42 // you'll have multiple StorageNamespaces to represent the SessionStorage for |
| 43 // each tab and a single StorageNamespace to represent LocalStorage for the | 43 // each tab and a single StorageNamespace to represent LocalStorage for the |
| 44 // entire browser. | 44 // entire browser. |
| 45 class WebStorageNamespace { | 45 class WebStorageNamespace { |
| 46 public: | 46 public: |
| 47 virtual ~WebStorageNamespace() {} | 47 virtual ~WebStorageNamespace() {} |
| 48 | 48 |
| 49 // Create a new WebStorageArea object. Two subsequent calls with the same | 49 // Create a new WebStorageArea object. Two subsequent calls with the same |
| 50 // origin will return two different WebStorageArea objects that share the same | 50 // origin will return two different WebStorageArea objects that share the same |
| 51 // backing store. You should call delete on the returned object when you're | 51 // backing store. You should call delete on the returned object when you're |
| 52 // finished. | 52 // finished. |
| 53 virtual WebStorageArea* createStorageArea(const WebString& origin) = 0; | 53 virtual WebStorageArea* createStorageArea(const WebSecurityOrigin&) = 0; |
| 54 | 54 |
| 55 // Returns true of the two instances represent the same storage namespace. | 55 // Returns true of the two instances represent the same storage namespace. |
| 56 virtual bool isSameNamespace(const WebStorageNamespace&) const { | 56 virtual bool isSameNamespace(const WebStorageNamespace&) const { |
| 57 return false; | 57 return false; |
| 58 } | 58 } |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace blink | 61 } // namespace blink |
| 62 | 62 |
| 63 #endif // WebStorageNamespace_h | 63 #endif // WebStorageNamespace_h |
| OLD | NEW |