| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "third_party/WebKit/public/web/WebKit.h" | 24 #include "third_party/WebKit/public/web/WebKit.h" |
| 25 #include "third_party/npapi/bindings/npruntime.h" | 25 #include "third_party/npapi/bindings/npruntime.h" |
| 26 #include "ui/gl/gl_implementation.h" | 26 #include "ui/gl/gl_implementation.h" |
| 27 #include "ui/gl/gl_surface.h" | 27 #include "ui/gl/gl_surface.h" |
| 28 #include "webkit/common/user_agent/user_agent.h" | 28 #include "webkit/common/user_agent/user_agent.h" |
| 29 | 29 |
| 30 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
| 31 #include "base/mac/mac_util.h" | 31 #include "base/mac/mac_util.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 using WebKit::WebBindings; | 34 using blink::WebBindings; |
| 35 | 35 |
| 36 // Declarations for stub implementations of deprecated functions, which are no | 36 // Declarations for stub implementations of deprecated functions, which are no |
| 37 // longer listed in npapi.h. | 37 // longer listed in npapi.h. |
| 38 extern "C" { | 38 extern "C" { |
| 39 void* NPN_GetJavaEnv(); | 39 void* NPN_GetJavaEnv(); |
| 40 void* NPN_GetJavaPeer(NPP); | 40 void* NPN_GetJavaPeer(NPP); |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace content { | 43 namespace content { |
| 44 | 44 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 324 |
| 325 // Requests that the host free a specified amount of memory. | 325 // Requests that the host free a specified amount of memory. |
| 326 uint32_t NPN_MemFlush(uint32_t size) { | 326 uint32_t NPN_MemFlush(uint32_t size) { |
| 327 // This is not relevant on Windows; MAC specific | 327 // This is not relevant on Windows; MAC specific |
| 328 return size; | 328 return size; |
| 329 } | 329 } |
| 330 | 330 |
| 331 // This is for dynamic discovery of new plugins. | 331 // This is for dynamic discovery of new plugins. |
| 332 // Should force a re-scan of the plugins directory to load new ones. | 332 // Should force a re-scan of the plugins directory to load new ones. |
| 333 void NPN_ReloadPlugins(NPBool reload_pages) { | 333 void NPN_ReloadPlugins(NPBool reload_pages) { |
| 334 WebKit::resetPluginCache(reload_pages ? true : false); | 334 blink::resetPluginCache(reload_pages ? true : false); |
| 335 } | 335 } |
| 336 | 336 |
| 337 // Requests a range of bytes for a seekable stream. | 337 // Requests a range of bytes for a seekable stream. |
| 338 NPError NPN_RequestRead(NPStream* stream, NPByteRange* range_list) { | 338 NPError NPN_RequestRead(NPStream* stream, NPByteRange* range_list) { |
| 339 if (!stream || !range_list) | 339 if (!stream || !range_list) |
| 340 return NPERR_GENERIC_ERROR; | 340 return NPERR_GENERIC_ERROR; |
| 341 | 341 |
| 342 scoped_refptr<PluginInstance> plugin( | 342 scoped_refptr<PluginInstance> plugin( |
| 343 reinterpret_cast<PluginInstance*>(stream->ndata)); | 343 reinterpret_cast<PluginInstance*>(stream->ndata)); |
| 344 if (!plugin.get()) | 344 if (!plugin.get()) |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 } | 1100 } |
| 1101 | 1101 |
| 1102 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { | 1102 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { |
| 1103 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); | 1103 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); |
| 1104 if (plugin.get()) { | 1104 if (plugin.get()) { |
| 1105 plugin->URLRedirectResponse(!!allow, notify_data); | 1105 plugin->URLRedirectResponse(!!allow, notify_data); |
| 1106 } | 1106 } |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 } // extern "C" | 1109 } // extern "C" |
| OLD | NEW |