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 "content/browser/renderer_host/database_message_filter.h" | 5 #include "content/browser/renderer_host/database_message_filter.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 // Then we duplicate the file handle to make it useable in the renderer | 161 // Then we duplicate the file handle to make it useable in the renderer |
162 // process. The original handle is closed, unless we saved it in the | 162 // process. The original handle is closed, unless we saved it in the |
163 // database tracker. | 163 // database tracker. |
164 *handle = IPC::InvalidPlatformFileForTransit(); | 164 *handle = IPC::InvalidPlatformFileForTransit(); |
165 if (file.IsValid()) { | 165 if (file.IsValid()) { |
166 *handle = IPC::TakeFileHandleForProcess(std::move(file), PeerHandle()); | 166 *handle = IPC::TakeFileHandleForProcess(std::move(file), PeerHandle()); |
167 } else if (tracked_file) { | 167 } else if (tracked_file) { |
168 DCHECK(tracked_file->IsValid()); | 168 DCHECK(tracked_file->IsValid()); |
169 *handle = | 169 *handle = |
170 IPC::GetFileHandleForProcess(tracked_file->GetPlatformFile(), | 170 IPC::GetPlatformFileForTransit(tracked_file->GetPlatformFile(), false); |
171 PeerHandle(), false); | |
172 } | 171 } |
173 } | 172 } |
174 | 173 |
175 void DatabaseMessageFilter::OnDatabaseDeleteFile( | 174 void DatabaseMessageFilter::OnDatabaseDeleteFile( |
176 const base::string16& vfs_file_name, | 175 const base::string16& vfs_file_name, |
177 const bool& sync_dir, | 176 const bool& sync_dir, |
178 IPC::Message* reply_msg) { | 177 IPC::Message* reply_msg) { |
179 DatabaseDeleteFile(vfs_file_name, sync_dir, reply_msg, kNumDeleteRetries); | 178 DatabaseDeleteFile(vfs_file_name, sync_dir, reply_msg, kNumDeleteRetries); |
180 } | 179 } |
181 | 180 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 } | 377 } |
379 | 378 |
380 void DatabaseMessageFilter::OnDatabaseScheduledForDeletion( | 379 void DatabaseMessageFilter::OnDatabaseScheduledForDeletion( |
381 const std::string& origin_identifier, | 380 const std::string& origin_identifier, |
382 const base::string16& database_name) { | 381 const base::string16& database_name) { |
383 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 382 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
384 Send(new DatabaseMsg_CloseImmediately(origin_identifier, database_name)); | 383 Send(new DatabaseMsg_CloseImmediately(origin_identifier, database_name)); |
385 } | 384 } |
386 | 385 |
387 } // namespace content | 386 } // namespace content |
OLD | NEW |