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

Unified Diff: components/leveldb/leveldb_database_impl.cc

Issue 1825413003: leveldb_service: Attempt to fix deadlock on shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 9 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 | « no previous file | components/leveldb/leveldb_file_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb/leveldb_database_impl.cc
diff --git a/components/leveldb/leveldb_database_impl.cc b/components/leveldb/leveldb_database_impl.cc
index d5e8fa690ea267cfbb92ac35b1684c6f8253803e..eae6717c0b33d957bb244162cadde07e2f83bf33 100644
--- a/components/leveldb/leveldb_database_impl.cc
+++ b/components/leveldb/leveldb_database_impl.cc
@@ -4,6 +4,9 @@
#include "components/leveldb/leveldb_database_impl.h"
+#include <map>
+#include <string>
+
#include "base/rand_util.h"
#include "components/leveldb/env_mojo.h"
#include "components/leveldb/util.h"
@@ -107,8 +110,10 @@ void LevelDBDatabaseImpl::GetFromSnapshot(uint64_t snapshot_id,
const GetCallback& callback) {
// If the snapshot id is invalid, send back invalid argument
auto it = snapshot_map_.find(snapshot_id);
- if (it == snapshot_map_.end())
+ if (it == snapshot_map_.end()) {
callback.Run(DatabaseError::INVALID_ARGUMENT, mojo::Array<uint8_t>());
+ return;
+ }
std::string value;
leveldb::ReadOptions options;
« no previous file with comments | « no previous file | components/leveldb/leveldb_file_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698