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

Unified Diff: app/resource_bundle.cc

Issue 2852011: Revert 50057 - Load net-internals from the newly created resources.pak file.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 | « app/resource_bundle.h ('k') | base/data_pack.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/resource_bundle.cc
===================================================================
--- app/resource_bundle.cc (revision 50058)
+++ app/resource_bundle.cc (working copy)
@@ -105,17 +105,7 @@
RefCountedStaticMemory* ResourceBundle::LoadDataResourceBytes(
int resource_id) const {
- RefCountedStaticMemory* bytes =
- LoadResourceBytes(resources_data_, resource_id);
-
- // Check all our additional data packs for the resources if it wasn't loaded
- // from our main source.
- for (std::vector<LoadedDataPack*>::const_iterator it = data_packs_.begin();
- !bytes && it != data_packs_.end(); ++it) {
- bytes = (*it)->GetStaticMemory(resource_id);
- }
-
- return bytes;
+ return LoadResourceBytes(resources_data_, resource_id);
}
SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) {
@@ -208,8 +198,11 @@
// LoadedDataPack implementation
ResourceBundle::LoadedDataPack::LoadedDataPack(const FilePath& path)
: path_(path) {
- // Always preload the data packs so we can maintain constness.
+ // On unicies, we preload data packs so background updates don't cause us to
+ // load the wrong data.
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
Load();
+#endif
}
void ResourceBundle::LoadedDataPack::Load() {
@@ -219,12 +212,9 @@
CHECK(success) << "Failed to load " << path_.value();
}
-bool ResourceBundle::LoadedDataPack::GetStringPiece(
- int resource_id, base::StringPiece* data) const {
+bool ResourceBundle::LoadedDataPack::GetStringPiece(int resource_id,
+ base::StringPiece* data) {
+ if (!data_pack_.get())
+ Load();
return data_pack_->GetStringPiece(static_cast<uint32>(resource_id), data);
}
-
-RefCountedStaticMemory* ResourceBundle::LoadedDataPack::GetStaticMemory(
- int resource_id) const {
- return data_pack_->GetStaticMemory(resource_id);
-}
« no previous file with comments | « app/resource_bundle.h ('k') | base/data_pack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698