OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_render_message_filter.h" | 5 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 IPC_MESSAGE_HANDLER(ExtensionHostMsg_RemoveLazyListener, | 94 IPC_MESSAGE_HANDLER(ExtensionHostMsg_RemoveLazyListener, |
95 OnExtensionRemoveLazyListener) | 95 OnExtensionRemoveLazyListener) |
96 IPC_MESSAGE_HANDLER(ExtensionHostMsg_CloseChannel, OnExtensionCloseChannel) | 96 IPC_MESSAGE_HANDLER(ExtensionHostMsg_CloseChannel, OnExtensionCloseChannel) |
97 IPC_MESSAGE_HANDLER(ExtensionHostMsg_RequestForIOThread, | 97 IPC_MESSAGE_HANDLER(ExtensionHostMsg_RequestForIOThread, |
98 OnExtensionRequestForIOThread) | 98 OnExtensionRequestForIOThread) |
99 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ShouldUnloadAck, | 99 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ShouldUnloadAck, |
100 OnExtensionShouldUnloadAck) | 100 OnExtensionShouldUnloadAck) |
101 IPC_MESSAGE_HANDLER(ExtensionHostMsg_GenerateUniqueID, | 101 IPC_MESSAGE_HANDLER(ExtensionHostMsg_GenerateUniqueID, |
102 OnExtensionGenerateUniqueID) | 102 OnExtensionGenerateUniqueID) |
103 IPC_MESSAGE_HANDLER(ExtensionHostMsg_UnloadAck, OnExtensionUnloadAck) | 103 IPC_MESSAGE_HANDLER(ExtensionHostMsg_UnloadAck, OnExtensionUnloadAck) |
104 #if defined(USE_TCMALLOC) | |
105 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_WriteTcmallocHeapProfile_ACK, | |
106 OnWriteTcmallocHeapProfile) | |
107 #endif | |
108 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDatabase, OnAllowDatabase) | 104 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDatabase, OnAllowDatabase) |
109 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDOMStorage, OnAllowDOMStorage) | 105 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDOMStorage, OnAllowDOMStorage) |
110 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowFileSystem, OnAllowFileSystem) | 106 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowFileSystem, OnAllowFileSystem) |
111 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowIndexedDB, OnAllowIndexedDB) | 107 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowIndexedDB, OnAllowIndexedDB) |
112 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CanTriggerClipboardRead, | 108 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CanTriggerClipboardRead, |
113 OnCanTriggerClipboardRead) | 109 OnCanTriggerClipboardRead) |
114 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CanTriggerClipboardWrite, | 110 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CanTriggerClipboardWrite, |
115 OnCanTriggerClipboardWrite) | 111 OnCanTriggerClipboardWrite) |
116 IPC_MESSAGE_UNHANDLED(handled = false) | 112 IPC_MESSAGE_UNHANDLED(handled = false) |
117 IPC_END_MESSAGE_MAP() | 113 IPC_END_MESSAGE_MAP() |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 const std::string& extension_id) { | 406 const std::string& extension_id) { |
411 if (profile_->GetExtensionProcessManager()) | 407 if (profile_->GetExtensionProcessManager()) |
412 profile_->GetExtensionProcessManager()->OnUnloadAck(extension_id); | 408 profile_->GetExtensionProcessManager()->OnUnloadAck(extension_id); |
413 } | 409 } |
414 | 410 |
415 void ChromeRenderMessageFilter::OnExtensionGenerateUniqueID(int* unique_id) { | 411 void ChromeRenderMessageFilter::OnExtensionGenerateUniqueID(int* unique_id) { |
416 static int next_unique_id = 1; | 412 static int next_unique_id = 1; |
417 *unique_id = next_unique_id++; | 413 *unique_id = next_unique_id++; |
418 } | 414 } |
419 | 415 |
420 #if defined(USE_TCMALLOC) | |
421 void ChromeRenderMessageFilter::OnWriteTcmallocHeapProfile( | |
422 const FilePath::StringType& filepath, | |
423 const std::string& output) { | |
424 VLOG(0) << "Writing renderer heap profile dump to: " << filepath; | |
425 file_util::WriteFile(FilePath(filepath), output.c_str(), output.size()); | |
426 } | |
427 #endif | |
428 | |
429 void ChromeRenderMessageFilter::OnAllowDatabase(int render_view_id, | 416 void ChromeRenderMessageFilter::OnAllowDatabase(int render_view_id, |
430 const GURL& origin_url, | 417 const GURL& origin_url, |
431 const GURL& top_origin_url, | 418 const GURL& top_origin_url, |
432 const string16& name, | 419 const string16& name, |
433 const string16& display_name, | 420 const string16& display_name, |
434 bool* allowed) { | 421 bool* allowed) { |
435 *allowed = cookie_settings_->IsSettingCookieAllowed(origin_url, | 422 *allowed = cookie_settings_->IsSettingCookieAllowed(origin_url, |
436 top_origin_url); | 423 top_origin_url); |
437 BrowserThread::PostTask( | 424 BrowserThread::PostTask( |
438 BrowserThread::UI, FROM_HERE, | 425 BrowserThread::UI, FROM_HERE, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 500 |
514 void ChromeRenderMessageFilter::OnSetCookie(const IPC::Message& message, | 501 void ChromeRenderMessageFilter::OnSetCookie(const IPC::Message& message, |
515 const GURL& url, | 502 const GURL& url, |
516 const GURL& first_party_for_cookies, | 503 const GURL& first_party_for_cookies, |
517 const std::string& cookie) { | 504 const std::string& cookie) { |
518 #if defined(ENABLE_AUTOMATION) | 505 #if defined(ENABLE_AUTOMATION) |
519 AutomationResourceMessageFilter::SetCookiesForUrl( | 506 AutomationResourceMessageFilter::SetCookiesForUrl( |
520 render_process_id_, message.routing_id(), url, cookie); | 507 render_process_id_, message.routing_id(), url, cookie); |
521 #endif | 508 #endif |
522 } | 509 } |
OLD | NEW |