| 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 "chrome/browser/browsing_data_local_storage_helper.h" | 5 #include "chrome/browser/browsing_data_local_storage_helper.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
| 10 #include "chrome/browser/in_process_webkit/webkit_context.h" | 10 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 ChromeThread::UI, FROM_HERE, | 89 ChromeThread::UI, FROM_HERE, |
| 90 NewRunnableMethod( | 90 NewRunnableMethod( |
| 91 this, &BrowsingDataLocalStorageHelper::NotifyInUIThread)); | 91 this, &BrowsingDataLocalStorageHelper::NotifyInUIThread)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void BrowsingDataLocalStorageHelper::NotifyInUIThread() { | 94 void BrowsingDataLocalStorageHelper::NotifyInUIThread() { |
| 95 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 95 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
| 96 DCHECK(is_fetching_); | 96 DCHECK(is_fetching_); |
| 97 // Note: completion_callback_ mutates only in the UI thread, so it's safe to | 97 // Note: completion_callback_ mutates only in the UI thread, so it's safe to |
| 98 // test it here. | 98 // test it here. |
| 99 if (completion_callback_ != NULL) | 99 if (completion_callback_ != NULL) { |
| 100 completion_callback_->Run(local_storage_info_); | 100 completion_callback_->Run(local_storage_info_); |
| 101 completion_callback_.reset(); |
| 102 } |
| 101 is_fetching_ = false; | 103 is_fetching_ = false; |
| 102 } | 104 } |
| 103 | 105 |
| 104 void BrowsingDataLocalStorageHelper::DeleteLocalStorageFileInWebKitThread( | 106 void BrowsingDataLocalStorageHelper::DeleteLocalStorageFileInWebKitThread( |
| 105 const FilePath& file_path) { | 107 const FilePath& file_path) { |
| 106 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); | 108 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); |
| 107 profile_->GetWebKitContext()->dom_storage_context()->DeleteLocalStorageFile( | 109 profile_->GetWebKitContext()->dom_storage_context()->DeleteLocalStorageFile( |
| 108 file_path); | 110 file_path); |
| 109 } | 111 } |
| OLD | NEW |