diff options
author | battre <battre@chromium.org> | 2015-07-20 09:18:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-20 16:18:55 +0000 |
commit | ed26a546f567abb17a2134a459b21e776e5be655 (patch) | |
tree | eda35ab4a56f4c17e89569f61201468dad6c52ef | |
parent | 36dfc41d09e5183895f2eb759962bea469aca73a (diff) | |
download | chromium_src-ed26a546f567abb17a2134a459b21e776e5be655.zip chromium_src-ed26a546f567abb17a2134a459b21e776e5be655.tar.gz chromium_src-ed26a546f567abb17a2134a459b21e776e5be655.tar.bz2 |
Clear WebRTC Identity if the user clears their cookies.
BUG=510850
TEST=Go to http://webrtc.github.io/samples/src/content/peerconnection/create-offer/ and verify that the fingerprint changes after clearing cookies.
Review URL: https://codereview.chromium.org/1242503006
Cr-Commit-Position: refs/heads/master@{#339454}
4 files changed, 21 insertions, 7 deletions
diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc index 9f644d6..2bfa38c 100644 --- a/chrome/browser/browsing_data/browsing_data_remover.cc +++ b/chrome/browser/browsing_data/browsing_data_remover.cc @@ -656,6 +656,11 @@ void BrowsingDataRemover::RemoveImpl(int remove_mask, #endif } + if (remove_mask & REMOVE_WEBRTC_IDENTITY) { + storage_partition_remove_mask |= + content::StoragePartition::REMOVE_DATA_MASK_WEBRTC_IDENTITY; + } + if (storage_partition_remove_mask) { waiting_for_clear_storage_partition_data_ = true; diff --git a/chrome/browser/browsing_data/browsing_data_remover.h b/chrome/browser/browsing_data/browsing_data_remover.h index b052bfc..255b5b4 100644 --- a/chrome/browser/browsing_data/browsing_data_remover.h +++ b/chrome/browser/browsing_data/browsing_data_remover.h @@ -79,6 +79,7 @@ class BrowsingDataRemover // REMOVE_NOCHECKS intentionally does not check if the Profile's prohibited // from deleting history or downloads. REMOVE_NOCHECKS = 1 << 16, + REMOVE_WEBRTC_IDENTITY = 1 << 17, // The following flag is used only in tests. In normal usage, hosted app // data is controlled by the REMOVE_COOKIES flag, applied to the // protected-web origin. @@ -93,7 +94,8 @@ class BrowsingDataRemover REMOVE_SERVICE_WORKERS | REMOVE_WEBSQL | REMOVE_CHANNEL_IDS | - REMOVE_SITE_USAGE_DATA, + REMOVE_SITE_USAGE_DATA | + REMOVE_WEBRTC_IDENTITY, // Includes all the available remove options. Meant to be used by clients // that wish to wipe as much data as possible from a Profile, to make it diff --git a/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc b/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc index d38a7db..049d8b7 100644 --- a/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc +++ b/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc @@ -72,8 +72,10 @@ int MaskForKey(const char* key) { return BrowsingDataRemover::REMOVE_APPCACHE; if (strcmp(key, extension_browsing_data_api_constants::kCacheKey) == 0) return BrowsingDataRemover::REMOVE_CACHE; - if (strcmp(key, extension_browsing_data_api_constants::kCookiesKey) == 0) - return BrowsingDataRemover::REMOVE_COOKIES; + if (strcmp(key, extension_browsing_data_api_constants::kCookiesKey) == 0) { + return BrowsingDataRemover::REMOVE_COOKIES | + BrowsingDataRemover::REMOVE_WEBRTC_IDENTITY; + } if (strcmp(key, extension_browsing_data_api_constants::kDownloadsKey) == 0) return BrowsingDataRemover::REMOVE_DOWNLOADS; if (strcmp(key, extension_browsing_data_api_constants::kFileSystemsKey) == 0) @@ -391,7 +393,8 @@ int BrowsingDataRemoveCacheFunction::GetRemovalMask() { int BrowsingDataRemoveCookiesFunction::GetRemovalMask() { return BrowsingDataRemover::REMOVE_COOKIES | - BrowsingDataRemover::REMOVE_CHANNEL_IDS; + BrowsingDataRemover::REMOVE_CHANNEL_IDS | + BrowsingDataRemover::REMOVE_WEBRTC_IDENTITY; } int BrowsingDataRemoveDownloadsFunction::GetRemovalMask() { diff --git a/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc b/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc index b82cc13..44c4843 100644 --- a/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc +++ b/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc @@ -207,7 +207,8 @@ class ExtensionBrowsingDataTest : public InProcessBrowserTest { GetAsMask(data_to_remove, "cache", BrowsingDataRemover::REMOVE_CACHE) | GetAsMask(data_to_remove, "cookies", - BrowsingDataRemover::REMOVE_COOKIES) | + BrowsingDataRemover::REMOVE_COOKIES | + BrowsingDataRemover::REMOVE_WEBRTC_IDENTITY) | GetAsMask(data_to_remove, "downloads", BrowsingDataRemover::REMOVE_DOWNLOADS) | GetAsMask(data_to_remove, "fileSystems", @@ -357,7 +358,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, RunBrowsingDataRemoveWithKeyAndCompareRemovalMask( "cache", BrowsingDataRemover::REMOVE_CACHE); RunBrowsingDataRemoveWithKeyAndCompareRemovalMask( - "cookies", BrowsingDataRemover::REMOVE_COOKIES); + "cookies", BrowsingDataRemover::REMOVE_COOKIES | + BrowsingDataRemover::REMOVE_WEBRTC_IDENTITY); RunBrowsingDataRemoveWithKeyAndCompareRemovalMask( "downloads", BrowsingDataRemover::REMOVE_DOWNLOADS); RunBrowsingDataRemoveWithKeyAndCompareRemovalMask( @@ -389,6 +391,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, "{\"appcache\": true, \"cookies\": true, \"history\": true}", BrowsingDataRemover::REMOVE_APPCACHE | BrowsingDataRemover::REMOVE_COOKIES | + BrowsingDataRemover::REMOVE_WEBRTC_IDENTITY | BrowsingDataRemover::REMOVE_HISTORY); } @@ -444,7 +447,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, ShortcutFunctionRemovalMask) { BrowsingDataRemover::REMOVE_CACHE); RunAndCompareRemovalMask<BrowsingDataRemoveCookiesFunction>( BrowsingDataRemover::REMOVE_COOKIES | - BrowsingDataRemover::REMOVE_CHANNEL_IDS); + BrowsingDataRemover::REMOVE_CHANNEL_IDS | + BrowsingDataRemover::REMOVE_WEBRTC_IDENTITY); RunAndCompareRemovalMask<BrowsingDataRemoveDownloadsFunction>( BrowsingDataRemover::REMOVE_DOWNLOADS); RunAndCompareRemovalMask<BrowsingDataRemoveFileSystemsFunction>( |