| 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/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/common/chrome_constants.h" | 9 #include "chrome/common/chrome_constants.h" |
| 10 #include "chrome/common/chrome_plugin_lib.h" | 10 #include "chrome/common/chrome_plugin_lib.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // If we had an asynchronous operation pending, read into that buffer | 79 // If we had an asynchronous operation pending, read into that buffer |
| 80 // and inform the plugin. | 80 // and inform the plugin. |
| 81 int rv = Read(read_buffer_, read_buffer_size_); | 81 int rv = Read(read_buffer_, read_buffer_size_); |
| 82 DCHECK(rv != CPERR_IO_PENDING); | 82 DCHECK(rv != CPERR_IO_PENDING); |
| 83 read_buffer_ = NULL; | 83 read_buffer_ = NULL; |
| 84 plugin_->functions().response_funcs->read_completed( | 84 plugin_->functions().response_funcs->read_completed( |
| 85 cprequest_.get(), rv); | 85 cprequest_.get(), rv); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 virtual void OnCompletedRequest(const URLRequestStatus& status) { | 89 virtual void OnCompletedRequest(const URLRequestStatus& status, |
| 90 const std::string& security_info) { |
| 90 completed_ = true; | 91 completed_ = true; |
| 91 | 92 |
| 92 if (!status.is_success()) { | 93 if (!status.is_success()) { |
| 93 // TODO(mpcomplete): better error codes | 94 // TODO(mpcomplete): better error codes |
| 94 // Inform the plugin, calling the right function depending on whether | 95 // Inform the plugin, calling the right function depending on whether |
| 95 // we got the start_completed event or not. | 96 // we got the start_completed event or not. |
| 96 if (response_headers_) { | 97 if (response_headers_) { |
| 97 plugin_->functions().response_funcs->start_completed( | 98 plugin_->functions().response_funcs->start_completed( |
| 98 cprequest_.get(), CPERR_FAILURE); | 99 cprequest_.get(), CPERR_FAILURE); |
| 99 } else { | 100 } else { |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 638 |
| 638 response_funcs.size = sizeof(response_funcs); | 639 response_funcs.size = sizeof(response_funcs); |
| 639 response_funcs.received_redirect = CPRR_ReceivedRedirect; | 640 response_funcs.received_redirect = CPRR_ReceivedRedirect; |
| 640 response_funcs.start_completed = CPRR_StartCompleted; | 641 response_funcs.start_completed = CPRR_StartCompleted; |
| 641 response_funcs.read_completed = CPRR_ReadCompleted; | 642 response_funcs.read_completed = CPRR_ReadCompleted; |
| 642 response_funcs.upload_progress = CPRR_UploadProgress; | 643 response_funcs.upload_progress = CPRR_UploadProgress; |
| 643 } | 644 } |
| 644 | 645 |
| 645 return &browser_funcs; | 646 return &browser_funcs; |
| 646 } | 647 } |
| OLD | NEW |