Chromium Code Reviews| 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/pepper_flash_settings_manager.h" | 5 #include "chrome/browser/pepper_flash_settings_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 uint64 flags; | 118 uint64 flags; |
| 119 uint64 max_age; | 119 uint64 max_age; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 virtual ~Core(); | 122 virtual ~Core(); |
| 123 | 123 |
| 124 void ConnectToChannel(bool success, const IPC::ChannelHandle& handle); | 124 void ConnectToChannel(bool success, const IPC::ChannelHandle& handle); |
| 125 | 125 |
| 126 void InitializeOnIOThread(); | 126 void InitializeOnIOThread(); |
| 127 void DeauthorizeContentLicensesOnIOThread(uint32 request_id); | 127 void DeauthorizeContentLicensesOnIOThread(uint32 request_id); |
| 128 void DeauthorizeContentLicensesOnBlockingPool( | |
| 129 uint32 request_id, | |
| 130 const base::FilePath& profile_path); | |
| 131 void DeauthorizeContentLicensesInPlugin(uint32 request_id, bool success); | 128 void DeauthorizeContentLicensesInPlugin(uint32 request_id, bool success); |
| 132 void GetPermissionSettingsOnIOThread( | 129 void GetPermissionSettingsOnIOThread( |
| 133 uint32 request_id, | 130 uint32 request_id, |
| 134 PP_Flash_BrowserOperations_SettingType setting_type); | 131 PP_Flash_BrowserOperations_SettingType setting_type); |
| 135 void SetDefaultPermissionOnIOThread( | 132 void SetDefaultPermissionOnIOThread( |
| 136 uint32 request_id, | 133 uint32 request_id, |
| 137 PP_Flash_BrowserOperations_SettingType setting_type, | 134 PP_Flash_BrowserOperations_SettingType setting_type, |
| 138 PP_Flash_BrowserOperations_Permission permission, | 135 PP_Flash_BrowserOperations_Permission permission, |
| 139 bool clear_site_specific); | 136 bool clear_site_specific); |
| 140 void SetSitePermissionOnIOThread( | 137 void SetSitePermissionOnIOThread( |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 return; | 431 return; |
| 435 } | 432 } |
| 436 | 433 |
| 437 pending_responses_.insert( | 434 pending_responses_.insert( |
| 438 std::make_pair(request_id, DEAUTHORIZE_CONTENT_LICENSES)); | 435 std::make_pair(request_id, DEAUTHORIZE_CONTENT_LICENSES)); |
| 439 if (state_ == STATE_ERROR) { | 436 if (state_ == STATE_ERROR) { |
| 440 NotifyErrorFromIOThread(); | 437 NotifyErrorFromIOThread(); |
| 441 return; | 438 return; |
| 442 } | 439 } |
| 443 | 440 |
| 444 #if defined(OS_CHROMEOS) | |
| 445 BrowserThread::PostBlockingPoolTask(FROM_HERE, | |
| 446 base::Bind(&Core::DeauthorizeContentLicensesOnBlockingPool, this, | |
| 447 request_id, browser_context_path_)); | |
| 448 #else | |
| 449 DeauthorizeContentLicensesInPlugin(request_id, true); | 441 DeauthorizeContentLicensesInPlugin(request_id, true); |
| 450 #endif | |
| 451 } | |
| 452 | |
| 453 // TODO(raymes): This is temporary code to migrate ChromeOS devices to the new | |
| 454 // scheme for generating device IDs. Delete this once we are sure most ChromeOS | |
| 455 // devices have been migrated. | |
|
raymes
2013/09/16 22:13:38
Again, I think we need to keep this.
| |
| 456 void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesOnBlockingPool( | |
| 457 uint32 request_id, | |
| 458 const base::FilePath& profile_path) { | |
| 459 // ChromeOS used to store the device ID in a file but this is no longer used. | |
| 460 // Wipe that file. | |
| 461 const base::FilePath& device_id_path = | |
| 462 chrome::DeviceIDFetcher::GetLegacyDeviceIDPath(profile_path); | |
| 463 bool success = base::DeleteFile(device_id_path, false); | |
| 464 | |
| 465 BrowserThread::PostTask( | |
| 466 BrowserThread::IO, FROM_HERE, | |
| 467 base::Bind(&Core::DeauthorizeContentLicensesInPlugin, this, request_id, | |
| 468 success)); | |
| 469 } | 442 } |
| 470 | 443 |
| 471 void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesInPlugin( | 444 void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesInPlugin( |
| 472 uint32 request_id, | 445 uint32 request_id, |
| 473 bool success) { | 446 bool success) { |
| 474 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 447 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 475 if (!success) { | 448 if (!success) { |
| 476 NotifyErrorFromIOThread(); | 449 NotifyErrorFromIOThread(); |
| 477 return; | 450 return; |
| 478 } | 451 } |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1062 } | 1035 } |
| 1063 | 1036 |
| 1064 void PepperFlashSettingsManager::OnError(Core* core) { | 1037 void PepperFlashSettingsManager::OnError(Core* core) { |
| 1065 DCHECK(core); | 1038 DCHECK(core); |
| 1066 if (core != core_.get()) | 1039 if (core != core_.get()) |
| 1067 return; | 1040 return; |
| 1068 | 1041 |
| 1069 core_->Detach(); | 1042 core_->Detach(); |
| 1070 core_ = NULL; | 1043 core_ = NULL; |
| 1071 } | 1044 } |
| OLD | NEW |