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

Unified Diff: sql/mojo/mojo_vfs.cc

Issue 1225673006: Revert of mandoline filesystem: Save cookie data to the mojo:filesystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sqlite-fs
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/tools/mopy/gtest.py ('k') | sql/mojo/vfs_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/mojo/mojo_vfs.cc
diff --git a/sql/mojo/mojo_vfs.cc b/sql/mojo/mojo_vfs.cc
index 3ef67a1733536e90e62a6734c10c5d6ead60853d..6e38af9704032a15b0cf1bbd329e6c4da212c560 100644
--- a/sql/mojo/mojo_vfs.cc
+++ b/sql/mojo/mojo_vfs.cc
@@ -6,7 +6,6 @@
#include "base/logging.h"
#include "base/rand_util.h"
-#include "base/strings/stringprintf.h"
#include "components/filesystem/public/interfaces/file.mojom.h"
#include "components/filesystem/public/interfaces/file_system.mojom.h"
#include "components/filesystem/public/interfaces/types.mojom.h"
@@ -246,25 +245,10 @@
if (flags & SQLITE_OPEN_DELETEONCLOSE)
open_flags |= filesystem::kDeleteOnClose;
- mojo::String mojo_name;
- if (name) {
- // Don't let callers open the pattern of our temporary databases. When we
- // open with a null name and SQLITE_OPEN_DELETEONCLOSE, we unlink the
- // database after we open it. If we create a database here, close it
- // normally, and then open the same file through the other path, we could
- // delete the database.
- CHECK(strncmp("Temp_", name, 5) != 0);
- mojo_name = name;
- } else {
- DCHECK(flags & SQLITE_OPEN_DELETEONCLOSE);
- static int temp_number = 0;
- mojo_name = base::StringPrintf("Temp_%d.db", temp_number++);
- }
-
// Grab the incoming file
filesystem::FilePtr file_ptr;
filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
- GetRootDirectory(mojo_vfs)->OpenFile(mojo_name, GetProxy(&file_ptr),
+ GetRootDirectory(mojo_vfs)->OpenFile(mojo::String(name), GetProxy(&file_ptr),
open_flags, Capture(&error));
GetRootDirectory(mojo_vfs).WaitForIncomingResponse();
if (error != filesystem::FILE_ERROR_OK) {
« no previous file with comments | « mojo/tools/mopy/gtest.py ('k') | sql/mojo/vfs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698