| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 return true; | 182 return true; |
| 183 } | 183 } |
| 184 | 184 |
| 185 if (!request_->status().is_io_pending()) | 185 if (!request_->status().is_io_pending()) |
| 186 my_buffer_ = NULL; | 186 my_buffer_ = NULL; |
| 187 | 187 |
| 188 return false; | 188 return false; |
| 189 } | 189 } |
| 190 | 190 |
| 191 // URLRequest::Delegate | 191 // URLRequest::Delegate |
| 192 virtual void OnReceivedRedirect(URLRequest* request, const GURL& new_url) { | 192 virtual void OnReceivedRedirect(URLRequest* request, const GURL& new_url, |
| 193 bool* defer_redirect) { |
| 193 plugin_->functions().response_funcs->received_redirect( | 194 plugin_->functions().response_funcs->received_redirect( |
| 194 cprequest_.get(), new_url.spec().c_str()); | 195 cprequest_.get(), new_url.spec().c_str()); |
| 195 } | 196 } |
| 196 | 197 |
| 197 virtual void OnResponseStarted(URLRequest* request) { | 198 virtual void OnResponseStarted(URLRequest* request) { |
| 198 // TODO(mpcomplete): better error codes | 199 // TODO(mpcomplete): better error codes |
| 199 CPError result = | 200 CPError result = |
| 200 request_->status().is_success() ? CPERR_SUCCESS : CPERR_FAILURE; | 201 request_->status().is_success() ? CPERR_SUCCESS : CPERR_FAILURE; |
| 201 plugin_->functions().response_funcs->start_completed( | 202 plugin_->functions().response_funcs->start_completed( |
| 202 cprequest_.get(), result); | 203 cprequest_.get(), result); |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 void CPHandleCommand(int command, CPCommandInterface* data, | 813 void CPHandleCommand(int command, CPCommandInterface* data, |
| 813 CPBrowsingContext context) { | 814 CPBrowsingContext context) { |
| 814 // Sadly if we try and pass context through, we seem to break cl's little | 815 // Sadly if we try and pass context through, we seem to break cl's little |
| 815 // brain trying to compile the Tuple3 ctor. This cast works. | 816 // brain trying to compile the Tuple3 ctor. This cast works. |
| 816 int32 context_as_int32 = static_cast<int32>(context); | 817 int32 context_as_int32 = static_cast<int32>(context); |
| 817 // Plugins can only be accessed on the IO thread. | 818 // Plugins can only be accessed on the IO thread. |
| 818 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 819 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
| 819 NewRunnableFunction(PluginCommandHandler::HandleCommand, | 820 NewRunnableFunction(PluginCommandHandler::HandleCommand, |
| 820 command, data, context_as_int32)); | 821 command, data, context_as_int32)); |
| 821 } | 822 } |
| OLD | NEW |