| 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 "chrome/plugin/chrome_plugin_host.h" | 5 #include "chrome/plugin/chrome_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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // If we had an asynchronous operation pending, read into that buffer | 78 // If we had an asynchronous operation pending, read into that buffer |
| 79 // and inform the plugin. | 79 // and inform the plugin. |
| 80 int rv = Read(read_buffer_, read_buffer_size_); | 80 int rv = Read(read_buffer_, read_buffer_size_); |
| 81 DCHECK(rv != CPERR_IO_PENDING); | 81 DCHECK(rv != CPERR_IO_PENDING); |
| 82 read_buffer_ = NULL; | 82 read_buffer_ = NULL; |
| 83 plugin_->functions().response_funcs->read_completed( | 83 plugin_->functions().response_funcs->read_completed( |
| 84 cprequest_.get(), rv); | 84 cprequest_.get(), rv); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 virtual void OnCompletedRequest(const URLRequestStatus& status) { | 88 virtual void OnCompletedRequest(const URLRequestStatus& status, |
| 89 const std::string& security_info) { |
| 89 completed_ = true; | 90 completed_ = true; |
| 90 | 91 |
| 91 if (!status.is_success()) { | 92 if (!status.is_success()) { |
| 92 // TODO(mpcomplete): better error codes | 93 // TODO(mpcomplete): better error codes |
| 93 // Inform the plugin, calling the right function depending on whether | 94 // Inform the plugin, calling the right function depending on whether |
| 94 // we got the start_completed event or not. | 95 // we got the start_completed event or not. |
| 95 if (response_headers_) { | 96 if (response_headers_) { |
| 96 plugin_->functions().response_funcs->start_completed( | 97 plugin_->functions().response_funcs->start_completed( |
| 97 cprequest_.get(), CPERR_FAILURE); | 98 cprequest_.get(), CPERR_FAILURE); |
| 98 } else { | 99 } else { |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 response_funcs.size = sizeof(response_funcs); | 609 response_funcs.size = sizeof(response_funcs); |
| 609 response_funcs.received_redirect = CPRR_ReceivedRedirect; | 610 response_funcs.received_redirect = CPRR_ReceivedRedirect; |
| 610 response_funcs.start_completed = CPRR_StartCompleted; | 611 response_funcs.start_completed = CPRR_StartCompleted; |
| 611 response_funcs.read_completed = CPRR_ReadCompleted; | 612 response_funcs.read_completed = CPRR_ReadCompleted; |
| 612 response_funcs.upload_progress = CPRR_UploadProgress; | 613 response_funcs.upload_progress = CPRR_UploadProgress; |
| 613 } | 614 } |
| 614 | 615 |
| 615 return &browser_funcs; | 616 return &browser_funcs; |
| 616 } | 617 } |
| 617 | 618 |
| OLD | NEW |