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

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

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable test for chrome_frame_net_tests Created 8 years, 1 month 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 | Annotate | Revision Log
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 ProfileImplIOData::Handle::Handle(Profile* profile) 44 ProfileImplIOData::Handle::Handle(Profile* profile)
45 : io_data_(new ProfileImplIOData), 45 : io_data_(new ProfileImplIOData),
46 profile_(profile), 46 profile_(profile),
47 initialized_(false) { 47 initialized_(false) {
48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 48 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
49 DCHECK(profile); 49 DCHECK(profile);
50 } 50 }
51 51
52 ProfileImplIOData::Handle::~Handle() { 52 ProfileImplIOData::Handle::~Handle() {
53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
54 if (main_request_context_getter_)
55 main_request_context_getter_->CleanupOnUIThread();
56 if (media_request_context_getter_)
57 media_request_context_getter_->CleanupOnUIThread();
58 if (extensions_request_context_getter_)
59 extensions_request_context_getter_->CleanupOnUIThread();
60
61 if (io_data_->predictor_.get() != NULL) { 54 if (io_data_->predictor_.get() != NULL) {
62 // io_data_->predictor_ might be NULL if Init() was never called 55 // io_data_->predictor_ might be NULL if Init() was never called
63 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). 56 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called).
64 PrefService* user_prefs = profile_->GetPrefs(); 57 PrefService* user_prefs = profile_->GetPrefs();
65 io_data_->predictor_->ShutdownOnUIThread(user_prefs); 58 io_data_->predictor_->ShutdownOnUIThread(user_prefs);
66 } 59 }
67 60
68 // Clean up all isolated app request contexts.
69 for (ChromeURLRequestContextGetterMap::iterator iter =
70 app_request_context_getter_map_.begin();
71 iter != app_request_context_getter_map_.end();
72 ++iter) {
73 iter->second->CleanupOnUIThread();
74 }
75
76 // Clean up all isolated media request contexts.
77 for (ChromeURLRequestContextGetterMap::iterator iter =
78 isolated_media_request_context_getter_map_.begin();
79 iter != isolated_media_request_context_getter_map_.end();
80 ++iter) {
81 iter->second->CleanupOnUIThread();
82 }
83
84 if (io_data_->http_server_properties_manager()) 61 if (io_data_->http_server_properties_manager())
85 io_data_->http_server_properties_manager()->ShutdownOnUIThread(); 62 io_data_->http_server_properties_manager()->ShutdownOnUIThread();
86 io_data_->ShutdownOnUIThread(); 63 io_data_->ShutdownOnUIThread();
87 } 64 }
88 65
89 void ProfileImplIOData::Handle::Init( 66 void ProfileImplIOData::Handle::Init(
90 const FilePath& cookie_path, 67 const FilePath& cookie_path,
91 const FilePath& server_bound_cert_path, 68 const FilePath& server_bound_cert_path,
92 const FilePath& cache_path, 69 const FilePath& cache_path,
93 int cache_max_size, 70 int cache_max_size,
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 base::Time time, 659 base::Time time,
683 const base::Closure& completion) { 660 const base::Closure& completion) {
684 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 661 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
685 LazyInitialize(); 662 LazyInitialize();
686 663
687 DCHECK(transport_security_state()); 664 DCHECK(transport_security_state());
688 transport_security_state()->DeleteSince(time); // Completes synchronously. 665 transport_security_state()->DeleteSince(time); // Completes synchronously.
689 DCHECK(http_server_properties_manager()); 666 DCHECK(http_server_properties_manager());
690 http_server_properties_manager()->Clear(completion); 667 http_server_properties_manager()->Clear(completion);
691 } 668 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_io_data.cc ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698