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

Side by Side Diff: app/resource_bundle.cc

Issue 5992006: Move data pack from base to app (it's just part of the resource bundle system... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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
« no previous file with comments | « app/resource_bundle.h ('k') | app/resource_bundle_posix.cc » ('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 (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 "base/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"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "gfx/codec/png_codec.h" 12 #include "gfx/codec/png_codec.h"
13 #include "gfx/font.h" 13 #include "gfx/font.h"
14 #include "third_party/skia/include/core/SkBitmap.h" 14 #include "third_party/skia/include/core/SkBitmap.h"
15 15
16 namespace { 16 namespace {
17 17
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 : path_(path) { 239 : path_(path) {
240 // Always preload the data packs so we can maintain constness. 240 // Always preload the data packs so we can maintain constness.
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 base::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 CHECK(success) << "Failed to load " << path_.value();
252 } 252 }
253 253
254 bool ResourceBundle::LoadedDataPack::GetStringPiece( 254 bool ResourceBundle::LoadedDataPack::GetStringPiece(
255 int resource_id, base::StringPiece* data) const { 255 int resource_id, base::StringPiece* data) const {
256 return data_pack_->GetStringPiece(static_cast<uint32>(resource_id), data); 256 return data_pack_->GetStringPiece(static_cast<uint32>(resource_id), data);
257 } 257 }
258 258
259 RefCountedStaticMemory* ResourceBundle::LoadedDataPack::GetStaticMemory( 259 RefCountedStaticMemory* ResourceBundle::LoadedDataPack::GetStaticMemory(
260 int resource_id) const { 260 int resource_id) const {
261 return data_pack_->GetStaticMemory(resource_id); 261 return data_pack_->GetStaticMemory(resource_id);
262 } 262 }
OLDNEW
« no previous file with comments | « app/resource_bundle.h ('k') | app/resource_bundle_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698