| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/renderer_webstoragenamespace_impl.h" | 5 #include "content/renderer/renderer_webstoragenamespace_impl.h" |
| 6 | 6 |
| 7 #include "content/renderer/render_thread.h" | 7 #include "content/renderer/render_thread.h" |
| 8 #include "content/renderer/renderer_webstoragearea_impl.h" | 8 #include "content/renderer/renderer_webstoragearea_impl.h" |
| 9 | 9 |
| 10 using WebKit::WebStorageArea; | 10 using WebKit::WebStorageArea; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 RendererWebStorageNamespaceImpl::~RendererWebStorageNamespaceImpl() { | 28 RendererWebStorageNamespaceImpl::~RendererWebStorageNamespaceImpl() { |
| 29 } | 29 } |
| 30 | 30 |
| 31 WebStorageArea* RendererWebStorageNamespaceImpl::createStorageArea( | 31 WebStorageArea* RendererWebStorageNamespaceImpl::createStorageArea( |
| 32 const WebString& origin) { | 32 const WebString& origin) { |
| 33 // Ideally, we'd keep a hash map of origin to these objects. Unfortunately | 33 // Ideally, we'd keep a hash map of origin to these objects. Unfortunately |
| 34 // this doesn't seem practical because there's no good way to ref-count these | 34 // this doesn't seem practical because there's no good way to ref-count these |
| 35 // objects, and it'd be unclear who owned them. So, instead, we'll pay the | 35 // objects, and it'd be unclear who owned them. So, instead, we'll pay the |
| 36 // price in terms of wasted memory. | 36 // price in terms of wasted memory. |
| 37 return new RendererWebStorageAreaImpl(namespace_id_, origin); | 37 return new RendererWebStorageAreaImpl(namespace_id_, origin, storage_type_); |
| 38 } | 38 } |
| 39 | 39 |
| 40 WebStorageNamespace* RendererWebStorageNamespaceImpl::copy() { | 40 WebStorageNamespace* RendererWebStorageNamespaceImpl::copy() { |
| 41 // By returning NULL, we're telling WebKit to lazily fetch it the next time | 41 // By returning NULL, we're telling WebKit to lazily fetch it the next time |
| 42 // session storage is used. In the WebViewClient::createView, we do the | 42 // session storage is used. In the WebViewClient::createView, we do the |
| 43 // book-keeping necessary to make it a true copy-on-write despite not doing | 43 // book-keeping necessary to make it a true copy-on-write despite not doing |
| 44 // anything here, now. | 44 // anything here, now. |
| 45 return NULL; | 45 return NULL; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void RendererWebStorageNamespaceImpl::close() { | 48 void RendererWebStorageNamespaceImpl::close() { |
| 49 // This is called only on LocalStorage namespaces when WebKit thinks its | 49 // This is called only on LocalStorage namespaces when WebKit thinks its |
| 50 // shutting down. This has no impact on Chromium. | 50 // shutting down. This has no impact on Chromium. |
| 51 } | 51 } |
| OLD | NEW |