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

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

Issue 123733003: Get ride of chrome.storage.* data when removing an application. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "chrome/browser/ui/webui/favicon_source.h" 54 #include "chrome/browser/ui/webui/favicon_source.h"
55 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" 55 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h"
56 #include "chrome/browser/ui/webui/theme_source.h" 56 #include "chrome/browser/ui/webui/theme_source.h"
57 #include "chrome/common/chrome_switches.h" 57 #include "chrome/common/chrome_switches.h"
58 #include "chrome/common/crash_keys.h" 58 #include "chrome/common/crash_keys.h"
59 #include "chrome/common/extensions/extension_constants.h" 59 #include "chrome/common/extensions/extension_constants.h"
60 #include "chrome/common/extensions/extension_file_util.h" 60 #include "chrome/common/extensions/extension_file_util.h"
61 #include "chrome/common/extensions/extension_messages.h" 61 #include "chrome/common/extensions/extension_messages.h"
62 #include "chrome/common/extensions/features/feature_channel.h" 62 #include "chrome/common/extensions/features/feature_channel.h"
63 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" 63 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h"
64 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
65 #include "chrome/common/extensions/manifest_url_handler.h" 64 #include "chrome/common/extensions/manifest_url_handler.h"
66 #include "chrome/common/pref_names.h" 65 #include "chrome/common/pref_names.h"
67 #include "chrome/common/url_constants.h" 66 #include "chrome/common/url_constants.h"
68 #include "components/startup_metric_utils/startup_metric_utils.h" 67 #include "components/startup_metric_utils/startup_metric_utils.h"
69 #include "content/public/browser/browser_thread.h" 68 #include "content/public/browser/browser_thread.h"
70 #include "content/public/browser/devtools_agent_host.h" 69 #include "content/public/browser/devtools_agent_host.h"
71 #include "content/public/browser/notification_service.h" 70 #include "content/public/browser/notification_service.h"
72 #include "content/public/browser/notification_types.h" 71 #include "content/public/browser/notification_types.h"
73 #include "content/public/browser/render_process_host.h" 72 #include "content/public/browser/render_process_host.h"
74 #include "content/public/browser/site_instance.h" 73 #include "content/public/browser/site_instance.h"
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 if (!Manifest::IsUnpackedLocation(extension->location())) { 835 if (!Manifest::IsUnpackedLocation(extension->location())) {
837 if (!GetFileTaskRunner()->PostTask( 836 if (!GetFileTaskRunner()->PostTask(
838 FROM_HERE, 837 FROM_HERE,
839 base::Bind( 838 base::Bind(
840 &extension_file_util::UninstallExtension, 839 &extension_file_util::UninstallExtension,
841 install_directory_, 840 install_directory_,
842 extension_id))) 841 extension_id)))
843 NOTREACHED(); 842 NOTREACHED();
844 } 843 }
845 844
846 GURL launch_web_url_origin( 845 extensions::DataDeleter::StartDeleting(profile_, extension.get());
847 extensions::AppLaunchInfo::GetLaunchWebURL(extension.get()).GetOrigin());
848 bool is_storage_isolated =
849 extensions::AppIsolationInfo::HasIsolatedStorage(extension.get());
850
851 if (is_storage_isolated) {
852 BrowserContext::AsyncObliterateStoragePartition(
853 profile_,
854 GetSiteForExtensionId(extension_id),
855 base::Bind(&ExtensionService::OnNeedsToGarbageCollectIsolatedStorage,
856 AsWeakPtr()));
857 } else {
858 if (extension->is_hosted_app() &&
859 !profile_->GetExtensionSpecialStoragePolicy()->
860 IsStorageProtected(launch_web_url_origin)) {
861 extensions::DataDeleter::StartDeleting(
862 profile_, extension_id, launch_web_url_origin);
863 }
864 extensions::DataDeleter::StartDeleting(profile_, extension_id,
865 extension->url());
866 }
867 846
868 UntrackTerminatedExtension(extension_id); 847 UntrackTerminatedExtension(extension_id);
869 848
870 // Notify interested parties that we've uninstalled this extension. 849 // Notify interested parties that we've uninstalled this extension.
871 content::NotificationService::current()->Notify( 850 content::NotificationService::current()->Notify(
872 chrome::NOTIFICATION_EXTENSION_UNINSTALLED, 851 chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
873 content::Source<Profile>(profile_), 852 content::Source<Profile>(profile_),
874 content::Details<const Extension>(extension.get())); 853 content::Details<const Extension>(extension.get()));
875 854
876 if (extension_sync_service_) { 855 if (extension_sync_service_) {
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2838 void ExtensionService::UnloadAllExtensionsInternal() { 2817 void ExtensionService::UnloadAllExtensionsInternal() {
2839 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); 2818 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions();
2840 2819
2841 registry_->ClearAll(); 2820 registry_->ClearAll();
2842 extension_runtime_data_.clear(); 2821 extension_runtime_data_.clear();
2843 2822
2844 // TODO(erikkay) should there be a notification for this? We can't use 2823 // TODO(erikkay) should there be a notification for this? We can't use
2845 // EXTENSION_UNLOADED since that implies that the extension has been disabled 2824 // EXTENSION_UNLOADED since that implies that the extension has been disabled
2846 // or uninstalled. 2825 // or uninstalled.
2847 } 2826 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698