| 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 "content/child/npapi/plugin_host.h" | 5 #include "content/child/npapi/plugin_host.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 return NULL; | 47 return NULL; |
| 48 } | 48 } |
| 49 return reinterpret_cast<PluginInstance*>(id->ndata); | 49 return reinterpret_cast<PluginInstance*>(id->ndata); |
| 50 } | 50 } |
| 51 | 51 |
| 52 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
| 53 // Returns true if Core Animation plugins are supported. This requires that the | 53 // Returns true if Core Animation plugins are supported. This requires that the |
| 54 // OS supports shared accelerated surfaces via IOSurface. This is true on Snow | 54 // OS supports shared accelerated surfaces via IOSurface. This is true on Snow |
| 55 // Leopard and higher. | 55 // Leopard and higher. |
| 56 static bool SupportsCoreAnimationPlugins() { | 56 static bool SupportsCoreAnimationPlugins() { |
| 57 if (CommandLine::ForCurrentProcess()->HasSwitch( | 57 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 58 switches::kDisableCoreAnimationPlugins)) | 58 switches::kDisableCoreAnimationPlugins)) |
| 59 return false; | 59 return false; |
| 60 // We also need to be running with desktop GL and not the software | 60 // We also need to be running with desktop GL and not the software |
| 61 // OSMesa renderer in order to share accelerated surfaces between | 61 // OSMesa renderer in order to share accelerated surfaces between |
| 62 // processes. Because on MacOS we lazy-initialize GLSurface in the | 62 // processes. Because on MacOS we lazy-initialize GLSurface in the |
| 63 // renderer process here, ensure we're not also initializing GL somewhere | 63 // renderer process here, ensure we're not also initializing GL somewhere |
| 64 // else, and that we only do this once. | 64 // else, and that we only do this once. |
| 65 static gfx::GLImplementation implementation = gfx::kGLImplementationNone; | 65 static gfx::GLImplementation implementation = gfx::kGLImplementationNone; |
| 66 if (implementation == gfx::kGLImplementationNone) { | 66 if (implementation == gfx::kGLImplementationNone) { |
| 67 // Not initialized yet. | 67 // Not initialized yet. |
| 68 DCHECK_EQ(implementation, gfx::GetGLImplementation()) | 68 DCHECK_EQ(implementation, gfx::GetGLImplementation()) |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { | 1099 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { |
| 1100 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); | 1100 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); |
| 1101 if (plugin.get()) { | 1101 if (plugin.get()) { |
| 1102 plugin->URLRedirectResponse(!!allow, notify_data); | 1102 plugin->URLRedirectResponse(!!allow, notify_data); |
| 1103 } | 1103 } |
| 1104 } | 1104 } |
| 1105 | 1105 |
| 1106 } // extern "C" | 1106 } // extern "C" |
| OLD | NEW |