| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); | 931 pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); |
| 932 return pref_file_path; | 932 return pref_file_path; |
| 933 } | 933 } |
| 934 | 934 |
| 935 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { | 935 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { |
| 936 net::URLRequestContextGetter* request_context = | 936 net::URLRequestContextGetter* request_context = |
| 937 io_data_.GetMainRequestContextGetter(); | 937 io_data_.GetMainRequestContextGetter(); |
| 938 // The first request context is always a normal (non-OTR) request context. | 938 // The first request context is always a normal (non-OTR) request context. |
| 939 // Even when Chromium is started in OTR mode, a normal profile is always | 939 // Even when Chromium is started in OTR mode, a normal profile is always |
| 940 // created first. | 940 // created first. |
| 941 if (!default_request_context_) { | 941 if (!default_request_context_) |
| 942 default_request_context_ = request_context; | 942 default_request_context_ = request_context; |
| 943 // TODO(eroman): this isn't terribly useful anymore now that the | |
| 944 // net::URLRequestContext is constructed by the IO thread... | |
| 945 NotificationService::current()->Notify( | |
| 946 chrome::NOTIFICATION_DEFAULT_REQUEST_CONTEXT_AVAILABLE, | |
| 947 NotificationService::AllSources(), NotificationService::NoDetails()); | |
| 948 } | |
| 949 | 943 |
| 950 return request_context; | 944 return request_context; |
| 951 } | 945 } |
| 952 | 946 |
| 953 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( | 947 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( |
| 954 int renderer_child_id) { | 948 int renderer_child_id) { |
| 955 if (extension_service_.get()) { | 949 if (extension_service_.get()) { |
| 956 const Extension* installed_app = extension_service_-> | 950 const Extension* installed_app = extension_service_-> |
| 957 GetInstalledAppForRenderer(renderer_child_id); | 951 GetInstalledAppForRenderer(renderer_child_id); |
| 958 if (installed_app != NULL && installed_app->is_storage_isolated() && | 952 if (installed_app != NULL && installed_app->is_storage_isolated() && |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1763 if (!prerender::PrerenderManager::IsPrerenderingPossible()) | 1757 if (!prerender::PrerenderManager::IsPrerenderingPossible()) |
| 1764 return NULL; | 1758 return NULL; |
| 1765 if (!prerender_manager_.get()) { | 1759 if (!prerender_manager_.get()) { |
| 1766 CHECK(g_browser_process->prerender_tracker()); | 1760 CHECK(g_browser_process->prerender_tracker()); |
| 1767 prerender_manager_.reset( | 1761 prerender_manager_.reset( |
| 1768 new prerender::PrerenderManager( | 1762 new prerender::PrerenderManager( |
| 1769 this, g_browser_process->prerender_tracker())); | 1763 this, g_browser_process->prerender_tracker())); |
| 1770 } | 1764 } |
| 1771 return prerender_manager_.get(); | 1765 return prerender_manager_.get(); |
| 1772 } | 1766 } |
| OLD | NEW |