| 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/browser/chrome_plugin_host.h" | 5 #include "chrome/browser/chrome_plugin_host.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 return true; | 185 return true; |
| 186 } | 186 } |
| 187 | 187 |
| 188 if (!request_->status().is_io_pending()) | 188 if (!request_->status().is_io_pending()) |
| 189 my_buffer_ = NULL; | 189 my_buffer_ = NULL; |
| 190 | 190 |
| 191 return false; | 191 return false; |
| 192 } | 192 } |
| 193 | 193 |
| 194 // URLRequest::Delegate | 194 // URLRequest::Delegate |
| 195 virtual void OnReceivedRedirect(URLRequest* request, const GURL& new_url, | 195 virtual void OnReceivedRedirect(URLRequest* request, const GURL& new_url) { |
| 196 bool* defer_redirect) { | |
| 197 plugin_->functions().response_funcs->received_redirect( | 196 plugin_->functions().response_funcs->received_redirect( |
| 198 cprequest_.get(), new_url.spec().c_str()); | 197 cprequest_.get(), new_url.spec().c_str()); |
| 199 } | 198 } |
| 200 | 199 |
| 201 virtual void OnResponseStarted(URLRequest* request) { | 200 virtual void OnResponseStarted(URLRequest* request) { |
| 202 // TODO(mpcomplete): better error codes | 201 // TODO(mpcomplete): better error codes |
| 203 CPError result = | 202 CPError result = |
| 204 request_->status().is_success() ? CPERR_SUCCESS : CPERR_FAILURE; | 203 request_->status().is_success() ? CPERR_SUCCESS : CPERR_FAILURE; |
| 205 plugin_->functions().response_funcs->start_completed( | 204 plugin_->functions().response_funcs->start_completed( |
| 206 cprequest_.get(), result); | 205 cprequest_.get(), result); |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 void CPHandleCommand(int command, CPCommandInterface* data, | 797 void CPHandleCommand(int command, CPCommandInterface* data, |
| 799 CPBrowsingContext context) { | 798 CPBrowsingContext context) { |
| 800 // Sadly if we try and pass context through, we seem to break cl's little | 799 // Sadly if we try and pass context through, we seem to break cl's little |
| 801 // brain trying to compile the Tuple3 ctor. This cast works. | 800 // brain trying to compile the Tuple3 ctor. This cast works. |
| 802 int32 context_as_int32 = static_cast<int32>(context); | 801 int32 context_as_int32 = static_cast<int32>(context); |
| 803 // Plugins can only be accessed on the IO thread. | 802 // Plugins can only be accessed on the IO thread. |
| 804 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 803 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
| 805 NewRunnableFunction(PluginCommandHandler::HandleCommand, | 804 NewRunnableFunction(PluginCommandHandler::HandleCommand, |
| 806 command, data, context_as_int32)); | 805 command, data, context_as_int32)); |
| 807 } | 806 } |
| OLD | NEW |