OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 } | 956 } |
957 default: { | 957 default: { |
958 NOTREACHED(); | 958 NOTREACHED(); |
959 break; | 959 break; |
960 } | 960 } |
961 } | 961 } |
962 } | 962 } |
963 | 963 |
964 void BrowserRenderProcessHost::OnExtensionAddListener( | 964 void BrowserRenderProcessHost::OnExtensionAddListener( |
965 const std::string& event_name) { | 965 const std::string& event_name) { |
966 ExtensionMessageService::GetInstance(profile()->GetRequestContext())-> | 966 if (profile()->GetExtensionMessageService()) { |
967 AddEventListener(event_name, pid()); | 967 profile()->GetExtensionMessageService()->AddEventListener(event_name, |
| 968 pid()); |
| 969 } |
968 } | 970 } |
969 | 971 |
970 void BrowserRenderProcessHost::OnExtensionRemoveListener( | 972 void BrowserRenderProcessHost::OnExtensionRemoveListener( |
971 const std::string& event_name) { | 973 const std::string& event_name) { |
972 ExtensionMessageService::GetInstance(profile()->GetRequestContext())-> | 974 if (profile()->GetExtensionMessageService()) { |
973 RemoveEventListener(event_name, pid()); | 975 profile()->GetExtensionMessageService()->RemoveEventListener(event_name, |
| 976 pid()); |
| 977 } |
974 } | 978 } |
975 | 979 |
976 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { | 980 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { |
977 ExtensionMessageService::GetInstance(profile()->GetRequestContext())-> | 981 if (profile()->GetExtensionMessageService()) { |
978 CloseChannel(port_id); | 982 profile()->GetExtensionMessageService()->CloseChannel(port_id); |
| 983 } |
979 } | 984 } |
OLD | NEW |