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

Side by Side Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 2841593003: Use TaskScheduler instead of blocking pool in profile_impl_io_data.cc. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/profiles/profile_impl_io_data.h" 5 #include "chrome/browser/profiles/profile_impl_io_data.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ptr_util.h" 16 #include "base/memory/ptr_util.h"
17 #include "base/metrics/field_trial.h" 17 #include "base/metrics/field_trial.h"
18 #include "base/sequenced_task_runner.h" 18 #include "base/sequenced_task_runner.h"
19 #include "base/stl_util.h" 19 #include "base/stl_util.h"
20 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
21 #include "base/task_scheduler/post_task.h"
21 #include "base/threading/sequenced_worker_pool.h" 22 #include "base/threading/sequenced_worker_pool.h"
22 #include "build/build_config.h" 23 #include "build/build_config.h"
23 #include "chrome/browser/browser_process.h" 24 #include "chrome/browser/browser_process.h"
24 #include "chrome/browser/chrome_notification_types.h" 25 #include "chrome/browser/chrome_notification_types.h"
25 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 26 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
26 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 27 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
27 #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h" 28 #include "chrome/browser/data_use_measurement/chrome_data_use_ascriber.h"
28 #include "chrome/browser/io_thread.h" 29 #include "chrome/browser/io_thread.h"
29 #include "chrome/browser/net/chrome_network_delegate.h" 30 #include "chrome/browser/net/chrome_network_delegate.h"
30 #include "chrome/browser/net/http_server_properties_manager_factory.h" 31 #include "chrome/browser/net/http_server_properties_manager_factory.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 profile_params->cookie_monster_delegate.get()); 496 profile_params->cookie_monster_delegate.get());
496 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); 497 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate();
497 main_context_storage->set_cookie_store( 498 main_context_storage->set_cookie_store(
498 content::CreateCookieStore(cookie_config)); 499 content::CreateCookieStore(cookie_config));
499 500
500 // Set up server bound cert service. 501 // Set up server bound cert service.
501 DCHECK(!lazy_params_->channel_id_path.empty()); 502 DCHECK(!lazy_params_->channel_id_path.empty());
502 scoped_refptr<QuotaPolicyChannelIDStore> channel_id_db = 503 scoped_refptr<QuotaPolicyChannelIDStore> channel_id_db =
503 new QuotaPolicyChannelIDStore( 504 new QuotaPolicyChannelIDStore(
504 lazy_params_->channel_id_path, 505 lazy_params_->channel_id_path,
505 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( 506 base::CreateSequencedTaskRunnerWithTraits(
506 base::SequencedWorkerPool::GetSequenceToken()), 507 base::TaskTraits().MayBlock().WithPriority(
508 base::TaskPriority::BACKGROUND)),
gab 2017/08/15 00:02:44 This call also lands in net::SQLiteChannelIDStore'
507 lazy_params_->special_storage_policy.get()); 509 lazy_params_->special_storage_policy.get());
508 main_context_storage->set_channel_id_service( 510 main_context_storage->set_channel_id_service(
509 base::MakeUnique<net::ChannelIDService>( 511 base::MakeUnique<net::ChannelIDService>(
510 new net::DefaultChannelIDStore(channel_id_db.get()))); 512 new net::DefaultChannelIDStore(channel_id_db.get())));
511 513
512 main_context->cookie_store()->SetChannelIDServiceID( 514 main_context->cookie_store()->SetChannelIDServiceID(
513 main_context->channel_id_service()->GetUniqueID()); 515 main_context->channel_id_service()->GetUniqueID());
514 516
515 std::unique_ptr<net::HttpCache::BackendFactory> main_backend( 517 std::unique_ptr<net::HttpCache::BackendFactory> main_backend(
516 new net::HttpCache::DefaultBackend( 518 new net::HttpCache::DefaultBackend(
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 642
641 // TODO(creis): We should have a cookie delegate for notifying the cookie 643 // TODO(creis): We should have a cookie delegate for notifying the cookie
642 // extensions API, but we need to update it to understand isolated apps 644 // extensions API, but we need to update it to understand isolated apps
643 // first. 645 // first.
644 content::CookieStoreConfig cookie_config( 646 content::CookieStoreConfig cookie_config(
645 cookie_path, content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES, 647 cookie_path, content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
646 nullptr, nullptr); 648 nullptr, nullptr);
647 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); 649 cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate();
648 cookie_store = content::CreateCookieStore(cookie_config); 650 cookie_store = content::CreateCookieStore(cookie_config);
649 channel_id_db = new net::SQLiteChannelIDStore( 651 channel_id_db = new net::SQLiteChannelIDStore(
650 channel_id_path, 652 channel_id_path, base::CreateSequencedTaskRunnerWithTraits(
651 BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( 653 base::TaskTraits().MayBlock().WithPriority(
652 base::SequencedWorkerPool::GetSequenceToken())); 654 base::TaskPriority::BACKGROUND)));
gab 2017/08/15 00:02:44 I don't think TaskPriority::BACKGROUND is correct
653 } 655 }
654 std::unique_ptr<net::ChannelIDService> channel_id_service( 656 std::unique_ptr<net::ChannelIDService> channel_id_service(
655 new net::ChannelIDService( 657 new net::ChannelIDService(
656 new net::DefaultChannelIDStore(channel_id_db.get()))); 658 new net::DefaultChannelIDStore(channel_id_db.get())));
657 cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); 659 cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID());
658 660
659 // Build a new HttpNetworkSession that uses the new ChannelIDService. 661 // Build a new HttpNetworkSession that uses the new ChannelIDService.
660 // TODO(mmenke): It weird to combine state from 662 // TODO(mmenke): It weird to combine state from
661 // main_request_context_storage() objects and the argumet to this method, 663 // main_request_context_storage() objects and the argumet to this method,
662 // |main_context|. Remove |main_context| as an argument, and just use 664 // |main_context|. Remove |main_context| as an argument, and just use
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 const base::Closure& completion) { 789 const base::Closure& completion) {
788 DCHECK_CURRENTLY_ON(BrowserThread::IO); 790 DCHECK_CURRENTLY_ON(BrowserThread::IO);
789 DCHECK(initialized()); 791 DCHECK(initialized());
790 792
791 DCHECK(transport_security_state()); 793 DCHECK(transport_security_state());
792 // Completes synchronously. 794 // Completes synchronously.
793 transport_security_state()->DeleteAllDynamicDataSince(time); 795 transport_security_state()->DeleteAllDynamicDataSince(time);
794 DCHECK(http_server_properties_manager_); 796 DCHECK(http_server_properties_manager_);
795 http_server_properties_manager_->Clear(completion); 797 http_server_properties_manager_->Clear(completion);
796 } 798 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698