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/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" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/string_util.h" | |
12 #include "base/threading/worker_pool.h" | 13 #include "base/threading/worker_pool.h" |
13 #include "chrome/browser/api/prefs/pref_member.h" | 14 #include "chrome/browser/api/prefs/pref_member.h" |
14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 15 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
15 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 16 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
16 #include "chrome/browser/io_thread.h" | 17 #include "chrome/browser/io_thread.h" |
17 #include "chrome/browser/net/chrome_net_log.h" | 18 #include "chrome/browser/net/chrome_net_log.h" |
18 #include "chrome/browser/net/clear_on_exit_policy.h" | 19 #include "chrome/browser/net/clear_on_exit_policy.h" |
19 #include "chrome/browser/net/connect_interceptor.h" | 20 #include "chrome/browser/net/connect_interceptor.h" |
20 #include "chrome/browser/net/http_server_properties_manager.h" | 21 #include "chrome/browser/net/http_server_properties_manager.h" |
21 #include "chrome/browser/net/predictor.h" | 22 #include "chrome/browser/net/predictor.h" |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
480 } | 481 } |
481 | 482 |
482 ChromeURLRequestContext* | 483 ChromeURLRequestContext* |
483 ProfileImplIOData::InitializeAppRequestContext( | 484 ProfileImplIOData::InitializeAppRequestContext( |
484 ChromeURLRequestContext* main_context, | 485 ChromeURLRequestContext* main_context, |
485 const std::string& app_id, | 486 const std::string& app_id, |
486 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 487 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
487 protocol_handler_interceptor) const { | 488 protocol_handler_interceptor) const { |
488 // If this is for a guest process, we should not persist cookies and http | 489 // If this is for a guest process, we should not persist cookies and http |
489 // cache. | 490 // cache. |
490 bool is_guest_process = (app_id.find("guest-") != std::string::npos); | 491 bool is_guest_process = StartsWithASCII(app_id, "guest-", true); |
Nico
2012/10/31 01:26:05
Also, it looks like "guest-" is scattered about in
| |
491 | 492 |
492 // Copy most state from the main context. | 493 // Copy most state from the main context. |
493 AppRequestContext* context = new AppRequestContext(load_time_stats()); | 494 AppRequestContext* context = new AppRequestContext(load_time_stats()); |
494 context->CopyFrom(main_context); | 495 context->CopyFrom(main_context); |
495 | 496 |
496 using content::StoragePartition; | 497 using content::StoragePartition; |
497 FilePath app_path = | 498 FilePath app_path = |
498 profile_path_.Append(StoragePartition::GetPartitionPath(app_id)); | 499 profile_path_.Append(StoragePartition::GetPartitionPath(app_id)); |
499 | 500 |
500 FilePath cookie_path = app_path.Append(chrome::kCookieFilename); | 501 FilePath cookie_path = app_path.Append(chrome::kCookieFilename); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
671 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( | 672 void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread( |
672 base::Time time) { | 673 base::Time time) { |
673 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 674 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
674 LazyInitialize(); | 675 LazyInitialize(); |
675 | 676 |
676 DCHECK(transport_security_state()); | 677 DCHECK(transport_security_state()); |
677 transport_security_state()->DeleteSince(time); | 678 transport_security_state()->DeleteSince(time); |
678 DCHECK(http_server_properties_manager()); | 679 DCHECK(http_server_properties_manager()); |
679 http_server_properties_manager()->Clear(); | 680 http_server_properties_manager()->Clear(); |
680 } | 681 } |
OLD | NEW |