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

Unified Diff: chrome/browser/chromeos/cros/library_loader.cc

Issue 10626002: Reland "Remove chromeos::LibraryLoader" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright Created 8 years, 6 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 | « chrome/browser/chromeos/cros/library_loader.h ('k') | chrome/browser/chromeos/cros/mock_library_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros/library_loader.cc
diff --git a/chrome/browser/chromeos/cros/library_loader.cc b/chrome/browser/chromeos/cros/library_loader.cc
deleted file mode 100644
index 419662a166976782d34edb26b51c5a8af7eae007..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/cros/library_loader.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/cros/library_loader.h"
-
-#include <dlfcn.h>
-
-#include "base/compiler_specific.h"
-#include "base/file_path.h"
-#include "base/logging.h"
-#include "base/metrics/histogram.h"
-#include "base/path_service.h"
-#include "chrome/common/chrome_paths.h"
-#include "third_party/cros/chromeos_cros_api.h"
-
-namespace chromeos {
-
-namespace {
-
-void AddLibcrosTimeHistogram(const char* name, const base::TimeDelta& delta) {
- static const base::TimeDelta min_time = base::TimeDelta::FromMilliseconds(1);
- static const base::TimeDelta max_time = base::TimeDelta::FromSeconds(1);
- const size_t bucket_count(10);
- DCHECK(name);
- base::Histogram* counter = base::Histogram::FactoryTimeGet(
- std::string(name),
- min_time,
- max_time,
- bucket_count,
- base::Histogram::kNoFlags);
- counter->AddTime(delta);
- VLOG(1) << "Cros Time: " << name << ": " << delta.InMilliseconds() << "ms.";
-}
-
-} // namespace
-
-class LibraryLoaderImpl : public LibraryLoader {
- public:
- LibraryLoaderImpl();
-
- // LibraryLoader:
- virtual bool Load(std::string* load_error_string) OVERRIDE;
-};
-
-LibraryLoaderImpl::LibraryLoaderImpl() {}
-
-bool LibraryLoaderImpl::Load(std::string* load_error_string) {
- bool loaded = false;
- FilePath path;
- if (PathService::Get(chrome::FILE_CHROMEOS_API, &path)) {
- loaded = LoadLibcros(path.value().c_str(), *load_error_string);
- if (loaded)
- SetLibcrosTimeHistogramFunction(AddLibcrosTimeHistogram);
- }
-
- if (!loaded) {
- LOG(ERROR) << "Problem loading chromeos shared object: "
- << *load_error_string;
- }
- return loaded;
-}
-
-// static
-LibraryLoader* LibraryLoader::GetImpl() {
- return new LibraryLoaderImpl();
-}
-
-} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/cros/library_loader.h ('k') | chrome/browser/chromeos/cros/mock_library_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698