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

Side by Side Diff: components/leveldb/env_mojo.cc

Issue 2420253002: Rename shell namespace to service_manager (Closed)
Patch Set: . Created 4 years, 2 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
« no previous file with comments | « components/font_service/public/cpp/font_loader.cc ('k') | components/leveldb/leveldb_app.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/leveldb/env_mojo.h" 5 #include "components/leveldb/env_mojo.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 std::string fname = my_lock ? my_lock->name() : "(invalid)"; 352 std::string fname = my_lock ? my_lock->name() : "(invalid)";
353 TRACE_EVENT1("leveldb", "MojoEnv::UnlockFile", "fname", fname); 353 TRACE_EVENT1("leveldb", "MojoEnv::UnlockFile", "fname", fname);
354 354
355 filesystem::mojom::FileError err = thread_->UnlockFile(my_lock->TakeLock()); 355 filesystem::mojom::FileError err = thread_->UnlockFile(my_lock->TakeLock());
356 delete my_lock; 356 delete my_lock;
357 return FilesystemErrorToStatus(err, fname, leveldb_env::kUnlockFile); 357 return FilesystemErrorToStatus(err, fname, leveldb_env::kUnlockFile);
358 } 358 }
359 359
360 Status MojoEnv::GetTestDirectory(std::string* path) { 360 Status MojoEnv::GetTestDirectory(std::string* path) {
361 // TODO(erg): This method is actually only used from the test harness in 361 // TODO(erg): This method is actually only used from the test harness in
362 // leveldb. And when we go and port that test stuff to a shell::ServiceTest, 362 // leveldb. And when we go and port that test stuff to a
363 // service_manager::ServiceTest,
363 // we probably won't use it since the mojo filesystem actually handles 364 // we probably won't use it since the mojo filesystem actually handles
364 // temporary filesystems just fine. 365 // temporary filesystems just fine.
365 NOTREACHED(); 366 NOTREACHED();
366 return Status::OK(); 367 return Status::OK();
367 } 368 }
368 369
369 Status MojoEnv::NewLogger(const std::string& fname, Logger** result) { 370 Status MojoEnv::NewLogger(const std::string& fname, Logger** result) {
370 TRACE_EVENT1("leveldb", "MojoEnv::NewLogger", "fname", fname); 371 TRACE_EVENT1("leveldb", "MojoEnv::NewLogger", "fname", fname);
371 base::File f(thread_->OpenFileHandle( 372 base::File f(thread_->OpenFileHandle(
372 dir_, mojo::String::From(fname), 373 dir_, mojo::String::From(fname),
373 filesystem::mojom::kCreateAlways | filesystem::mojom::kFlagWrite)); 374 filesystem::mojom::kCreateAlways | filesystem::mojom::kFlagWrite));
374 if (!f.IsValid()) { 375 if (!f.IsValid()) {
375 *result = NULL; 376 *result = NULL;
376 return MakeIOError(fname, "Unable to create log file", 377 return MakeIOError(fname, "Unable to create log file",
377 leveldb_env::kNewLogger, f.error_details()); 378 leveldb_env::kNewLogger, f.error_details());
378 } else { 379 } else {
379 *result = new leveldb::ChromiumLogger(std::move(f)); 380 *result = new leveldb::ChromiumLogger(std::move(f));
380 return Status::OK(); 381 return Status::OK();
381 } 382 }
382 } 383 }
383 384
384 } // namespace leveldb 385 } // namespace leveldb
OLDNEW
« no previous file with comments | « components/font_service/public/cpp/font_loader.cc ('k') | components/leveldb/leveldb_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698