| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/in_process_webkit/dom_storage_context.h" | 5 #include "content/browser/in_process_webkit/dom_storage_context.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 DOMStorageArea* DOMStorageContext::GetStorageArea(int64 id) { | 135 DOMStorageArea* DOMStorageContext::GetStorageArea(int64 id) { |
| 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); | 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
| 137 StorageAreaMap::iterator iter = storage_area_map_.find(id); | 137 StorageAreaMap::iterator iter = storage_area_map_.find(id); |
| 138 if (iter == storage_area_map_.end()) | 138 if (iter == storage_area_map_.end()) |
| 139 return NULL; | 139 return NULL; |
| 140 return iter->second; | 140 return iter->second; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void DOMStorageContext::DeleteSessionStorageNamespace(int64 namespace_id) { | 143 void DOMStorageContext::DeleteSessionStorageNamespace(int64 namespace_id) { |
| 144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); | 144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED) || |
| 145 !BrowserThread::IsMessageLoopValid(BrowserThread::WEBKIT_DEPRECATED)); |
| 145 StorageNamespaceMap::iterator iter = | 146 StorageNamespaceMap::iterator iter = |
| 146 storage_namespace_map_.find(namespace_id); | 147 storage_namespace_map_.find(namespace_id); |
| 147 if (iter == storage_namespace_map_.end()) | 148 if (iter == storage_namespace_map_.end()) |
| 148 return; | 149 return; |
| 149 DCHECK(iter->second->dom_storage_type() == DOM_STORAGE_SESSION); | 150 DCHECK(iter->second->dom_storage_type() == DOM_STORAGE_SESSION); |
| 150 delete iter->second; | 151 delete iter->second; |
| 151 storage_namespace_map_.erase(iter); | 152 storage_namespace_map_.erase(iter); |
| 152 } | 153 } |
| 153 | 154 |
| 154 DOMStorageNamespace* DOMStorageContext::GetStorageNamespace( | 155 DOMStorageNamespace* DOMStorageContext::GetStorageNamespace( |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 292 } |
| 292 | 293 |
| 293 FilePath DOMStorageContext::GetLocalStorageFilePath( | 294 FilePath DOMStorageContext::GetLocalStorageFilePath( |
| 294 const string16& origin_id) const { | 295 const string16& origin_id) const { |
| 295 FilePath storageDir = data_path_.Append( | 296 FilePath storageDir = data_path_.Append( |
| 296 DOMStorageContext::kLocalStorageDirectory); | 297 DOMStorageContext::kLocalStorageDirectory); |
| 297 FilePath::StringType id = | 298 FilePath::StringType id = |
| 298 webkit_glue::WebStringToFilePathString(origin_id); | 299 webkit_glue::WebStringToFilePathString(origin_id); |
| 299 return storageDir.Append(id.append(kLocalStorageExtension)); | 300 return storageDir.Append(id.append(kLocalStorageExtension)); |
| 300 } | 301 } |
| OLD | NEW |