| 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 "content/browser/storage_partition_impl.h" | 5 #include "content/browser/storage_partition_impl.h" |
| 6 | 6 |
| 7 #include "base/sequenced_task_runner.h" | 7 #include "base/sequenced_task_runner.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/browser/browser_main_loop.h" | 9 #include "content/browser/browser_main_loop.h" |
| 10 #include "content/browser/fileapi/browser_file_system_helper.h" | 10 #include "content/browser/fileapi/browser_file_system_helper.h" |
| 11 #include "content/browser/gpu/shader_disk_cache.h" | 11 #include "content/browser/gpu/shader_disk_cache.h" |
| 12 #include "content/browser/net/cookie_store_map.h" |
| 12 #include "content/common/dom_storage/dom_storage_types.h" | 13 #include "content/common/dom_storage/dom_storage_types.h" |
| 13 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
| 14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/dom_storage_context.h" | 16 #include "content/public/browser/dom_storage_context.h" |
| 16 #include "content/public/browser/indexed_db_context.h" | 17 #include "content/public/browser/indexed_db_context.h" |
| 17 #include "content/public/browser/local_storage_usage_info.h" | 18 #include "content/public/browser/local_storage_usage_info.h" |
| 18 #include "content/public/browser/session_storage_usage_info.h" | 19 #include "content/public/browser/session_storage_usage_info.h" |
| 20 #include "content/public/common/url_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/browser/database/database_tracker.h" | 26 #include "webkit/browser/database/database_tracker.h" |
| 25 #include "webkit/browser/quota/quota_manager.h" | 27 #include "webkit/browser/quota/quota_manager.h" |
| 26 | 28 |
| 27 namespace content { | 29 namespace content { |
| 28 | 30 |
| 29 namespace { | 31 namespace { |
| 30 | 32 |
| 31 int GenerateQuotaClientMask(uint32 remove_mask) { | 33 int GenerateQuotaClientMask(uint32 remove_mask) { |
| 32 int quota_client_mask = 0; | 34 int quota_client_mask = 0; |
| 33 | 35 |
| 34 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS) | 36 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS) |
| 35 quota_client_mask |= quota::QuotaClient::kFileSystem; | 37 quota_client_mask |= quota::QuotaClient::kFileSystem; |
| 36 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_WEBSQL) | 38 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_WEBSQL) |
| 37 quota_client_mask |= quota::QuotaClient::kDatabase; | 39 quota_client_mask |= quota::QuotaClient::kDatabase; |
| 38 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_APPCACHE) | 40 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_APPCACHE) |
| 39 quota_client_mask |= quota::QuotaClient::kAppcache; | 41 quota_client_mask |= quota::QuotaClient::kAppcache; |
| 40 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_INDEXEDDB) | 42 if (remove_mask & StoragePartition::REMOVE_DATA_MASK_INDEXEDDB) |
| 41 quota_client_mask |= quota::QuotaClient::kIndexedDatabase; | 43 quota_client_mask |= quota::QuotaClient::kIndexedDatabase; |
| 42 | 44 |
| 43 return quota_client_mask; | 45 return quota_client_mask; |
| 44 } | 46 } |
| 45 | 47 |
| 46 void OnClearedCookies(const base::Closure& callback, int num_deleted) { | |
| 47 // The final callback needs to happen from UI thread. | |
| 48 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | |
| 49 BrowserThread::PostTask( | |
| 50 BrowserThread::UI, FROM_HERE, | |
| 51 base::Bind(&OnClearedCookies, callback, num_deleted)); | |
| 52 return; | |
| 53 } | |
| 54 | |
| 55 callback.Run(); | |
| 56 } | |
| 57 | |
| 58 void ClearCookiesOnIOThread( | |
| 59 const scoped_refptr<net::URLRequestContextGetter>& rq_context, | |
| 60 const base::Time begin, | |
| 61 const base::Time end, | |
| 62 const GURL& remove_origin, | |
| 63 const base::Closure& callback) { | |
| 64 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
| 65 net::CookieStore* cookie_store = rq_context-> | |
| 66 GetURLRequestContext()->cookie_store(); | |
| 67 if (remove_origin.is_empty()) { | |
| 68 cookie_store->GetCookieMonster()->DeleteAllCreatedBetweenAsync( | |
| 69 begin, | |
| 70 end, | |
| 71 base::Bind(&OnClearedCookies, callback)); | |
| 72 } else { | |
| 73 cookie_store->GetCookieMonster()->DeleteAllCreatedBetweenForHostAsync( | |
| 74 begin, | |
| 75 end, | |
| 76 remove_origin, base::Bind(&OnClearedCookies, callback)); | |
| 77 } | |
| 78 } | |
| 79 | |
| 80 void OnQuotaManagedOriginDeleted(const GURL& origin, | 48 void OnQuotaManagedOriginDeleted(const GURL& origin, |
| 81 quota::StorageType type, | 49 quota::StorageType type, |
| 82 size_t* origins_to_delete_count, | 50 size_t* origins_to_delete_count, |
| 83 const base::Closure& callback, | 51 const base::Closure& callback, |
| 84 quota::QuotaStatusCode status) { | 52 quota::QuotaStatusCode status) { |
| 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 86 DCHECK_GT(*origins_to_delete_count, 0u); | 54 DCHECK_GT(*origins_to_delete_count, 0u); |
| 87 if (status != quota::kQuotaStatusOk) { | 55 if (status != quota::kQuotaStatusOk) { |
| 88 DLOG(ERROR) << "Couldn't remove data of type " << type << " for origin " | 56 DLOG(ERROR) << "Couldn't remove data of type " << type << " for origin " |
| 89 << origin << ". Status: " << status; | 57 << origin << ". Status: " << status; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 : callback(callback), task_count(0) { | 210 : callback(callback), task_count(0) { |
| 243 } | 211 } |
| 244 | 212 |
| 245 void IncrementTaskCountOnUI(); | 213 void IncrementTaskCountOnUI(); |
| 246 void DecrementTaskCountOnUI(); | 214 void DecrementTaskCountOnUI(); |
| 247 | 215 |
| 248 void ClearDataOnUIThread(uint32 remove_mask, | 216 void ClearDataOnUIThread(uint32 remove_mask, |
| 249 uint32 quota_storage_remove_mask, | 217 uint32 quota_storage_remove_mask, |
| 250 const GURL& remove_origin, | 218 const GURL& remove_origin, |
| 251 const base::FilePath& path, | 219 const base::FilePath& path, |
| 252 net::URLRequestContextGetter* rq_context, | 220 CookieStoreMap* cookie_store_map, |
| 253 DOMStorageContextWrapper* dom_storage_context, | 221 DOMStorageContextWrapper* dom_storage_context, |
| 254 quota::QuotaManager* quota_manager, | 222 quota::QuotaManager* quota_manager, |
| 255 WebRTCIdentityStore* webrtc_identity_store, | 223 WebRTCIdentityStore* webrtc_identity_store, |
| 256 const base::Time begin, | 224 const base::Time begin, |
| 257 const base::Time end); | 225 const base::Time end); |
| 258 | 226 |
| 259 // Accessed on UI thread. | 227 // Accessed on UI thread. |
| 260 const base::Closure callback; | 228 const base::Closure callback; |
| 261 // Accessed on UI thread. | 229 // Accessed on UI thread. |
| 262 int task_count; | 230 int task_count; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 278 } | 246 } |
| 279 | 247 |
| 280 StoragePartitionImpl::StoragePartitionImpl( | 248 StoragePartitionImpl::StoragePartitionImpl( |
| 281 const base::FilePath& partition_path, | 249 const base::FilePath& partition_path, |
| 282 quota::QuotaManager* quota_manager, | 250 quota::QuotaManager* quota_manager, |
| 283 ChromeAppCacheService* appcache_service, | 251 ChromeAppCacheService* appcache_service, |
| 284 fileapi::FileSystemContext* filesystem_context, | 252 fileapi::FileSystemContext* filesystem_context, |
| 285 webkit_database::DatabaseTracker* database_tracker, | 253 webkit_database::DatabaseTracker* database_tracker, |
| 286 DOMStorageContextWrapper* dom_storage_context, | 254 DOMStorageContextWrapper* dom_storage_context, |
| 287 IndexedDBContextImpl* indexed_db_context, | 255 IndexedDBContextImpl* indexed_db_context, |
| 256 scoped_ptr<CookieStoreMap> cookie_store_map, |
| 288 WebRTCIdentityStore* webrtc_identity_store) | 257 WebRTCIdentityStore* webrtc_identity_store) |
| 289 : partition_path_(partition_path), | 258 : partition_path_(partition_path), |
| 290 quota_manager_(quota_manager), | 259 quota_manager_(quota_manager), |
| 291 appcache_service_(appcache_service), | 260 appcache_service_(appcache_service), |
| 292 filesystem_context_(filesystem_context), | 261 filesystem_context_(filesystem_context), |
| 293 database_tracker_(database_tracker), | 262 database_tracker_(database_tracker), |
| 294 dom_storage_context_(dom_storage_context), | 263 dom_storage_context_(dom_storage_context), |
| 295 indexed_db_context_(indexed_db_context), | 264 indexed_db_context_(indexed_db_context), |
| 296 webrtc_identity_store_(webrtc_identity_store) {} | 265 cookie_store_map_(cookie_store_map.Pass()), |
| 266 webrtc_identity_store_(webrtc_identity_store) { |
| 267 } |
| 297 | 268 |
| 298 StoragePartitionImpl::~StoragePartitionImpl() { | 269 StoragePartitionImpl::~StoragePartitionImpl() { |
| 299 // These message loop checks are just to avoid leaks in unittests. | 270 // These message loop checks are just to avoid leaks in unittests. |
| 300 if (GetDatabaseTracker() && | 271 if (GetDatabaseTracker() && |
| 301 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { | 272 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { |
| 302 BrowserThread::PostTask( | 273 BrowserThread::PostTask( |
| 303 BrowserThread::FILE, FROM_HERE, | 274 BrowserThread::FILE, FROM_HERE, |
| 304 base::Bind(&webkit_database::DatabaseTracker::Shutdown, | 275 base::Bind(&webkit_database::DatabaseTracker::Shutdown, |
| 305 GetDatabaseTracker())); | 276 GetDatabaseTracker())); |
| 306 } | 277 } |
| 307 | 278 |
| 308 if (GetFileSystemContext()) | 279 if (GetFileSystemContext()) |
| 309 GetFileSystemContext()->Shutdown(); | 280 GetFileSystemContext()->Shutdown(); |
| 310 | 281 |
| 311 if (GetDOMStorageContext()) | 282 if (GetDOMStorageContext()) |
| 312 GetDOMStorageContext()->Shutdown(); | 283 GetDOMStorageContext()->Shutdown(); |
| 313 } | 284 } |
| 314 | 285 |
| 315 // TODO(ajwong): Break the direct dependency on |context|. We only | 286 // TODO(ajwong): Break the direct dependency on |context|. We only |
| 316 // need 3 pieces of info from it. | 287 // need 3 pieces of info from it. |
| 317 StoragePartitionImpl* StoragePartitionImpl::Create( | 288 StoragePartitionImpl* StoragePartitionImpl::Create( |
| 318 BrowserContext* context, | 289 BrowserContext* context, |
| 319 bool in_memory, | 290 bool in_memory, |
| 320 const base::FilePath& partition_path) { | 291 const base::FilePath& partition_path, |
| 292 scoped_ptr<CookieStoreMap> cookie_store_map) { |
| 321 // Ensure that these methods are called on the UI thread, except for | 293 // Ensure that these methods are called on the UI thread, except for |
| 322 // unittests where a UI thread might not have been created. | 294 // unittests where a UI thread might not have been created. |
| 323 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || | 295 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
| 324 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); | 296 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); |
| 325 | 297 |
| 326 // All of the clients have to be created and registered with the | 298 // All of the clients have to be created and registered with the |
| 327 // QuotaManager prior to the QuotaManger being used. We do them | 299 // QuotaManager prior to the QuotaManger being used. We do them |
| 328 // all together here prior to handing out a reference to anything | 300 // all together here prior to handing out a reference to anything |
| 329 // that utilizes the QuotaManager. | 301 // that utilizes the QuotaManager. |
| 330 scoped_refptr<quota::QuotaManager> quota_manager = new quota::QuotaManager( | 302 scoped_refptr<quota::QuotaManager> quota_manager = new quota::QuotaManager( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 scoped_refptr<WebRTCIdentityStore> webrtc_identity_store( | 346 scoped_refptr<WebRTCIdentityStore> webrtc_identity_store( |
| 375 new WebRTCIdentityStore(path, context->GetSpecialStoragePolicy())); | 347 new WebRTCIdentityStore(path, context->GetSpecialStoragePolicy())); |
| 376 | 348 |
| 377 return new StoragePartitionImpl(partition_path, | 349 return new StoragePartitionImpl(partition_path, |
| 378 quota_manager.get(), | 350 quota_manager.get(), |
| 379 appcache_service.get(), | 351 appcache_service.get(), |
| 380 filesystem_context.get(), | 352 filesystem_context.get(), |
| 381 database_tracker.get(), | 353 database_tracker.get(), |
| 382 dom_storage_context.get(), | 354 dom_storage_context.get(), |
| 383 indexed_db_context.get(), | 355 indexed_db_context.get(), |
| 356 cookie_store_map.Pass(), |
| 384 webrtc_identity_store.get()); | 357 webrtc_identity_store.get()); |
| 385 } | 358 } |
| 386 | 359 |
| 387 base::FilePath StoragePartitionImpl::GetPath() { | 360 base::FilePath StoragePartitionImpl::GetPath() { |
| 388 return partition_path_; | 361 return partition_path_; |
| 389 } | 362 } |
| 390 | 363 |
| 391 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { | 364 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { |
| 392 return url_request_context_.get(); | 365 return url_request_context_.get(); |
| 393 } | 366 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 418 } | 391 } |
| 419 | 392 |
| 420 IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() { | 393 IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() { |
| 421 return indexed_db_context_.get(); | 394 return indexed_db_context_.get(); |
| 422 } | 395 } |
| 423 | 396 |
| 424 void StoragePartitionImpl::ClearDataImpl( | 397 void StoragePartitionImpl::ClearDataImpl( |
| 425 uint32 remove_mask, | 398 uint32 remove_mask, |
| 426 uint32 quota_storage_remove_mask, | 399 uint32 quota_storage_remove_mask, |
| 427 const GURL& remove_origin, | 400 const GURL& remove_origin, |
| 428 net::URLRequestContextGetter* rq_context, | |
| 429 const base::Time begin, | 401 const base::Time begin, |
| 430 const base::Time end, | 402 const base::Time end, |
| 431 const base::Closure& callback) { | 403 const base::Closure& callback) { |
| 432 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 404 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 433 DataDeletionHelper* helper = new DataDeletionHelper(callback); | 405 DataDeletionHelper* helper = new DataDeletionHelper(callback); |
| 434 // |helper| deletes itself when done in | 406 // |helper| deletes itself when done in |
| 435 // DataDeletionHelper::DecrementTaskCountOnUI(). | 407 // DataDeletionHelper::DecrementTaskCountOnUI(). |
| 436 helper->ClearDataOnUIThread( | 408 helper->ClearDataOnUIThread( |
| 437 remove_mask, quota_storage_remove_mask, remove_origin, | 409 remove_mask, quota_storage_remove_mask, remove_origin, |
| 438 GetPath(), rq_context, dom_storage_context_, quota_manager_, | 410 GetPath(), cookie_store_map_.get(), dom_storage_context_, quota_manager_, |
| 439 webrtc_identity_store_, begin, end); | 411 webrtc_identity_store_, begin, end); |
| 440 } | 412 } |
| 441 | 413 |
| 442 void StoragePartitionImpl:: | 414 void StoragePartitionImpl:: |
| 443 QuotaManagedDataDeletionHelper::IncrementTaskCountOnIO() { | 415 QuotaManagedDataDeletionHelper::IncrementTaskCountOnIO() { |
| 444 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 416 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 445 ++task_count; | 417 ++task_count; |
| 446 } | 418 } |
| 447 | 419 |
| 448 void StoragePartitionImpl:: | 420 void StoragePartitionImpl:: |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 callback.Run(); | 513 callback.Run(); |
| 542 delete this; | 514 delete this; |
| 543 } | 515 } |
| 544 } | 516 } |
| 545 | 517 |
| 546 void StoragePartitionImpl::DataDeletionHelper::ClearDataOnUIThread( | 518 void StoragePartitionImpl::DataDeletionHelper::ClearDataOnUIThread( |
| 547 uint32 remove_mask, | 519 uint32 remove_mask, |
| 548 uint32 quota_storage_remove_mask, | 520 uint32 quota_storage_remove_mask, |
| 549 const GURL& remove_origin, | 521 const GURL& remove_origin, |
| 550 const base::FilePath& path, | 522 const base::FilePath& path, |
| 551 net::URLRequestContextGetter* rq_context, | 523 CookieStoreMap* cookie_store_map, |
| 552 DOMStorageContextWrapper* dom_storage_context, | 524 DOMStorageContextWrapper* dom_storage_context, |
| 553 quota::QuotaManager* quota_manager, | 525 quota::QuotaManager* quota_manager, |
| 554 WebRTCIdentityStore* webrtc_identity_store, | 526 WebRTCIdentityStore* webrtc_identity_store, |
| 555 const base::Time begin, | 527 const base::Time begin, |
| 556 const base::Time end) { | 528 const base::Time end) { |
| 557 DCHECK_NE(remove_mask, 0u); | 529 DCHECK_NE(remove_mask, 0u); |
| 558 DCHECK(!callback.is_null()); | 530 DCHECK(!callback.is_null()); |
| 559 | 531 |
| 560 IncrementTaskCountOnUI(); | 532 IncrementTaskCountOnUI(); |
| 561 base::Closure decrement_callback = base::Bind( | 533 base::Closure decrement_callback = base::Bind( |
| 562 &DataDeletionHelper::DecrementTaskCountOnUI, base::Unretained(this)); | 534 &DataDeletionHelper::DecrementTaskCountOnUI, base::Unretained(this)); |
| 563 | 535 |
| 564 if (remove_mask & REMOVE_DATA_MASK_COOKIES) { | 536 if (remove_mask & REMOVE_DATA_MASK_COOKIES) { |
| 565 // Handle the cookies. | 537 // Handle the cookies. |
| 566 IncrementTaskCountOnUI(); | 538 IncrementTaskCountOnUI(); |
| 567 BrowserThread::PostTask( | 539 cookie_store_map->DeleteCookies(remove_origin, begin, end, |
| 568 BrowserThread::IO, FROM_HERE, | 540 decrement_callback); |
| 569 base::Bind(&ClearCookiesOnIOThread, | |
| 570 make_scoped_refptr(rq_context), begin, end, remove_origin, | |
| 571 decrement_callback)); | |
| 572 } | 541 } |
| 573 | 542 |
| 574 if (remove_mask & REMOVE_DATA_MASK_INDEXEDDB || | 543 if (remove_mask & REMOVE_DATA_MASK_INDEXEDDB || |
| 575 remove_mask & REMOVE_DATA_MASK_WEBSQL || | 544 remove_mask & REMOVE_DATA_MASK_WEBSQL || |
| 576 remove_mask & REMOVE_DATA_MASK_APPCACHE || | 545 remove_mask & REMOVE_DATA_MASK_APPCACHE || |
| 577 remove_mask & REMOVE_DATA_MASK_FILE_SYSTEMS) { | 546 remove_mask & REMOVE_DATA_MASK_FILE_SYSTEMS) { |
| 578 IncrementTaskCountOnUI(); | 547 IncrementTaskCountOnUI(); |
| 579 BrowserThread::PostTask( | 548 BrowserThread::PostTask( |
| 580 BrowserThread::IO, FROM_HERE, | 549 BrowserThread::IO, FROM_HERE, |
| 581 base::Bind(&ClearQuotaManagedDataOnIOThread, | 550 base::Bind(&ClearQuotaManagedDataOnIOThread, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 decrement_callback)); | 589 decrement_callback)); |
| 621 } | 590 } |
| 622 | 591 |
| 623 DecrementTaskCountOnUI(); | 592 DecrementTaskCountOnUI(); |
| 624 } | 593 } |
| 625 | 594 |
| 626 | 595 |
| 627 void StoragePartitionImpl::ClearDataForOrigin( | 596 void StoragePartitionImpl::ClearDataForOrigin( |
| 628 uint32 remove_mask, | 597 uint32 remove_mask, |
| 629 uint32 quota_storage_remove_mask, | 598 uint32 quota_storage_remove_mask, |
| 630 const GURL& storage_origin, | 599 const GURL& storage_origin) { |
| 631 net::URLRequestContextGetter* request_context_getter) { | |
| 632 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 600 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 633 ClearDataImpl(remove_mask, quota_storage_remove_mask, storage_origin, | 601 ClearDataImpl(remove_mask, quota_storage_remove_mask, storage_origin, |
| 634 request_context_getter, base::Time(), base::Time::Max(), | 602 base::Time(), base::Time::Max(), base::Bind(&base::DoNothing)); |
| 635 base::Bind(&base::DoNothing)); | |
| 636 } | 603 } |
| 637 | 604 |
| 638 void StoragePartitionImpl::ClearDataForUnboundedRange( | 605 void StoragePartitionImpl::ClearDataForUnboundedRange( |
| 639 uint32 remove_mask, | 606 uint32 remove_mask, |
| 640 uint32 quota_storage_remove_mask) { | 607 uint32 quota_storage_remove_mask) { |
| 641 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), | 608 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), |
| 642 GetURLRequestContext(), base::Time(), base::Time::Max(), | 609 base::Time(), base::Time::Max(), base::Bind(&base::DoNothing)); |
| 643 base::Bind(&base::DoNothing)); | |
| 644 } | 610 } |
| 645 | 611 |
| 646 void StoragePartitionImpl::ClearDataForRange(uint32 remove_mask, | 612 void StoragePartitionImpl::ClearDataForRange(uint32 remove_mask, |
| 647 uint32 quota_storage_remove_mask, | 613 uint32 quota_storage_remove_mask, |
| 648 const base::Time& begin, | 614 const base::Time& begin, |
| 649 const base::Time& end, | 615 const base::Time& end, |
| 650 const base::Closure& callback) { | 616 const base::Closure& callback) { |
| 651 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), | 617 ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), begin, end, |
| 652 GetURLRequestContext(), begin, end, callback); | 618 callback); |
| 653 } | 619 } |
| 654 | 620 |
| 655 WebRTCIdentityStore* StoragePartitionImpl::GetWebRTCIdentityStore() { | 621 WebRTCIdentityStore* StoragePartitionImpl::GetWebRTCIdentityStore() { |
| 656 return webrtc_identity_store_.get(); | 622 return webrtc_identity_store_.get(); |
| 657 } | 623 } |
| 658 | 624 |
| 625 const CookieStoreMap& StoragePartitionImpl::GetCookieStoreMap() { |
| 626 return *cookie_store_map_; |
| 627 } |
| 628 |
| 659 void StoragePartitionImpl::SetURLRequestContext( | 629 void StoragePartitionImpl::SetURLRequestContext( |
| 660 net::URLRequestContextGetter* url_request_context) { | 630 net::URLRequestContextGetter* url_request_context) { |
| 661 url_request_context_ = url_request_context; | 631 url_request_context_ = url_request_context; |
| 662 } | 632 } |
| 663 | 633 |
| 664 void StoragePartitionImpl::SetMediaURLRequestContext( | 634 void StoragePartitionImpl::SetMediaURLRequestContext( |
| 665 net::URLRequestContextGetter* media_url_request_context) { | 635 net::URLRequestContextGetter* media_url_request_context) { |
| 666 media_url_request_context_ = media_url_request_context; | 636 media_url_request_context_ = media_url_request_context; |
| 667 } | 637 } |
| 668 | 638 |
| 669 } // namespace content | 639 } // namespace content |
| OLD | NEW |