OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // If we had an asynchronous operation pending, read into that buffer | 104 // If we had an asynchronous operation pending, read into that buffer |
105 // and inform the plugin. | 105 // and inform the plugin. |
106 int rv = Read(read_buffer_, read_buffer_size_); | 106 int rv = Read(read_buffer_, read_buffer_size_); |
107 DCHECK(rv != CPERR_IO_PENDING); | 107 DCHECK(rv != CPERR_IO_PENDING); |
108 read_buffer_ = NULL; | 108 read_buffer_ = NULL; |
109 plugin_->functions().response_funcs->read_completed( | 109 plugin_->functions().response_funcs->read_completed( |
110 cprequest_.get(), rv); | 110 cprequest_.get(), rv); |
111 } | 111 } |
112 } | 112 } |
113 | 113 |
114 virtual void OnCompletedRequest(const URLRequestStatus& status, | 114 virtual void OnCompletedRequest(const net::URLRequestStatus& status, |
115 const std::string& security_info, | 115 const std::string& security_info, |
116 const base::Time& completion_time) { | 116 const base::Time& completion_time) { |
117 completed_ = true; | 117 completed_ = true; |
118 | 118 |
119 if (!status.is_success()) { | 119 if (!status.is_success()) { |
120 // TODO(mpcomplete): better error codes | 120 // TODO(mpcomplete): better error codes |
121 // Inform the plugin, calling the right function depending on whether | 121 // Inform the plugin, calling the right function depending on whether |
122 // we got the start_completed event or not. | 122 // we got the start_completed event or not. |
123 if (response_headers_) { | 123 if (response_headers_) { |
124 plugin_->functions().response_funcs->start_completed( | 124 plugin_->functions().response_funcs->start_completed( |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 | 721 |
722 response_funcs.size = sizeof(response_funcs); | 722 response_funcs.size = sizeof(response_funcs); |
723 response_funcs.received_redirect = CPRR_ReceivedRedirect; | 723 response_funcs.received_redirect = CPRR_ReceivedRedirect; |
724 response_funcs.start_completed = CPRR_StartCompleted; | 724 response_funcs.start_completed = CPRR_StartCompleted; |
725 response_funcs.read_completed = CPRR_ReadCompleted; | 725 response_funcs.read_completed = CPRR_ReadCompleted; |
726 response_funcs.upload_progress = CPRR_UploadProgress; | 726 response_funcs.upload_progress = CPRR_UploadProgress; |
727 } | 727 } |
728 | 728 |
729 return &browser_funcs; | 729 return &browser_funcs; |
730 } | 730 } |
OLD | NEW |