OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell_message_filter.h" | 5 #include "content/shell/browser/shell_message_filter.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
9 #include "content/public/browser/child_process_security_policy.h" | 9 #include "content/public/browser/child_process_security_policy.h" |
10 #include "content/shell/browser/shell_browser_context.h" | 10 #include "content/shell/browser/shell_browser_context.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 ShellMessageFilter::~ShellMessageFilter() { | 36 ShellMessageFilter::~ShellMessageFilter() { |
37 } | 37 } |
38 | 38 |
39 void ShellMessageFilter::OverrideThreadForMessage(const IPC::Message& message, | 39 void ShellMessageFilter::OverrideThreadForMessage(const IPC::Message& message, |
40 BrowserThread::ID* thread) { | 40 BrowserThread::ID* thread) { |
41 if (message.type() == ShellViewHostMsg_ClearAllDatabases::ID) | 41 if (message.type() == ShellViewHostMsg_ClearAllDatabases::ID) |
42 *thread = BrowserThread::FILE; | 42 *thread = BrowserThread::FILE; |
43 } | 43 } |
44 | 44 |
45 bool ShellMessageFilter::OnMessageReceived(const IPC::Message& message, | 45 bool ShellMessageFilter::OnMessageReceived(const IPC::Message& message) { |
46 bool* message_was_ok) { | |
47 bool handled = true; | 46 bool handled = true; |
48 IPC_BEGIN_MESSAGE_MAP_EX(ShellMessageFilter, message, *message_was_ok) | 47 IPC_BEGIN_MESSAGE_MAP(ShellMessageFilter, message) |
49 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ReadFileToString, OnReadFileToString) | 48 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ReadFileToString, OnReadFileToString) |
50 IPC_MESSAGE_HANDLER(ShellViewHostMsg_RegisterIsolatedFileSystem, | 49 IPC_MESSAGE_HANDLER(ShellViewHostMsg_RegisterIsolatedFileSystem, |
51 OnRegisterIsolatedFileSystem) | 50 OnRegisterIsolatedFileSystem) |
52 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ClearAllDatabases, OnClearAllDatabases) | 51 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ClearAllDatabases, OnClearAllDatabases) |
53 IPC_MESSAGE_HANDLER(ShellViewHostMsg_SetDatabaseQuota, OnSetDatabaseQuota) | 52 IPC_MESSAGE_HANDLER(ShellViewHostMsg_SetDatabaseQuota, OnSetDatabaseQuota) |
54 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AcceptAllCookies, OnAcceptAllCookies) | 53 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AcceptAllCookies, OnAcceptAllCookies) |
55 IPC_MESSAGE_HANDLER(ShellViewHostMsg_DeleteAllCookies, OnDeleteAllCookies) | 54 IPC_MESSAGE_HANDLER(ShellViewHostMsg_DeleteAllCookies, OnDeleteAllCookies) |
56 IPC_MESSAGE_UNHANDLED(handled = false) | 55 IPC_MESSAGE_UNHANDLED(handled = false) |
57 IPC_END_MESSAGE_MAP() | 56 IPC_END_MESSAGE_MAP() |
58 | 57 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 ShellNetworkDelegate::SetAcceptAllCookies(accept); | 96 ShellNetworkDelegate::SetAcceptAllCookies(accept); |
98 } | 97 } |
99 | 98 |
100 void ShellMessageFilter::OnDeleteAllCookies() { | 99 void ShellMessageFilter::OnDeleteAllCookies() { |
101 request_context_getter_->GetURLRequestContext()->cookie_store() | 100 request_context_getter_->GetURLRequestContext()->cookie_store() |
102 ->GetCookieMonster() | 101 ->GetCookieMonster() |
103 ->DeleteAllAsync(net::CookieMonster::DeleteCallback()); | 102 ->DeleteAllAsync(net::CookieMonster::DeleteCallback()); |
104 } | 103 } |
105 | 104 |
106 } // namespace content | 105 } // namespace content |
OLD | NEW |