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

Unified Diff: app/data_pack.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/data_pack.h ('k') | app/data_pack_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/data_pack.cc
===================================================================
--- app/data_pack.cc (revision 69975)
+++ app/data_pack.cc (working copy)
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/data_pack.h"
+#include "app/data_pack.h"
#include <errno.h>
@@ -59,7 +59,7 @@
} // anonymous namespace
-namespace base {
+namespace app {
// In .cc for MemoryMappedFile dtor.
DataPack::DataPack() : resource_count_(0) {
@@ -118,7 +118,8 @@
return true;
}
-bool DataPack::GetStringPiece(uint32 resource_id, StringPiece* data) const {
+bool DataPack::GetStringPiece(uint32 resource_id,
+ base::StringPiece* data) const {
// It won't be hard to make this endian-agnostic, but it's not worth
// bothering to do right now.
#if defined(__BYTE_ORDER)
@@ -152,7 +153,7 @@
// static
bool DataPack::WritePack(const FilePath& path,
- const std::map<uint32, StringPiece>& resources) {
+ const std::map<uint32, base::StringPiece>& resources) {
FILE* file = file_util::OpenFile(path, "wb");
if (!file)
return false;
@@ -175,7 +176,8 @@
// Each entry is 3 uint32s.
uint32 index_length = entry_count * 3 * kWord;
uint32 data_offset = kHeaderLength + index_length;
- for (std::map<uint32, StringPiece>::const_iterator it = resources.begin();
+ for (std::map<uint32, base::StringPiece>::const_iterator it =
+ resources.begin();
it != resources.end(); ++it) {
if (fwrite(&it->first, 1, kWord, file) != kWord) {
LOG(ERROR) << "Failed to write id for " << it->first;
@@ -199,7 +201,8 @@
data_offset += len;
}
- for (std::map<uint32, StringPiece>::const_iterator it = resources.begin();
+ for (std::map<uint32, base::StringPiece>::const_iterator it =
+ resources.begin();
it != resources.end(); ++it) {
if (fwrite(it->second.data(), it->second.length(), 1, file) != 1) {
LOG(ERROR) << "Failed to write data for " << it->first;
@@ -213,4 +216,4 @@
return true;
}
-} // namespace base
+} // namespace app
« no previous file with comments | « app/data_pack.h ('k') | app/data_pack_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698