| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "chrome/common/net/url_request_intercept_job.h" | 33 #include "chrome/common/net/url_request_intercept_job.h" |
| 34 #include "chrome/common/plugin_messages.h" | 34 #include "chrome/common/plugin_messages.h" |
| 35 | 35 |
| 36 #include "base/gfx/png_encoder.h" | 36 #include "base/gfx/png_encoder.h" |
| 37 #include "base/logging.h" | 37 #include "base/logging.h" |
| 38 #include "base/string_util.h" | 38 #include "base/string_util.h" |
| 39 #include "googleurl/src/gurl.h" | 39 #include "googleurl/src/gurl.h" |
| 40 #include "net/base/base64.h" | 40 #include "net/base/base64.h" |
| 41 #include "skia/include/SkBitmap.h" | 41 #include "skia/include/SkBitmap.h" |
| 42 | 42 |
| 43 using base::TimeDelta; |
| 44 |
| 43 // This class manages the interception of network requests. It queries the | 45 // This class manages the interception of network requests. It queries the |
| 44 // plugin on every request, and creates an intercept job if the plugin can | 46 // plugin on every request, and creates an intercept job if the plugin can |
| 45 // intercept the request. | 47 // intercept the request. |
| 46 // NOTE: All methods must be called on the IO thread. | 48 // NOTE: All methods must be called on the IO thread. |
| 47 class PluginRequestInterceptor | 49 class PluginRequestInterceptor |
| 48 : public PluginHelper, public URLRequest::Interceptor { | 50 : public PluginHelper, public URLRequest::Interceptor { |
| 49 public: | 51 public: |
| 50 static URLRequestJob* UninterceptedProtocolHandler( | 52 static URLRequestJob* UninterceptedProtocolHandler( |
| 51 URLRequest* request, const std::string& scheme) { | 53 URLRequest* request, const std::string& scheme) { |
| 52 // This will get called if a plugin failed to intercept a request for a | 54 // This will get called if a plugin failed to intercept a request for a |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 void CPHandleCommand(int command, CPCommandInterface* data, | 750 void CPHandleCommand(int command, CPCommandInterface* data, |
| 749 CPBrowsingContext context) { | 751 CPBrowsingContext context) { |
| 750 // Sadly if we try and pass context through, we seem to break cl's little | 752 // Sadly if we try and pass context through, we seem to break cl's little |
| 751 // brain trying to compile the Tuple3 ctor. This cast works. | 753 // brain trying to compile the Tuple3 ctor. This cast works. |
| 752 int32 context_as_int32 = static_cast<int32>(context); | 754 int32 context_as_int32 = static_cast<int32>(context); |
| 753 // Plugins can only be accessed on the IO thread. | 755 // Plugins can only be accessed on the IO thread. |
| 754 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 756 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
| 755 NewRunnableFunction(PluginCommandHandler::HandleCommand, | 757 NewRunnableFunction(PluginCommandHandler::HandleCommand, |
| 756 command, data, context_as_int32)); | 758 command, data, context_as_int32)); |
| 757 } | 759 } |
| 758 | |
| OLD | NEW |