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

Unified Diff: src/snapshot-common.cc

Issue 394007: * Remove old snapshot implementation (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
Index: src/snapshot-common.cc
===================================================================
--- src/snapshot-common.cc (revision 3302)
+++ src/snapshot-common.cc (working copy)
@@ -38,15 +38,8 @@
namespace internal {
bool Snapshot::Deserialize(const byte* content, int len) {
- Deserializer des(content, len);
- des.GetFlags();
- return V8::Initialize(&des);
-}
-
-
-bool Snapshot::Deserialize2(const byte* content, int len) {
SnapshotByteSource source(content, len);
- Deserializer2 deserializer(&source);
+ Deserializer deserializer(&source);
return V8::Initialize(&deserializer);
}
@@ -56,46 +49,17 @@
int len;
byte* str = ReadBytes(snapshot_file, &len);
if (!str) return false;
- bool result = Deserialize(str, len);
+ Deserialize(str, len);
DeleteArray(str);
- return result;
- } else if (size_ > 0) {
- return Deserialize(data_, size_);
- }
- return false;
-}
-
-
-bool Snapshot::Initialize2(const char* snapshot_file) {
- if (snapshot_file) {
- int len;
- byte* str = ReadBytes(snapshot_file, &len);
- if (!str) return false;
- Deserialize2(str, len);
- DeleteArray(str);
return true;
} else if (size_ > 0) {
- Deserialize2(data_, size_);
+ Deserialize(data_, size_);
return true;
}
return false;
}
-bool Snapshot::WriteToFile(const char* snapshot_file) {
- Serializer ser;
- ser.Serialize();
- byte* str;
- int len;
- ser.Finalize(&str, &len);
-
- int written = WriteBytes(snapshot_file, str, len);
-
- DeleteArray(str);
- return written == len;
-}
-
-
class FileByteSink : public SnapshotByteSink {
public:
explicit FileByteSink(const char* snapshot_file) {
@@ -121,9 +85,9 @@
};
-bool Snapshot::WriteToFile2(const char* snapshot_file) {
+bool Snapshot::WriteToFile(const char* snapshot_file) {
FileByteSink file(snapshot_file);
- Serializer2 ser(&file);
+ Serializer ser(&file);
ser.Serialize();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698