OLD | NEW |
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2011 The Native Client 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 "native_client/src/shared/ppapi_proxy/browser_globals.h" | 5 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <map> | 10 #include <map> |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 NaClSrpcChannel* GetMainSrpcChannel(PP_Instance instance) { | 165 NaClSrpcChannel* GetMainSrpcChannel(PP_Instance instance) { |
166 return LookupBrowserPppForInstance(instance)->main_channel(); | 166 return LookupBrowserPppForInstance(instance)->main_channel(); |
167 } | 167 } |
168 | 168 |
169 void CleanUpAfterDeadNexe(PP_Instance instance) { | 169 void CleanUpAfterDeadNexe(PP_Instance instance) { |
170 DebugPrintf("CleanUpAfterDeadNexe\n"); | 170 DebugPrintf("CleanUpAfterDeadNexe\n"); |
171 BrowserPpp* proxy = LookupBrowserPppForInstance(instance); | 171 BrowserPpp* proxy = LookupBrowserPppForInstance(instance); |
172 if (proxy == NULL) | 172 if (proxy == NULL) |
173 return; | 173 return; |
174 proxy->ShutdownModule(); | 174 proxy->plugin()->ReportDeadNexe(); // Shuts down and deletes the proxy. |
175 proxy->plugin()->ReportDeadNexe(); // Deletes the proxy. | |
176 } | 175 } |
177 | 176 |
178 void SetPPBGetInterface(PPB_GetInterface get_interface_function, | 177 void SetPPBGetInterface(PPB_GetInterface get_interface_function, |
179 bool dev_interface) { | 178 bool dev_interface) { |
180 get_interface = get_interface_function; | 179 get_interface = get_interface_function; |
181 plugin_requests_dev_interface = dev_interface; | 180 plugin_requests_dev_interface = dev_interface; |
182 } | 181 } |
183 | 182 |
184 const void* GetBrowserInterface(const char* interface_name) { | 183 const void* GetBrowserInterface(const char* interface_name) { |
185 // Reject suspiciously long interface strings. | 184 // Reject suspiciously long interface strings. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 386 |
388 // Private interfaces. | 387 // Private interfaces. |
389 const PPB_PDF* PPBPDFInterface() { | 388 const PPB_PDF* PPBPDFInterface() { |
390 static const PPB_PDF* ppb = | 389 static const PPB_PDF* ppb = |
391 static_cast<const PPB_PDF*>( | 390 static_cast<const PPB_PDF*>( |
392 GetBrowserInterfaceSafe(PPB_PDF_INTERFACE)); | 391 GetBrowserInterfaceSafe(PPB_PDF_INTERFACE)); |
393 return ppb; | 392 return ppb; |
394 } | 393 } |
395 | 394 |
396 } // namespace ppapi_proxy | 395 } // namespace ppapi_proxy |
OLD | NEW |