| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 net::FileURLToFilePath(file_url, &file_path); | 467 net::FileURLToFilePath(file_url, &file_path); |
| 468 } else { | 468 } else { |
| 469 file_path = base::FilePath::FromUTF8Unsafe(file_path_ascii); | 469 file_path = base::FilePath::FromUTF8Unsafe(file_path_ascii); |
| 470 } | 470 } |
| 471 | 471 |
| 472 base::PlatformFileInfo post_file_info; | 472 base::PlatformFileInfo post_file_info; |
| 473 if (!file_util::GetFileInfo(file_path, &post_file_info) || | 473 if (!file_util::GetFileInfo(file_path, &post_file_info) || |
| 474 post_file_info.is_directory) | 474 post_file_info.is_directory) |
| 475 return NPERR_FILE_NOT_FOUND; | 475 return NPERR_FILE_NOT_FOUND; |
| 476 | 476 |
| 477 if (!file_util::ReadFileToString(file_path, &post_file_contents)) | 477 if (!base::ReadFileToString(file_path, &post_file_contents)) |
| 478 return NPERR_FILE_NOT_FOUND; | 478 return NPERR_FILE_NOT_FOUND; |
| 479 | 479 |
| 480 buf = post_file_contents.c_str(); | 480 buf = post_file_contents.c_str(); |
| 481 len = post_file_contents.size(); | 481 len = post_file_contents.size(); |
| 482 } | 482 } |
| 483 | 483 |
| 484 // The post data sent by a plugin contains both headers | 484 // The post data sent by a plugin contains both headers |
| 485 // and post data. Example: | 485 // and post data. Example: |
| 486 // Content-type: text/html | 486 // Content-type: text/html |
| 487 // Content-length: 200 | 487 // Content-length: 200 |
| (...skipping 612 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 |