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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 IPC_MESSAGE_HANDLER(ShellViewHostMsg_DeleteAllCookies, OnDeleteAllCookies) | 54 IPC_MESSAGE_HANDLER(ShellViewHostMsg_DeleteAllCookies, OnDeleteAllCookies) |
55 IPC_MESSAGE_UNHANDLED(handled = false) | 55 IPC_MESSAGE_UNHANDLED(handled = false) |
56 IPC_END_MESSAGE_MAP() | 56 IPC_END_MESSAGE_MAP() |
57 | 57 |
58 return handled; | 58 return handled; |
59 } | 59 } |
60 | 60 |
61 void ShellMessageFilter::OnReadFileToString(const base::FilePath& local_file, | 61 void ShellMessageFilter::OnReadFileToString(const base::FilePath& local_file, |
62 std::string* contents) { | 62 std::string* contents) { |
63 base::ThreadRestrictions::ScopedAllowIO allow_io; | 63 base::ThreadRestrictions::ScopedAllowIO allow_io; |
64 file_util::ReadFileToString(local_file, contents); | 64 base::ReadFileToString(local_file, contents); |
65 } | 65 } |
66 | 66 |
67 void ShellMessageFilter::OnRegisterIsolatedFileSystem( | 67 void ShellMessageFilter::OnRegisterIsolatedFileSystem( |
68 const std::vector<base::FilePath>& absolute_filenames, | 68 const std::vector<base::FilePath>& absolute_filenames, |
69 std::string* filesystem_id) { | 69 std::string* filesystem_id) { |
70 fileapi::IsolatedContext::FileInfoSet files; | 70 fileapi::IsolatedContext::FileInfoSet files; |
71 ChildProcessSecurityPolicy* policy = | 71 ChildProcessSecurityPolicy* policy = |
72 ChildProcessSecurityPolicy::GetInstance(); | 72 ChildProcessSecurityPolicy::GetInstance(); |
73 for (size_t i = 0; i < absolute_filenames.size(); ++i) { | 73 for (size_t i = 0; i < absolute_filenames.size(); ++i) { |
74 files.AddPath(absolute_filenames[i], NULL); | 74 files.AddPath(absolute_filenames[i], NULL); |
(...skipping 21 matching lines...) Expand all Loading... |
96 ShellNetworkDelegate::SetAcceptAllCookies(accept); | 96 ShellNetworkDelegate::SetAcceptAllCookies(accept); |
97 } | 97 } |
98 | 98 |
99 void ShellMessageFilter::OnDeleteAllCookies() { | 99 void ShellMessageFilter::OnDeleteAllCookies() { |
100 request_context_getter_->GetURLRequestContext()->cookie_store() | 100 request_context_getter_->GetURLRequestContext()->cookie_store() |
101 ->GetCookieMonster() | 101 ->GetCookieMonster() |
102 ->DeleteAllAsync(net::CookieMonster::DeleteCallback()); | 102 ->DeleteAllAsync(net::CookieMonster::DeleteCallback()); |
103 } | 103 } |
104 | 104 |
105 } // namespace content | 105 } // namespace content |
OLD | NEW |