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

Side by Side Diff: chrome/browser/chromeos/cros/cros_library.cc

Issue 8637020: chromeos: Remove UpdateLibrary code, which is no longer used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/cros/cros_library.h" 5 #include "chrome/browser/chromeos/cros/cros_library.h"
6 6
7 #include "chrome/browser/chromeos/cros/burn_library.h" 7 #include "chrome/browser/chromeos/cros/burn_library.h"
8 #include "chrome/browser/chromeos/cros/cert_library.h" 8 #include "chrome/browser/chromeos/cros/cert_library.h"
9 #include "chrome/browser/chromeos/cros/cryptohome_library.h" 9 #include "chrome/browser/chromeos/cros/cryptohome_library.h"
10 #include "chrome/browser/chromeos/cros/library_loader.h" 10 #include "chrome/browser/chromeos/cros/library_loader.h"
11 #include "chrome/browser/chromeos/cros/network_library.h" 11 #include "chrome/browser/chromeos/cros/network_library.h"
12 #include "chrome/browser/chromeos/cros/power_library.h" 12 #include "chrome/browser/chromeos/cros/power_library.h"
13 #include "chrome/browser/chromeos/cros/screen_lock_library.h" 13 #include "chrome/browser/chromeos/cros/screen_lock_library.h"
14 #include "chrome/browser/chromeos/cros/update_library.h"
15 #include "third_party/cros/chromeos_cros_api.h" 14 #include "third_party/cros/chromeos_cros_api.h"
16 15
17 // Pass !libcros_loaded_ to GetDefaultImpl instead of use_stub_impl_ so that 16 // Pass !libcros_loaded_ to GetDefaultImpl instead of use_stub_impl_ so that
18 // we load the stub impl regardless of whether use_stub was specified or the 17 // we load the stub impl regardless of whether use_stub was specified or the
19 // library failed to load. 18 // library failed to load.
20 #define DEFINE_GET_LIBRARY_METHOD(class_prefix, var_prefix) \ 19 #define DEFINE_GET_LIBRARY_METHOD(class_prefix, var_prefix) \
21 class_prefix##Library* CrosLibrary::Get##class_prefix##Library() { \ 20 class_prefix##Library* CrosLibrary::Get##class_prefix##Library() { \
22 return var_prefix##_lib_.GetDefaultImpl(!libcros_loaded_); \ 21 return var_prefix##_lib_.GetDefaultImpl(!libcros_loaded_); \
23 } 22 }
24 23
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 CrosLibrary* CrosLibrary::Get() { 76 CrosLibrary* CrosLibrary::Get() {
78 return g_cros_library; 77 return g_cros_library;
79 } 78 }
80 79
81 DEFINE_GET_LIBRARY_METHOD(Burn, burn); 80 DEFINE_GET_LIBRARY_METHOD(Burn, burn);
82 DEFINE_GET_LIBRARY_METHOD(Cert, cert); 81 DEFINE_GET_LIBRARY_METHOD(Cert, cert);
83 DEFINE_GET_LIBRARY_METHOD(Cryptohome, crypto); 82 DEFINE_GET_LIBRARY_METHOD(Cryptohome, crypto);
84 DEFINE_GET_LIBRARY_METHOD(Network, network); 83 DEFINE_GET_LIBRARY_METHOD(Network, network);
85 DEFINE_GET_LIBRARY_METHOD(Power, power); 84 DEFINE_GET_LIBRARY_METHOD(Power, power);
86 DEFINE_GET_LIBRARY_METHOD(ScreenLock, screen_lock); 85 DEFINE_GET_LIBRARY_METHOD(ScreenLock, screen_lock);
87 DEFINE_GET_LIBRARY_METHOD(Update, update);
88 86
89 bool CrosLibrary::LoadLibcros() { 87 bool CrosLibrary::LoadLibcros() {
90 if (!libcros_loaded_ && !load_error_) { 88 if (!libcros_loaded_ && !load_error_) {
91 if (!library_loader_) { 89 if (!library_loader_) {
92 library_loader_ = LibraryLoader::GetImpl(); 90 library_loader_ = LibraryLoader::GetImpl();
93 own_library_loader_ = true; 91 own_library_loader_ = true;
94 } 92 }
95 libcros_loaded_ = library_loader_->Load(&load_error_string_); 93 libcros_loaded_ = library_loader_->Load(&load_error_string_);
96 load_error_ = !libcros_loaded_; 94 load_error_ = !libcros_loaded_;
97 } 95 }
(...skipping 24 matching lines...) Expand all
122 library_->libcros_loaded_ = false; 120 library_->libcros_loaded_ = false;
123 library_->load_error_ = false; 121 library_->load_error_ = false;
124 } 122 }
125 123
126 DEFINE_SET_LIBRARY_METHOD(Cert, cert); 124 DEFINE_SET_LIBRARY_METHOD(Cert, cert);
127 DEFINE_SET_LIBRARY_METHOD(Burn, burn); 125 DEFINE_SET_LIBRARY_METHOD(Burn, burn);
128 DEFINE_SET_LIBRARY_METHOD(Cryptohome, crypto); 126 DEFINE_SET_LIBRARY_METHOD(Cryptohome, crypto);
129 DEFINE_SET_LIBRARY_METHOD(Network, network); 127 DEFINE_SET_LIBRARY_METHOD(Network, network);
130 DEFINE_SET_LIBRARY_METHOD(Power, power); 128 DEFINE_SET_LIBRARY_METHOD(Power, power);
131 DEFINE_SET_LIBRARY_METHOD(ScreenLock, screen_lock); 129 DEFINE_SET_LIBRARY_METHOD(ScreenLock, screen_lock);
132 DEFINE_SET_LIBRARY_METHOD(Update, update);
133 130
134 } // namespace chromeos 131 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/cros_library.h ('k') | chrome/browser/chromeos/cros/mock_update_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698