| 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" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "content/browser/in_process_webkit/dom_storage_area.h" | 13 #include "content/browser/in_process_webkit/dom_storage_area.h" |
| 14 #include "content/browser/in_process_webkit/dom_storage_namespace.h" | 14 #include "content/browser/in_process_webkit/dom_storage_namespace.h" |
| 15 #include "content/browser/in_process_webkit/webkit_context.h" | 15 #include "content/browser/in_process_webkit/webkit_context.h" |
| 16 #include "content/common/dom_storage_common.h" | 16 #include "content/common/dom_storage_common.h" |
| 17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
| 20 #include "webkit/glue/webkit_glue.h" | 20 #include "webkit/glue/webkit_glue.h" |
| 21 #include "webkit/quota/special_storage_policy.h" | 21 #include "webkit/quota/special_storage_policy.h" |
| 22 | 22 |
| 23 using content::BrowserThread; |
| 24 |
| 23 using WebKit::WebSecurityOrigin; | 25 using WebKit::WebSecurityOrigin; |
| 24 | 26 |
| 25 namespace { | 27 namespace { |
| 26 | 28 |
| 27 void ClearLocalState(const FilePath& domstorage_path, | 29 void ClearLocalState(const FilePath& domstorage_path, |
| 28 quota::SpecialStoragePolicy* special_storage_policy) { | 30 quota::SpecialStoragePolicy* special_storage_policy) { |
| 29 file_util::FileEnumerator file_enumerator( | 31 file_util::FileEnumerator file_enumerator( |
| 30 domstorage_path, false, file_util::FileEnumerator::FILES); | 32 domstorage_path, false, file_util::FileEnumerator::FILES); |
| 31 for (FilePath file_path = file_enumerator.Next(); !file_path.empty(); | 33 for (FilePath file_path = file_enumerator.Next(); !file_path.empty(); |
| 32 file_path = file_enumerator.Next()) { | 34 file_path = file_enumerator.Next()) { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 296 } |
| 295 | 297 |
| 296 FilePath DOMStorageContext::GetLocalStorageFilePath( | 298 FilePath DOMStorageContext::GetLocalStorageFilePath( |
| 297 const string16& origin_id) const { | 299 const string16& origin_id) const { |
| 298 FilePath storageDir = data_path_.Append( | 300 FilePath storageDir = data_path_.Append( |
| 299 DOMStorageContext::kLocalStorageDirectory); | 301 DOMStorageContext::kLocalStorageDirectory); |
| 300 FilePath::StringType id = | 302 FilePath::StringType id = |
| 301 webkit_glue::WebStringToFilePathString(origin_id); | 303 webkit_glue::WebStringToFilePathString(origin_id); |
| 302 return storageDir.Append(id.append(kLocalStorageExtension)); | 304 return storageDir.Append(id.append(kLocalStorageExtension)); |
| 303 } | 305 } |
| OLD | NEW |