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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 return chrome::CreateWebContentsViewDelegate(web_contents); | 960 return chrome::CreateWebContentsViewDelegate(web_contents); |
961 } | 961 } |
962 | 962 |
963 void ChromeContentBrowserClient::RenderProcessWillLaunch( | 963 void ChromeContentBrowserClient::RenderProcessWillLaunch( |
964 content::RenderProcessHost* host) { | 964 content::RenderProcessHost* host) { |
965 int id = host->GetID(); | 965 int id = host->GetID(); |
966 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 966 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
967 net::URLRequestContextGetter* context = | 967 net::URLRequestContextGetter* context = |
968 host->GetStoragePartition()->GetURLRequestContext(); | 968 host->GetStoragePartition()->GetURLRequestContext(); |
969 | 969 |
970 // The host owns both |chrome_render| and the interface registry, which will | 970 host->AddFilter(new ChromeRenderMessageFilter(id, profile)); |
971 // be destroyed before the filter. | |
972 auto* chrome_render_filter = new ChromeRenderMessageFilter(id, profile); | |
973 host->GetInterfaceRegistry()->AddInterface( | |
974 base::Bind(&ChromeRenderMessageFilter::BindNetworkHints, | |
975 base::Unretained(chrome_render_filter)), | |
976 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | |
977 host->AddFilter(chrome_render_filter); | |
978 #if defined(ENABLE_EXTENSIONS) | 971 #if defined(ENABLE_EXTENSIONS) |
979 host->AddFilter(new cast::CastTransportHostFilter); | 972 host->AddFilter(new cast::CastTransportHostFilter); |
980 #endif | 973 #endif |
981 #if defined(ENABLE_PRINTING) | 974 #if defined(ENABLE_PRINTING) |
982 host->AddFilter(new printing::PrintingMessageFilter(id, profile)); | 975 host->AddFilter(new printing::PrintingMessageFilter(id, profile)); |
983 #endif | 976 #endif |
984 host->AddFilter(new SearchProviderInstallStateMessageFilter(id, profile)); | 977 host->AddFilter(new SearchProviderInstallStateMessageFilter(id, profile)); |
985 #if defined(ENABLE_SPELLCHECK) | 978 #if defined(ENABLE_SPELLCHECK) |
986 host->AddFilter(new SpellCheckMessageFilter(id)); | 979 host->AddFilter(new SpellCheckMessageFilter(id)); |
987 #endif | 980 #endif |
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3054 if (channel <= kMaxDisableEncryptionChannel) { | 3047 if (channel <= kMaxDisableEncryptionChannel) { |
3055 static const char* const kWebRtcDevSwitchNames[] = { | 3048 static const char* const kWebRtcDevSwitchNames[] = { |
3056 switches::kDisableWebRtcEncryption, | 3049 switches::kDisableWebRtcEncryption, |
3057 }; | 3050 }; |
3058 to_command_line->CopySwitchesFrom(from_command_line, | 3051 to_command_line->CopySwitchesFrom(from_command_line, |
3059 kWebRtcDevSwitchNames, | 3052 kWebRtcDevSwitchNames, |
3060 arraysize(kWebRtcDevSwitchNames)); | 3053 arraysize(kWebRtcDevSwitchNames)); |
3061 } | 3054 } |
3062 } | 3055 } |
3063 #endif // defined(ENABLE_WEBRTC) | 3056 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |