OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/browsing_data_helper.h" | 9 #include "chrome/browser/browsing_data_helper.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
12 #include "content/public/browser/dom_storage_context.h" | 12 #include "content/public/browser/dom_storage_context.h" |
13 | 13 |
14 using content::BrowserContext; | 14 using content::BrowserContext; |
15 using content::BrowserThread; | 15 using content::BrowserThread; |
16 using content::DOMStorageContext; | 16 using content::DOMStorageContext; |
17 using dom_storage::DomStorageContext; | 17 using dom_storage::DomStorageContext; |
18 | 18 |
19 BrowsingDataLocalStorageHelper::LocalStorageInfo::LocalStorageInfo( | 19 BrowsingDataLocalStorageHelper::LocalStorageInfo::LocalStorageInfo( |
20 const GURL& origin_url, int64 size, base::Time last_modified) | 20 const GURL& origin_url, int64 size, base::Time last_modified) |
21 : origin_url(origin_url), size(size), last_modified(last_modified) {} | 21 : origin_url(origin_url), size(size), last_modified(last_modified) {} |
22 | 22 |
23 BrowsingDataLocalStorageHelper::LocalStorageInfo::~LocalStorageInfo() {} | 23 BrowsingDataLocalStorageHelper::LocalStorageInfo::~LocalStorageInfo() {} |
24 | 24 |
25 BrowsingDataLocalStorageHelper::BrowsingDataLocalStorageHelper( | 25 BrowsingDataLocalStorageHelper::BrowsingDataLocalStorageHelper( |
26 Profile* profile) | 26 Profile* profile) |
27 : dom_storage_context_(BrowserContext::GetDOMStorageContext(profile)), | 27 : dom_storage_context_( |
| 28 BrowserContext::GetDefaultDOMStorageContext(profile)), |
28 is_fetching_(false) { | 29 is_fetching_(false) { |
29 DCHECK(dom_storage_context_); | 30 DCHECK(dom_storage_context_); |
30 } | 31 } |
31 | 32 |
32 BrowsingDataLocalStorageHelper::~BrowsingDataLocalStorageHelper() { | 33 BrowsingDataLocalStorageHelper::~BrowsingDataLocalStorageHelper() { |
33 } | 34 } |
34 | 35 |
35 void BrowsingDataLocalStorageHelper::StartFetching( | 36 void BrowsingDataLocalStorageHelper::StartFetching( |
36 const base::Callback<void(const std::list<LocalStorageInfo>&)>& callback) { | 37 const base::Callback<void(const std::list<LocalStorageInfo>&)>& callback) { |
37 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 for (std::set<GURL>::iterator iter = pending_local_storage_info_.begin(); | 141 for (std::set<GURL>::iterator iter = pending_local_storage_info_.begin(); |
141 iter != pending_local_storage_info_.end(); ++iter) { | 142 iter != pending_local_storage_info_.end(); ++iter) { |
142 local_storage_info_.push_back( | 143 local_storage_info_.push_back( |
143 LocalStorageInfo(*iter, 0, base::Time())); | 144 LocalStorageInfo(*iter, 0, base::Time())); |
144 } | 145 } |
145 MessageLoop::current()->PostTask( | 146 MessageLoop::current()->PostTask( |
146 FROM_HERE, | 147 FROM_HERE, |
147 base::Bind(&CannedBrowsingDataLocalStorageHelper::CallCompletionCallback, | 148 base::Bind(&CannedBrowsingDataLocalStorageHelper::CallCompletionCallback, |
148 this)); | 149 this)); |
149 } | 150 } |
OLD | NEW |