| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "webkit/glue/plugins/plugin_host.h" | 5 #include "webkit/glue/plugins/plugin_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "webkit/default_plugin/default_plugin_shared.h" | 10 #include "webkit/default_plugin/default_plugin_shared.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } | 388 } |
| 389 | 389 |
| 390 // This is for dynamic discovery of new plugins. | 390 // This is for dynamic discovery of new plugins. |
| 391 // Should force a re-scan of the plugins directory to load new ones. | 391 // Should force a re-scan of the plugins directory to load new ones. |
| 392 void NPN_ReloadPlugins(NPBool reloadPages) { | 392 void NPN_ReloadPlugins(NPBool reloadPages) { |
| 393 // TODO: implement me | 393 // TODO: implement me |
| 394 DLOG(INFO) << "NPN_ReloadPlugin is not implemented yet."; | 394 DLOG(INFO) << "NPN_ReloadPlugin is not implemented yet."; |
| 395 } | 395 } |
| 396 | 396 |
| 397 // Requests a range of bytes for a seekable stream. | 397 // Requests a range of bytes for a seekable stream. |
| 398 NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) { | 398 NPError NPN_RequestRead(NPStream* stream, NPByteRange* range_list) { |
| 399 // TODO: implement me | 399 if (!stream || !range_list) { |
| 400 DLOG(INFO) << "NPN_RequestedRead is not implemented yet."; | 400 return NPERR_GENERIC_ERROR; |
| 401 return NPERR_GENERIC_ERROR; | 401 } |
| 402 |
| 403 scoped_refptr<NPAPI::PluginInstance> plugin = |
| 404 reinterpret_cast<NPAPI::PluginInstance*>(stream->ndata); |
| 405 if (!plugin.get()) { |
| 406 return NPERR_GENERIC_ERROR; |
| 407 } |
| 408 |
| 409 plugin->RequestRead(stream, range_list); |
| 410 return NPERR_NO_ERROR; |
| 402 } | 411 } |
| 403 | 412 |
| 404 static bool IsJavaScriptUrl(const std::string& url) { | 413 static bool IsJavaScriptUrl(const std::string& url) { |
| 405 return StartsWithASCII(url, "javascript:", false); | 414 return StartsWithASCII(url, "javascript:", false); |
| 406 } | 415 } |
| 407 | 416 |
| 408 // Generic form of GetURL for common code between | 417 // Generic form of GetURL for common code between |
| 409 // GetURL() and GetURLNotify(). | 418 // GetURL() and GetURLNotify(). |
| 410 static NPError GetURLNotify(NPP id, | 419 static NPError GetURLNotify(NPP id, |
| 411 const char* url, | 420 const char* url, |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 NPObject* obj, | 875 NPObject* obj, |
| 867 const NPVariant *args, | 876 const NPVariant *args, |
| 868 uint32_t argCount, | 877 uint32_t argCount, |
| 869 NPVariant *result) { | 878 NPVariant *result) { |
| 870 NOTREACHED(); | 879 NOTREACHED(); |
| 871 return false; | 880 return false; |
| 872 } | 881 } |
| 873 | 882 |
| 874 } // extern "C" | 883 } // extern "C" |
| 875 | 884 |
| OLD | NEW |