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

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

Issue 2249213002: [OBSOLETE] Reporting: Initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years 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) 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>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #include "content/public/browser/storage_partition.h" 60 #include "content/public/browser/storage_partition.h"
61 #include "extensions/browser/extension_protocols.h" 61 #include "extensions/browser/extension_protocols.h"
62 #include "extensions/common/constants.h" 62 #include "extensions/common/constants.h"
63 #include "extensions/features/features.h" 63 #include "extensions/features/features.h"
64 #include "net/base/cache_type.h" 64 #include "net/base/cache_type.h"
65 #include "net/base/sdch_manager.h" 65 #include "net/base/sdch_manager.h"
66 #include "net/cookies/cookie_store.h" 66 #include "net/cookies/cookie_store.h"
67 #include "net/http/http_cache.h" 67 #include "net/http/http_cache.h"
68 #include "net/http/http_network_session.h" 68 #include "net/http/http_network_session.h"
69 #include "net/http/http_server_properties_manager.h" 69 #include "net/http/http_server_properties_manager.h"
70 #include "net/reporting/reporting_controls.h"
71 #include "net/reporting/reporting_service.h"
70 #include "net/sdch/sdch_owner.h" 72 #include "net/sdch/sdch_owner.h"
71 #include "net/ssl/channel_id_service.h" 73 #include "net/ssl/channel_id_service.h"
72 #include "net/url_request/url_request_context_storage.h" 74 #include "net/url_request/url_request_context_storage.h"
73 #include "net/url_request/url_request_intercepting_job_factory.h" 75 #include "net/url_request/url_request_intercepting_job_factory.h"
74 #include "net/url_request/url_request_job_factory_impl.h" 76 #include "net/url_request/url_request_job_factory_impl.h"
75 #include "storage/browser/quota/special_storage_policy.h" 77 #include "storage/browser/quota/special_storage_policy.h"
76 78
77 #if defined(OS_ANDROID) 79 #if defined(OS_ANDROID)
78 #include "chrome/browser/android/offline_pages/offline_page_request_interceptor. h" 80 #include "chrome/browser/android/offline_pages/offline_page_request_interceptor. h"
79 #endif // defined(OS_ANDROID) 81 #endif // defined(OS_ANDROID)
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 ProfileImplIOData::LazyParams::~LazyParams() {} 426 ProfileImplIOData::LazyParams::~LazyParams() {}
425 427
426 ProfileImplIOData::ProfileImplIOData() 428 ProfileImplIOData::ProfileImplIOData()
427 : ProfileIOData(Profile::REGULAR_PROFILE), 429 : ProfileIOData(Profile::REGULAR_PROFILE),
428 http_server_properties_manager_(NULL), 430 http_server_properties_manager_(NULL),
429 app_cache_max_size_(0), 431 app_cache_max_size_(0),
430 app_media_cache_max_size_(0) { 432 app_media_cache_max_size_(0) {
431 } 433 }
432 434
433 ProfileImplIOData::~ProfileImplIOData() { 435 ProfileImplIOData::~ProfileImplIOData() {
436 if (main_request_context()->reporting_service())
437 main_request_context()->reporting_service()->set_uploader(nullptr);
438
434 DestroyResourceContext(); 439 DestroyResourceContext();
435 440
436 if (media_request_context_) 441 if (media_request_context_)
437 media_request_context_->AssertNoURLRequests(); 442 media_request_context_->AssertNoURLRequests();
438 } 443 }
439 444
440 void ProfileImplIOData::InitializeInternal( 445 void ProfileImplIOData::InitializeInternal(
441 std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate, 446 std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate,
442 ProfileParams* profile_params, 447 ProfileParams* profile_params,
443 content::ProtocolHandlerMap* protocol_handlers, 448 content::ProtocolHandlerMap* protocol_handlers,
(...skipping 29 matching lines...) Expand all
473 if (lazy_params_->http_server_properties_manager) { 478 if (lazy_params_->http_server_properties_manager) {
474 lazy_params_->http_server_properties_manager->InitializeOnNetworkThread(); 479 lazy_params_->http_server_properties_manager->InitializeOnNetworkThread();
475 main_context_storage->set_http_server_properties( 480 main_context_storage->set_http_server_properties(
476 std::move(lazy_params_->http_server_properties_manager)); 481 std::move(lazy_params_->http_server_properties_manager));
477 } 482 }
478 483
479 main_context->set_transport_security_state(transport_security_state()); 484 main_context->set_transport_security_state(transport_security_state());
480 main_context->set_ct_policy_enforcer( 485 main_context->set_ct_policy_enforcer(
481 io_thread_globals->ct_policy_enforcer.get()); 486 io_thread_globals->ct_policy_enforcer.get());
482 487
488 if (net::GetReportingEnabled(switches::kDisableReporting,
489 switches::kEnableReporting)) {
490 main_context_storage->set_reporting_service(
491 base::MakeUnique<net::ReportingService>(
492 net::ReportingService::Policy::GetDefault()));
493 main_context->reporting_service()->set_uploader(
494 net::ReportingUploader::Create(main_context));
495 }
496
483 main_context->set_net_log(io_thread->net_log()); 497 main_context->set_net_log(io_thread->net_log());
484 498
485 main_context_storage->set_network_delegate( 499 main_context_storage->set_network_delegate(
486 data_reduction_proxy_io_data()->CreateNetworkDelegate( 500 data_reduction_proxy_io_data()->CreateNetworkDelegate(
487 io_thread_globals->data_use_ascriber->CreateNetworkDelegate( 501 io_thread_globals->data_use_ascriber->CreateNetworkDelegate(
488 std::move(chrome_network_delegate), 502 std::move(chrome_network_delegate),
489 io_thread->GetMetricsDataUseForwarder()), 503 io_thread->GetMetricsDataUseForwarder()),
490 true)); 504 true));
491 505
492 main_context->set_host_resolver( 506 main_context->set_host_resolver(
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 const base::Closure& completion) { 819 const base::Closure& completion) {
806 DCHECK_CURRENTLY_ON(BrowserThread::IO); 820 DCHECK_CURRENTLY_ON(BrowserThread::IO);
807 DCHECK(initialized()); 821 DCHECK(initialized());
808 822
809 DCHECK(transport_security_state()); 823 DCHECK(transport_security_state());
810 // Completes synchronously. 824 // Completes synchronously.
811 transport_security_state()->DeleteAllDynamicDataSince(time); 825 transport_security_state()->DeleteAllDynamicDataSince(time);
812 DCHECK(http_server_properties_manager_); 826 DCHECK(http_server_properties_manager_);
813 http_server_properties_manager_->Clear(completion); 827 http_server_properties_manager_->Clear(completion);
814 } 828 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698