diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-04 14:17:57 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-05 10:05:06 +0000 |
commit | 39d357e3248f80abea0159765ff39554affb40db (patch) | |
tree | aba0e6bfb76de0244bba0f5fdbd64b830dd6e621 /chromium/components/leveldb/env_mojo.cc | |
parent | 87778abf5a1f89266f37d1321b92a21851d8244d (diff) | |
download | qtwebengine-chromium-39d357e3248f80abea0159765ff39554affb40db.tar.gz |
BASELINE: Update Chromium to 55.0.2883.105
And updates ninja to 1.7.2
Change-Id: I20d43c737f82764d857ada9a55586901b18b9243
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/components/leveldb/env_mojo.cc')
-rw-r--r-- | chromium/components/leveldb/env_mojo.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/chromium/components/leveldb/env_mojo.cc b/chromium/components/leveldb/env_mojo.cc index 54681d0d142..4c0629a9c67 100644 --- a/chromium/components/leveldb/env_mojo.cc +++ b/chromium/components/leveldb/env_mojo.cc @@ -8,6 +8,7 @@ #include <memory> +#include "base/strings/string_util.h" #include "base/trace_event/trace_event.h" #include "third_party/leveldatabase/chromium_logger.h" #include "third_party/leveldatabase/src/include/leveldb/status.h" @@ -137,10 +138,12 @@ class MojoWritableFile : public leveldb::WritableFile { dir_(dir), thread_(thread) { base::FilePath path = base::FilePath::FromUTF8Unsafe(fname); - if (path.BaseName().AsUTF8Unsafe().find("MANIFEST") == 0) + if (base::StartsWith(path.BaseName().AsUTF8Unsafe(), "MANIFEST", + base::CompareCase::SENSITIVE)) { file_type_ = kManifest; - else if (path.MatchesExtension(table_extension)) + } else if (path.MatchesExtension(table_extension)) { file_type_ = kTable; + } parent_dir_ = base::FilePath::FromUTF8Unsafe(fname).DirName().AsUTF8Unsafe(); } @@ -365,15 +368,15 @@ Status MojoEnv::GetTestDirectory(std::string* path) { Status MojoEnv::NewLogger(const std::string& fname, Logger** result) { TRACE_EVENT1("leveldb", "MojoEnv::NewLogger", "fname", fname); - std::unique_ptr<base::File> f(new base::File(thread_->OpenFileHandle( + base::File f(thread_->OpenFileHandle( dir_, mojo::String::From(fname), - filesystem::mojom::kCreateAlways | filesystem::mojom::kFlagWrite))); - if (!f->IsValid()) { + filesystem::mojom::kCreateAlways | filesystem::mojom::kFlagWrite)); + if (!f.IsValid()) { *result = NULL; return MakeIOError(fname, "Unable to create log file", - leveldb_env::kNewLogger, f->error_details()); + leveldb_env::kNewLogger, f.error_details()); } else { - *result = new leveldb::ChromiumLogger(f.release()); + *result = new leveldb::ChromiumLogger(std::move(f)); return Status::OK(); } } |