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 host->AddFilter(new ChromeRenderMessageFilter(id, profile)); | 970 // The host owns both |chrome_render| and the interface registry, which will |
971 // be destroyed before the filter. | |
972 auto chrome_render_filter = new ChromeRenderMessageFilter(id, profile); | |
dcheng
2016/07/20 13:59:50
Nit: auto*
tibell
2016/07/21 00:12:06
Done.
| |
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); | |
971 #if defined(ENABLE_EXTENSIONS) | 978 #if defined(ENABLE_EXTENSIONS) |
972 host->AddFilter(new cast::CastTransportHostFilter); | 979 host->AddFilter(new cast::CastTransportHostFilter); |
973 #endif | 980 #endif |
974 #if defined(ENABLE_PRINTING) | 981 #if defined(ENABLE_PRINTING) |
975 host->AddFilter(new printing::PrintingMessageFilter(id, profile)); | 982 host->AddFilter(new printing::PrintingMessageFilter(id, profile)); |
976 #endif | 983 #endif |
977 host->AddFilter(new SearchProviderInstallStateMessageFilter(id, profile)); | 984 host->AddFilter(new SearchProviderInstallStateMessageFilter(id, profile)); |
978 #if defined(ENABLE_SPELLCHECK) | 985 #if defined(ENABLE_SPELLCHECK) |
979 host->AddFilter(new SpellCheckMessageFilter(id)); | 986 host->AddFilter(new SpellCheckMessageFilter(id)); |
980 #endif | 987 #endif |
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3047 if (channel <= kMaxDisableEncryptionChannel) { | 3054 if (channel <= kMaxDisableEncryptionChannel) { |
3048 static const char* const kWebRtcDevSwitchNames[] = { | 3055 static const char* const kWebRtcDevSwitchNames[] = { |
3049 switches::kDisableWebRtcEncryption, | 3056 switches::kDisableWebRtcEncryption, |
3050 }; | 3057 }; |
3051 to_command_line->CopySwitchesFrom(from_command_line, | 3058 to_command_line->CopySwitchesFrom(from_command_line, |
3052 kWebRtcDevSwitchNames, | 3059 kWebRtcDevSwitchNames, |
3053 arraysize(kWebRtcDevSwitchNames)); | 3060 arraysize(kWebRtcDevSwitchNames)); |
3054 } | 3061 } |
3055 } | 3062 } |
3056 #endif // defined(ENABLE_WEBRTC) | 3063 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |