| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/renderer_host/resource_message_filter.h" | 5 #include "chrome/browser/renderer_host/resource_message_filter.h" |
| 6 | 6 |
| 7 #include "app/clipboard/clipboard.h" | 7 #include "app/clipboard/clipboard.h" |
| 8 #include "app/gfx/native_widget_types.h" | 8 #include "app/gfx/native_widget_types.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/common/chrome_plugin_lib.h" | 39 #include "chrome/common/chrome_plugin_lib.h" |
| 40 #include "chrome/common/chrome_plugin_util.h" | 40 #include "chrome/common/chrome_plugin_util.h" |
| 41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
| 42 #include "chrome/common/histogram_synchronizer.h" | 42 #include "chrome/common/histogram_synchronizer.h" |
| 43 #include "chrome/common/notification_service.h" | 43 #include "chrome/common/notification_service.h" |
| 44 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
| 45 #include "chrome/common/pref_service.h" | 45 #include "chrome/common/pref_service.h" |
| 46 #include "chrome/common/render_messages.h" | 46 #include "chrome/common/render_messages.h" |
| 47 #include "chrome/common/url_constants.h" | 47 #include "chrome/common/url_constants.h" |
| 48 #include "chrome/common/worker_messages.h" | 48 #include "chrome/common/worker_messages.h" |
| 49 #include "net/base/keygen_handler.h" |
| 49 #include "net/base/mime_util.h" | 50 #include "net/base/mime_util.h" |
| 50 #include "net/base/load_flags.h" | 51 #include "net/base/load_flags.h" |
| 51 #include "net/http/http_cache.h" | 52 #include "net/http/http_cache.h" |
| 52 #include "net/http/http_transaction_factory.h" | 53 #include "net/http/http_transaction_factory.h" |
| 53 #include "net/url_request/url_request_context.h" | 54 #include "net/url_request/url_request_context.h" |
| 54 #include "webkit/glue/plugins/plugin_list.h" | 55 #include "webkit/glue/plugins/plugin_list.h" |
| 55 #include "webkit/glue/webkit_glue.h" | 56 #include "webkit/glue/webkit_glue.h" |
| 56 #include "webkit/glue/webplugin.h" | 57 #include "webkit/glue/webplugin.h" |
| 57 | 58 |
| 58 #if defined(OS_WIN) || defined(OS_MACOSX) | 59 #if defined(OS_WIN) || defined(OS_MACOSX) |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 IPC_MESSAGE_HANDLER(ViewHostMsg_FreeTransportDIB, | 375 IPC_MESSAGE_HANDLER(ViewHostMsg_FreeTransportDIB, |
| 375 OnFreeTransportDIB) | 376 OnFreeTransportDIB) |
| 376 #endif | 377 #endif |
| 377 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenChannelToExtension, | 378 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenChannelToExtension, |
| 378 OnOpenChannelToExtension) | 379 OnOpenChannelToExtension) |
| 379 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenChannelToTab, OnOpenChannelToTab) | 380 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenChannelToTab, OnOpenChannelToTab) |
| 380 IPC_MESSAGE_HANDLER(ViewHostMsg_CloseIdleConnections, | 381 IPC_MESSAGE_HANDLER(ViewHostMsg_CloseIdleConnections, |
| 381 OnCloseIdleConnections) | 382 OnCloseIdleConnections) |
| 382 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCacheMode, OnSetCacheMode) | 383 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCacheMode, OnSetCacheMode) |
| 383 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetFileSize, OnGetFileSize) | 384 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_GetFileSize, OnGetFileSize) |
| 385 IPC_MESSAGE_HANDLER(ViewHostMsg_Keygen, OnKeygen) |
| 384 #if defined(USE_TCMALLOC) | 386 #if defined(USE_TCMALLOC) |
| 385 IPC_MESSAGE_HANDLER(ViewHostMsg_RendererTcmalloc, OnRendererTcmalloc) | 387 IPC_MESSAGE_HANDLER(ViewHostMsg_RendererTcmalloc, OnRendererTcmalloc) |
| 386 #endif | 388 #endif |
| 387 | 389 |
| 388 IPC_MESSAGE_UNHANDLED( | 390 IPC_MESSAGE_UNHANDLED( |
| 389 handled = false) | 391 handled = false) |
| 390 IPC_END_MESSAGE_MAP_EX() | 392 IPC_END_MESSAGE_MAP_EX() |
| 391 } | 393 } |
| 392 | 394 |
| 393 if (!msg_is_ok) { | 395 if (!msg_is_ok) { |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 | 1105 |
| 1104 void ResourceMessageFilter::ReplyGetFileSize(int64 result, void* param) { | 1106 void ResourceMessageFilter::ReplyGetFileSize(int64 result, void* param) { |
| 1105 IPC::Message* reply_msg = static_cast<IPC::Message*>(param); | 1107 IPC::Message* reply_msg = static_cast<IPC::Message*>(param); |
| 1106 ViewHostMsg_GetFileSize::WriteReplyParams(reply_msg, result); | 1108 ViewHostMsg_GetFileSize::WriteReplyParams(reply_msg, result); |
| 1107 Send(reply_msg); | 1109 Send(reply_msg); |
| 1108 | 1110 |
| 1109 // Getting file size callback done, decrease the ref count. | 1111 // Getting file size callback done, decrease the ref count. |
| 1110 Release(); | 1112 Release(); |
| 1111 } | 1113 } |
| 1112 | 1114 |
| 1115 void ResourceMessageFilter::OnKeygen(uint32 key_size_index, |
| 1116 const std::string& challenge_string, |
| 1117 const GURL& url, |
| 1118 std::string* signed_public_key) { |
| 1119 scoped_ptr<net::KeygenHandler> keygen_handler( |
| 1120 new net::KeygenHandler(key_size_index, |
| 1121 challenge_string)); |
| 1122 *signed_public_key = keygen_handler->GenKeyAndSignChallenge(); |
| 1123 } |
| 1124 |
| 1113 #if defined(USE_TCMALLOC) | 1125 #if defined(USE_TCMALLOC) |
| 1114 void ResourceMessageFilter::OnRendererTcmalloc(base::ProcessId pid, | 1126 void ResourceMessageFilter::OnRendererTcmalloc(base::ProcessId pid, |
| 1115 const std::string& output) { | 1127 const std::string& output) { |
| 1116 ui_loop()->PostTask(FROM_HERE, | 1128 ui_loop()->PostTask(FROM_HERE, |
| 1117 NewRunnableFunction(AboutTcmallocRendererCallback, pid, output)); | 1129 NewRunnableFunction(AboutTcmallocRendererCallback, pid, output)); |
| 1118 } | 1130 } |
| 1119 #endif | 1131 #endif |
| OLD | NEW |