Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: chrome/browser/extensions/extension_data_deleter.cc

Issue 10837230: Move StoragePartition into content/public and remove BrowserContext::GetDOMStorageContext(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style fixes. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/extensions/extension_data_deleter.h" 5 #include "chrome/browser/extensions/extension_data_deleter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/settings/settings_frontend.h" 10 #include "chrome/browser/extensions/settings/settings_frontend.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/common/chrome_constants.h" 12 #include "chrome/common/chrome_constants.h"
13 #include "chrome/common/extensions/extension.h" 13 #include "chrome/common/extensions/extension.h"
14 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
15 #include "content/public/browser/dom_storage_context.h" 15 #include "content/public/browser/dom_storage_context.h"
16 #include "content/public/browser/indexed_db_context.h" 16 #include "content/public/browser/indexed_db_context.h"
17 #include "content/public/browser/resource_context.h" 17 #include "content/public/browser/resource_context.h"
18 #include "content/public/browser/storage_partition.h"
18 #include "net/base/completion_callback.h" 19 #include "net/base/completion_callback.h"
19 #include "net/base/net_errors.h" 20 #include "net/base/net_errors.h"
20 #include "net/cookies/cookie_monster.h" 21 #include "net/cookies/cookie_monster.h"
21 #include "net/url_request/url_request_context.h" 22 #include "net/url_request/url_request_context.h"
22 #include "net/url_request/url_request_context_getter.h" 23 #include "net/url_request/url_request_context_getter.h"
23 #include "webkit/appcache/appcache_service.h" 24 #include "webkit/appcache/appcache_service.h"
24 #include "webkit/database/database_tracker.h" 25 #include "webkit/database/database_tracker.h"
25 #include "webkit/database/database_util.h" 26 #include "webkit/database/database_util.h"
26 #include "webkit/fileapi/file_system_context.h" 27 #include "webkit/fileapi/file_system_context.h"
27 28
(...skipping 13 matching lines...) Expand all
41 DCHECK(profile); 42 DCHECK(profile);
42 scoped_refptr<ExtensionDataDeleter> deleter = 43 scoped_refptr<ExtensionDataDeleter> deleter =
43 new ExtensionDataDeleter( 44 new ExtensionDataDeleter(
44 profile, extension_id, storage_origin, is_storage_isolated); 45 profile, extension_id, storage_origin, is_storage_isolated);
45 46
46 BrowserThread::PostTask( 47 BrowserThread::PostTask(
47 BrowserThread::IO, FROM_HERE, 48 BrowserThread::IO, FROM_HERE,
48 base::Bind( 49 base::Bind(
49 &ExtensionDataDeleter::DeleteCookiesOnIOThread, deleter)); 50 &ExtensionDataDeleter::DeleteCookiesOnIOThread, deleter));
50 51
51 BrowserContext::GetDefaultDOMStorageContext(profile)->DeleteOrigin( 52 content::BrowserContext::GetDefaultStoragePartition(profile)->
52 storage_origin); 53 GetDOMStorageContext()->DeleteOrigin(storage_origin);
53 54
54 BrowserThread::PostTask( 55 BrowserThread::PostTask(
55 BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, 56 BrowserThread::WEBKIT_DEPRECATED, FROM_HERE,
56 base::Bind( 57 base::Bind(
57 &ExtensionDataDeleter::DeleteIndexedDBOnWebkitThread, deleter, 58 &ExtensionDataDeleter::DeleteIndexedDBOnWebkitThread, deleter,
58 make_scoped_refptr(BrowserContext::GetIndexedDBContext(profile)))); 59 make_scoped_refptr(BrowserContext::GetIndexedDBContext(profile))));
59 60
60 BrowserThread::PostTask( 61 BrowserThread::PostTask(
61 BrowserThread::FILE, FROM_HERE, 62 BrowserThread::FILE, FROM_HERE,
62 base::Bind( 63 base::Bind(
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // See http://crbug.com/85127 138 // See http://crbug.com/85127
138 if (!isolated_app_path_.empty()) 139 if (!isolated_app_path_.empty())
139 file_util::Delete(isolated_app_path_, true); 140 file_util::Delete(isolated_app_path_, true);
140 } 141 }
141 142
142 void ExtensionDataDeleter::DeleteAppcachesOnIOThread(ResourceContext* context) { 143 void ExtensionDataDeleter::DeleteAppcachesOnIOThread(ResourceContext* context) {
143 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
144 ResourceContext::GetAppCacheService(context)->DeleteAppCachesForOrigin( 145 ResourceContext::GetAppCacheService(context)->DeleteAppCachesForOrigin(
145 storage_origin_, net::CompletionCallback()); 146 storage_origin_, net::CompletionCallback());
146 } 147 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698