OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/shell_message_filter.h" | 5 #include "content/shell/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 "content/public/browser/child_process_security_policy.h" | 9 #include "content/public/browser/child_process_security_policy.h" |
9 #include "content/shell/shell_messages.h" | 10 #include "content/shell/shell_messages.h" |
10 #include "content/shell/shell_network_delegate.h" | 11 #include "content/shell/shell_network_delegate.h" |
11 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
12 #include "webkit/database/database_tracker.h" | 13 #include "webkit/database/database_tracker.h" |
13 #include "webkit/fileapi/isolated_context.h" | 14 #include "webkit/fileapi/isolated_context.h" |
14 #include "webkit/quota/quota_manager.h" | 15 #include "webkit/quota/quota_manager.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
(...skipping 26 matching lines...) Expand all Loading... |
44 IPC_MESSAGE_HANDLER(ShellViewHostMsg_SetDatabaseQuota, OnSetDatabaseQuota) | 45 IPC_MESSAGE_HANDLER(ShellViewHostMsg_SetDatabaseQuota, OnSetDatabaseQuota) |
45 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AcceptAllCookies, OnAcceptAllCookies) | 46 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AcceptAllCookies, OnAcceptAllCookies) |
46 IPC_MESSAGE_UNHANDLED(handled = false) | 47 IPC_MESSAGE_UNHANDLED(handled = false) |
47 IPC_END_MESSAGE_MAP() | 48 IPC_END_MESSAGE_MAP() |
48 | 49 |
49 return handled; | 50 return handled; |
50 } | 51 } |
51 | 52 |
52 void ShellMessageFilter::OnReadFileToString(const base::FilePath& local_file, | 53 void ShellMessageFilter::OnReadFileToString(const base::FilePath& local_file, |
53 std::string* contents) { | 54 std::string* contents) { |
| 55 base::ThreadRestrictions::ScopedAllowIO allow_io; |
54 file_util::ReadFileToString(local_file, contents); | 56 file_util::ReadFileToString(local_file, contents); |
55 } | 57 } |
56 | 58 |
57 void ShellMessageFilter::OnRegisterIsolatedFileSystem( | 59 void ShellMessageFilter::OnRegisterIsolatedFileSystem( |
58 const std::vector<base::FilePath>& absolute_filenames, | 60 const std::vector<base::FilePath>& absolute_filenames, |
59 std::string* filesystem_id) { | 61 std::string* filesystem_id) { |
60 fileapi::IsolatedContext::FileInfoSet files; | 62 fileapi::IsolatedContext::FileInfoSet files; |
61 ChildProcessSecurityPolicy* policy = | 63 ChildProcessSecurityPolicy* policy = |
62 ChildProcessSecurityPolicy::GetInstance(); | 64 ChildProcessSecurityPolicy::GetInstance(); |
63 for (size_t i = 0; i < absolute_filenames.size(); ++i) { | 65 for (size_t i = 0; i < absolute_filenames.size(); ++i) { |
(...skipping 16 matching lines...) Expand all Loading... |
80 quota_manager_->SetTemporaryGlobalOverrideQuota( | 82 quota_manager_->SetTemporaryGlobalOverrideQuota( |
81 quota * quota::QuotaManager::kPerHostTemporaryPortion, | 83 quota * quota::QuotaManager::kPerHostTemporaryPortion, |
82 quota::QuotaCallback()); | 84 quota::QuotaCallback()); |
83 } | 85 } |
84 | 86 |
85 void ShellMessageFilter::OnAcceptAllCookies(bool accept) { | 87 void ShellMessageFilter::OnAcceptAllCookies(bool accept) { |
86 ShellNetworkDelegate::SetAcceptAllCookies(accept); | 88 ShellNetworkDelegate::SetAcceptAllCookies(accept); |
87 } | 89 } |
88 | 90 |
89 } // namespace content | 91 } // namespace content |
OLD | NEW |