Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: chrome/browser/renderer_host/database_dispatcher_host.cc

Issue 2166003: Merge 46700 - Don't bother returning the directory descriptor for SQLite.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/375/src/
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/database_dispatcher_host.h" 5 #include "chrome/browser/renderer_host/database_dispatcher_host.h"
6 6
7 #if defined(OS_POSIX) 7 #if defined(OS_POSIX)
8 #include "base/file_descriptor_posix.h" 8 #include "base/file_descriptor_posix.h"
9 #endif 9 #endif
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 !db_tracker_->IsDatabaseScheduledForDeletion(origin_identifier, 169 !db_tracker_->IsDatabaseScheduledForDeletion(origin_identifier,
170 database_name)) { 170 database_name)) {
171 FilePath db_file = 171 FilePath db_file =
172 DatabaseUtil::GetFullFilePathForVfsFile(db_tracker_, vfs_file_name); 172 DatabaseUtil::GetFullFilePathForVfsFile(db_tracker_, vfs_file_name);
173 if (!db_file.empty()) { 173 if (!db_file.empty()) {
174 VfsBackend::OpenFile(db_file, desired_flags, process_handle_, 174 VfsBackend::OpenFile(db_file, desired_flags, process_handle_,
175 &target_handle, &target_dir_handle); 175 &target_handle, &target_dir_handle);
176 } 176 }
177 } 177 }
178 178
179 #if defined(OS_POSIX)
180 if (target_dir_handle >= 0)
181 close(target_dir_handle);
182 target_dir_handle = -1;
183 #endif
184
179 ViewHostMsg_DatabaseOpenFile::WriteReplyParams( 185 ViewHostMsg_DatabaseOpenFile::WriteReplyParams(
180 reply_msg, 186 reply_msg,
181 #if defined(OS_WIN) 187 #if defined(OS_WIN)
182 target_handle 188 target_handle
183 #elif defined(OS_POSIX) 189 #elif defined(OS_POSIX)
184 base::FileDescriptor(target_handle, true), 190 base::FileDescriptor(target_handle, true),
185 base::FileDescriptor(target_dir_handle, true) 191 base::FileDescriptor(target_dir_handle, true)
186 #endif 192 #endif
187 ); 193 );
188 Send(reply_msg); 194 Send(reply_msg);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 database_size, space_available)); 426 database_size, space_available));
421 } 427 }
422 } 428 }
423 429
424 void DatabaseDispatcherHost::OnDatabaseScheduledForDeletion( 430 void DatabaseDispatcherHost::OnDatabaseScheduledForDeletion(
425 const string16& origin_identifier, 431 const string16& origin_identifier,
426 const string16& database_name) { 432 const string16& database_name) {
427 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); 433 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
428 Send(new ViewMsg_DatabaseCloseImmediately(origin_identifier, database_name)); 434 Send(new ViewMsg_DatabaseCloseImmediately(origin_identifier, database_name));
429 } 435 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698