OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/resource_bundle.h" | 5 #include "app/resource_bundle.h" |
6 | 6 |
7 #include "app/data_pack.h" | 7 #include "app/data_pack.h" |
8 #include "base/lock.h" | 8 #include "base/lock.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 Load(); | 241 Load(); |
242 } | 242 } |
243 | 243 |
244 ResourceBundle::LoadedDataPack::~LoadedDataPack() { | 244 ResourceBundle::LoadedDataPack::~LoadedDataPack() { |
245 } | 245 } |
246 | 246 |
247 void ResourceBundle::LoadedDataPack::Load() { | 247 void ResourceBundle::LoadedDataPack::Load() { |
248 DCHECK(!data_pack_.get()); | 248 DCHECK(!data_pack_.get()); |
249 data_pack_.reset(new app::DataPack); | 249 data_pack_.reset(new app::DataPack); |
250 bool success = data_pack_->Load(path_); | 250 bool success = data_pack_->Load(path_); |
251 CHECK(success) << "Failed to load " << path_.value(); | 251 LOG_IF(ERROR, !success) << "Failed to load " << path_.value() |
| 252 << "\nYou will not be able to use the Bookmarks Manager or " |
| 253 << "about:net-internals."; |
252 } | 254 } |
253 | 255 |
254 bool ResourceBundle::LoadedDataPack::GetStringPiece( | 256 bool ResourceBundle::LoadedDataPack::GetStringPiece( |
255 int resource_id, base::StringPiece* data) const { | 257 int resource_id, base::StringPiece* data) const { |
256 return data_pack_->GetStringPiece(static_cast<uint32>(resource_id), data); | 258 return data_pack_->GetStringPiece(static_cast<uint32>(resource_id), data); |
257 } | 259 } |
258 | 260 |
259 RefCountedStaticMemory* ResourceBundle::LoadedDataPack::GetStaticMemory( | 261 RefCountedStaticMemory* ResourceBundle::LoadedDataPack::GetStaticMemory( |
260 int resource_id) const { | 262 int resource_id) const { |
261 return data_pack_->GetStaticMemory(resource_id); | 263 return data_pack_->GetStaticMemory(resource_id); |
262 } | 264 } |
OLD | NEW |