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

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

Issue 11147026: Initial refactor to get profiles to propagate storage partition details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed the order in the gypi file. Created 8 years, 2 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/data_deleter.h" 5 #include "chrome/browser/extensions/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/render_process_host.h"
18 #include "content/public/browser/site_instance.h"
17 #include "content/public/browser/storage_partition.h" 19 #include "content/public/browser/storage_partition.h"
18 #include "content/public/common/content_constants.h" 20 #include "content/public/common/content_constants.h"
19 #include "net/base/completion_callback.h" 21 #include "net/base/completion_callback.h"
20 #include "net/base/net_errors.h" 22 #include "net/base/net_errors.h"
21 #include "net/cookies/cookie_monster.h" 23 #include "net/cookies/cookie_monster.h"
22 #include "net/url_request/url_request_context.h" 24 #include "net/url_request/url_request_context.h"
23 #include "net/url_request/url_request_context_getter.h" 25 #include "net/url_request/url_request_context_getter.h"
24 #include "webkit/appcache/appcache_service.h" 26 #include "webkit/appcache/appcache_service.h"
25 #include "webkit/database/database_tracker.h" 27 #include "webkit/database/database_tracker.h"
26 #include "webkit/database/database_util.h" 28 #include "webkit/database/database_util.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // http://crbug.com/85127 87 // http://crbug.com/85127
86 database_tracker_ = BrowserContext::GetDefaultStoragePartition(profile)-> 88 database_tracker_ = BrowserContext::GetDefaultStoragePartition(profile)->
87 GetDatabaseTracker(); 89 GetDatabaseTracker();
88 // Pick the right request context depending on whether it's an extension, 90 // Pick the right request context depending on whether it's an extension,
89 // isolated app, or regular app. 91 // isolated app, or regular app.
90 content::StoragePartition* storage_partition = 92 content::StoragePartition* storage_partition =
91 BrowserContext::GetDefaultStoragePartition(profile); 93 BrowserContext::GetDefaultStoragePartition(profile);
92 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { 94 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) {
93 extension_request_context_ = profile->GetRequestContextForExtensions(); 95 extension_request_context_ = profile->GetRequestContextForExtensions();
94 } else if (is_storage_isolated) { 96 } else if (is_storage_isolated) {
95 extension_request_context_ = 97 GURL url = Extension::GetBaseURLFromExtensionId(extension_id);
awong 2012/10/29 23:37:40 const GURL&
nasko 2012/10/30 00:32:59 Done.
96 profile->GetRequestContextForStoragePartition(extension_id); 98 content::StoragePartition* storage_partition =
97 isolated_app_path_ = 99 BrowserContext::GetStoragePartitionForSite(profile, url);
98 profile->GetPath().Append( 100 extension_request_context_ = storage_partition->GetURLRequestContext();
awong 2012/10/29 23:37:40 Add a TODO for me here will ya? I think this code
nasko 2012/10/30 00:32:59 Done.
99 content::StoragePartition::GetPartitionPath(extension_id)); 101 isolated_app_path_ = storage_partition->GetPath();
100 } else { 102 } else {
101 extension_request_context_ = profile->GetRequestContext(); 103 extension_request_context_ = profile->GetRequestContext();
102 } 104 }
103 file_system_context_ = storage_partition->GetFileSystemContext(); 105 file_system_context_ = storage_partition->GetFileSystemContext();
104 indexed_db_context_ = storage_partition->GetIndexedDBContext(); 106 indexed_db_context_ = storage_partition->GetIndexedDBContext();
105 107
106 storage_origin_ = storage_origin; 108 storage_origin_ = storage_origin;
107 origin_id_ = 109 origin_id_ =
108 webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_); 110 webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_);
109 } 111 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 147 }
146 148
147 void DataDeleter::DeleteAppcachesOnIOThread( 149 void DataDeleter::DeleteAppcachesOnIOThread(
148 appcache::AppCacheService* appcache_service) { 150 appcache::AppCacheService* appcache_service) {
149 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
150 appcache_service->DeleteAppCachesForOrigin(storage_origin_, 152 appcache_service->DeleteAppCachesForOrigin(storage_origin_,
151 net::CompletionCallback()); 153 net::CompletionCallback());
152 } 154 }
153 155
154 } // namespace extensions 156 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698