[email protected] | 9992266 | 2010-08-17 16:24:25 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/common/extensions/extension_unpacker.h" |
| 6 | |
| 7 | #include "base/file_util.h" |
| 8 | #include "base/scoped_handle.h" |
| 9 | #include "base/scoped_temp_dir.h" |
| 10 | #include "base/string_util.h" |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 11 | #include "base/thread.h" |
[email protected] | 9992266 | 2010-08-17 16:24:25 | [diff] [blame] | 12 | #include "base/utf_string_conversions.h" |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 13 | #include "base/values.h" |
| 14 | #include "net/base/file_stream.h" |
[email protected] | 946d1b2 | 2009-07-22 23:57:21 | [diff] [blame] | 15 | #include "chrome/common/common_param_traits.h" |
[email protected] | 5b1a0e2 | 2009-05-26 19:00:58 | [diff] [blame] | 16 | #include "chrome/common/extensions/extension.h" |
[email protected] | cb691e8 | 2009-07-13 14:59:01 | [diff] [blame] | 17 | #include "chrome/common/extensions/extension_constants.h" |
[email protected] | 7c927b6 | 2010-02-24 09:54:13 | [diff] [blame] | 18 | #include "chrome/common/extensions/extension_file_util.h" |
[email protected] | 1acbb4b6 | 2010-03-09 17:52:29 | [diff] [blame] | 19 | #include "chrome/common/extensions/extension_l10n_util.h" |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 20 | #include "chrome/common/json_value_serializer.h" |
| 21 | #include "chrome/common/notification_service.h" |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 22 | #include "chrome/common/url_constants.h" |
[email protected] | facd7a765 | 2009-06-05 23:15:02 | [diff] [blame] | 23 | #include "chrome/common/zip.h" |
[email protected] | 946d1b2 | 2009-07-22 23:57:21 | [diff] [blame] | 24 | #include "ipc/ipc_message_utils.h" |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 25 | #include "third_party/skia/include/core/SkBitmap.h" |
| 26 | #include "webkit/glue/image_decoder.h" |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 27 | |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 28 | namespace errors = extension_manifest_errors; |
| 29 | namespace keys = extension_manifest_keys; |
[email protected] | b0b3abd9 | 2010-04-30 17:00:09 | [diff] [blame] | 30 | namespace filenames = extension_filenames; |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 31 | |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 32 | namespace { |
[email protected] | 6d37714 | 2010-03-17 20:36:05 | [diff] [blame] | 33 | |
[email protected] | fbcc4030 | 2009-06-12 20:45:45 | [diff] [blame] | 34 | // Errors |
| 35 | const char* kCouldNotCreateDirectoryError = |
[email protected] | 2d6bda73 | 2010-04-06 01:51:43 | [diff] [blame] | 36 | "Could not create directory for unzipping: "; |
[email protected] | fbcc4030 | 2009-06-12 20:45:45 | [diff] [blame] | 37 | const char* kCouldNotDecodeImageError = "Could not decode theme image."; |
| 38 | const char* kCouldNotUnzipExtension = "Could not unzip extension."; |
| 39 | const char* kPathNamesMustBeAbsoluteOrLocalError = |
| 40 | "Path names must not be absolute or contain '..'."; |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 41 | |
[email protected] | fcfd12f | 2009-08-14 22:20:46 | [diff] [blame] | 42 | // A limit to stop us passing dangerously large canvases to the browser. |
| 43 | const int kMaxImageCanvas = 4096 * 4096; |
| 44 | |
[email protected] | 3bb8499 | 2010-08-26 17:23:46 | [diff] [blame] | 45 | SkBitmap DecodeImage(const FilePath& path) { |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 46 | // Read the file from disk. |
| 47 | std::string file_contents; |
| 48 | if (!file_util::PathExists(path) || |
| 49 | !file_util::ReadFileToString(path, &file_contents)) { |
| 50 | return SkBitmap(); |
| 51 | } |
| 52 | |
| 53 | // Decode the image using WebKit's image decoder. |
| 54 | const unsigned char* data = |
| 55 | reinterpret_cast<const unsigned char*>(file_contents.data()); |
| 56 | webkit_glue::ImageDecoder decoder; |
[email protected] | fcfd12f | 2009-08-14 22:20:46 | [diff] [blame] | 57 | SkBitmap bitmap = decoder.Decode(data, file_contents.length()); |
| 58 | Sk64 bitmap_size = bitmap.getSize64(); |
| 59 | if (!bitmap_size.is32() || bitmap_size.get32() > kMaxImageCanvas) |
| 60 | return SkBitmap(); |
| 61 | return bitmap; |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 62 | } |
| 63 | |
[email protected] | 3bb8499 | 2010-08-26 17:23:46 | [diff] [blame] | 64 | bool PathContainsParentDirectory(const FilePath& path) { |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 65 | const FilePath::StringType kSeparators(FilePath::kSeparators); |
| 66 | const FilePath::StringType kParentDirectory(FilePath::kParentDirectory); |
| 67 | const size_t npos = FilePath::StringType::npos; |
| 68 | const FilePath::StringType& value = path.value(); |
| 69 | |
| 70 | for (size_t i = 0; i < value.length(); ) { |
| 71 | i = value.find(kParentDirectory, i); |
| 72 | if (i != npos) { |
| 73 | if ((i == 0 || kSeparators.find(value[i-1]) == npos) && |
| 74 | (i+1 < value.length() || kSeparators.find(value[i+1]) == npos)) { |
| 75 | return true; |
| 76 | } |
| 77 | ++i; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | return false; |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 82 | } |
| 83 | |
[email protected] | 3bb8499 | 2010-08-26 17:23:46 | [diff] [blame] | 84 | } // namespace |
| 85 | |
| 86 | ExtensionUnpacker::ExtensionUnpacker(const FilePath& extension_path) |
| 87 | : extension_path_(extension_path) { |
| 88 | } |
| 89 | |
| 90 | ExtensionUnpacker::~ExtensionUnpacker() { |
| 91 | } |
| 92 | |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 93 | DictionaryValue* ExtensionUnpacker::ReadManifest() { |
| 94 | FilePath manifest_path = |
[email protected] | 99efb7b1 | 2009-12-18 02:39:16 | [diff] [blame] | 95 | temp_install_dir_.Append(Extension::kManifestFilename); |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 96 | if (!file_util::PathExists(manifest_path)) { |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 97 | SetError(errors::kInvalidManifest); |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 98 | return NULL; |
| 99 | } |
| 100 | |
| 101 | JSONFileValueSerializer serializer(manifest_path); |
| 102 | std::string error; |
[email protected] | ba39967 | 2010-04-06 15:42:39 | [diff] [blame] | 103 | scoped_ptr<Value> root(serializer.Deserialize(NULL, &error)); |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 104 | if (!root.get()) { |
| 105 | SetError(error); |
| 106 | return NULL; |
| 107 | } |
| 108 | |
| 109 | if (!root->IsType(Value::TYPE_DICTIONARY)) { |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 110 | SetError(errors::kInvalidManifest); |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 111 | return NULL; |
| 112 | } |
| 113 | |
| 114 | return static_cast<DictionaryValue*>(root.release()); |
| 115 | } |
| 116 | |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 117 | bool ExtensionUnpacker::ReadAllMessageCatalogs( |
| 118 | const std::string& default_locale) { |
| 119 | FilePath locales_path = |
[email protected] | 99efb7b1 | 2009-12-18 02:39:16 | [diff] [blame] | 120 | temp_install_dir_.Append(Extension::kLocaleFolder); |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 121 | |
[email protected] | 1acbb4b6 | 2010-03-09 17:52:29 | [diff] [blame] | 122 | // Not all folders under _locales have to be valid locales. |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 123 | file_util::FileEnumerator locales(locales_path, |
| 124 | false, |
| 125 | file_util::FileEnumerator::DIRECTORIES); |
| 126 | |
[email protected] | 1acbb4b6 | 2010-03-09 17:52:29 | [diff] [blame] | 127 | std::set<std::string> all_locales; |
| 128 | extension_l10n_util::GetAllLocales(&all_locales); |
| 129 | FilePath locale_path; |
| 130 | while (!(locale_path = locales.Next()).empty()) { |
| 131 | if (extension_l10n_util::ShouldSkipValidation(locales_path, locale_path, |
| 132 | all_locales)) |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 133 | continue; |
| 134 | |
| 135 | FilePath messages_path = |
[email protected] | 99efb7b1 | 2009-12-18 02:39:16 | [diff] [blame] | 136 | locale_path.Append(Extension::kMessagesFilename); |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 137 | |
| 138 | if (!ReadMessageCatalog(messages_path)) |
| 139 | return false; |
[email protected] | 1acbb4b6 | 2010-03-09 17:52:29 | [diff] [blame] | 140 | } |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 141 | |
| 142 | return true; |
| 143 | } |
| 144 | |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 145 | bool ExtensionUnpacker::Run() { |
[email protected] | 11c2688a | 2010-10-22 00:58:58 | [diff] [blame] | 146 | VLOG(1) << "Installing extension " << extension_path_.value(); |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 147 | |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 148 | // <profile>/Extensions/INSTALL_TEMP/<version> |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 149 | temp_install_dir_ = |
[email protected] | b0b3abd9 | 2010-04-30 17:00:09 | [diff] [blame] | 150 | extension_path_.DirName().AppendASCII(filenames::kTempExtensionName); |
[email protected] | baedfdf | 2010-06-14 18:50:19 | [diff] [blame] | 151 | |
[email protected] | baedfdf | 2010-06-14 18:50:19 | [diff] [blame] | 152 | if (!file_util::CreateDirectory(temp_install_dir_)) { |
[email protected] | 075be5d | 2010-09-24 15:39:39 | [diff] [blame] | 153 | |
| 154 | #if defined(OS_WIN) |
| 155 | std::string dir_string = WideToUTF8(temp_install_dir_.value()); |
| 156 | #else |
[email protected] | 2d6bda73 | 2010-04-06 01:51:43 | [diff] [blame] | 157 | std::string dir_string = temp_install_dir_.value(); |
[email protected] | 075be5d | 2010-09-24 15:39:39 | [diff] [blame] | 158 | #endif |
| 159 | |
[email protected] | 2d6bda73 | 2010-04-06 01:51:43 | [diff] [blame] | 160 | SetError(kCouldNotCreateDirectoryError + dir_string); |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 161 | return false; |
| 162 | } |
| 163 | |
[email protected] | 4777bc56 | 2009-06-01 02:53:00 | [diff] [blame] | 164 | if (!Unzip(extension_path_, temp_install_dir_)) { |
[email protected] | fbcc4030 | 2009-06-12 20:45:45 | [diff] [blame] | 165 | SetError(kCouldNotUnzipExtension); |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 166 | return false; |
| 167 | } |
| 168 | |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 169 | // Parse the manifest. |
| 170 | parsed_manifest_.reset(ReadManifest()); |
| 171 | if (!parsed_manifest_.get()) |
| 172 | return false; // Error was already reported. |
[email protected] | af1277b | 2009-07-28 00:47:53 | [diff] [blame] | 173 | |
[email protected] | 075be5d | 2010-09-24 15:39:39 | [diff] [blame] | 174 | // NOTE: Since the unpacker doesn't have the extension's public_id, the |
[email protected] | fbcc4030 | 2009-06-12 20:45:45 | [diff] [blame] | 175 | // InitFromValue is allowed to generate a temporary id for the extension. |
| 176 | // ANY CODE THAT FOLLOWS SHOULD NOT DEPEND ON THE CORRECT ID OF THIS |
| 177 | // EXTENSION. |
[email protected] | fbcc4030 | 2009-06-12 20:45:45 | [diff] [blame] | 178 | std::string error; |
[email protected] | 66e4eb3 | 2010-10-27 20:37:41 | [diff] [blame] | 179 | scoped_refptr<Extension> extension(Extension::Create( |
| 180 | temp_install_dir_, Extension::INVALID, *parsed_manifest_, false, &error)); |
| 181 | if (!extension.get()) { |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 182 | SetError(error); |
| 183 | return false; |
| 184 | } |
[email protected] | 99872e3 | 2009-09-25 22:02:49 | [diff] [blame] | 185 | |
[email protected] | 66e4eb3 | 2010-10-27 20:37:41 | [diff] [blame] | 186 | if (!extension_file_util::ValidateExtension(extension.get(), &error)) { |
[email protected] | 99872e3 | 2009-09-25 22:02:49 | [diff] [blame] | 187 | SetError(error); |
| 188 | return false; |
| 189 | } |
| 190 | |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 191 | // Decode any images that the browser needs to display. |
[email protected] | 66e4eb3 | 2010-10-27 20:37:41 | [diff] [blame] | 192 | std::set<FilePath> image_paths = extension->GetBrowserImages(); |
[email protected] | facd7a765 | 2009-06-05 23:15:02 | [diff] [blame] | 193 | for (std::set<FilePath>::iterator it = image_paths.begin(); |
| 194 | it != image_paths.end(); ++it) { |
| 195 | if (!AddDecodedImage(*it)) |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 196 | return false; // Error was already reported. |
| 197 | } |
| 198 | |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 199 | // Parse all message catalogs (if any). |
| 200 | parsed_catalogs_.reset(new DictionaryValue); |
[email protected] | 66e4eb3 | 2010-10-27 20:37:41 | [diff] [blame] | 201 | if (!extension->default_locale().empty()) { |
| 202 | if (!ReadAllMessageCatalogs(extension->default_locale())) |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 203 | return false; // Error was already reported. |
| 204 | } |
| 205 | |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 206 | return true; |
| 207 | } |
| 208 | |
[email protected] | facd7a765 | 2009-06-05 23:15:02 | [diff] [blame] | 209 | bool ExtensionUnpacker::DumpImagesToFile() { |
| 210 | IPC::Message pickle; // We use a Message so we can use WriteParam. |
| 211 | IPC::WriteParam(&pickle, decoded_images_); |
| 212 | |
[email protected] | b0b3abd9 | 2010-04-30 17:00:09 | [diff] [blame] | 213 | FilePath path = extension_path_.DirName().AppendASCII( |
| 214 | filenames::kDecodedImagesFilename); |
[email protected] | facd7a765 | 2009-06-05 23:15:02 | [diff] [blame] | 215 | if (!file_util::WriteFile(path, static_cast<const char*>(pickle.data()), |
| 216 | pickle.size())) { |
| 217 | SetError("Could not write image data to disk."); |
| 218 | return false; |
| 219 | } |
| 220 | |
| 221 | return true; |
| 222 | } |
| 223 | |
[email protected] | 6d37714 | 2010-03-17 20:36:05 | [diff] [blame] | 224 | bool ExtensionUnpacker::DumpMessageCatalogsToFile() { |
| 225 | IPC::Message pickle; |
| 226 | IPC::WriteParam(&pickle, *parsed_catalogs_.get()); |
| 227 | |
| 228 | FilePath path = extension_path_.DirName().AppendASCII( |
[email protected] | b0b3abd9 | 2010-04-30 17:00:09 | [diff] [blame] | 229 | filenames::kDecodedMessageCatalogsFilename); |
[email protected] | 6d37714 | 2010-03-17 20:36:05 | [diff] [blame] | 230 | if (!file_util::WriteFile(path, static_cast<const char*>(pickle.data()), |
| 231 | pickle.size())) { |
| 232 | SetError("Could not write message catalogs to disk."); |
| 233 | return false; |
| 234 | } |
| 235 | |
| 236 | return true; |
| 237 | } |
| 238 | |
[email protected] | facd7a765 | 2009-06-05 23:15:02 | [diff] [blame] | 239 | // static |
| 240 | bool ExtensionUnpacker::ReadImagesFromFile(const FilePath& extension_path, |
| 241 | DecodedImages* images) { |
[email protected] | b0b3abd9 | 2010-04-30 17:00:09 | [diff] [blame] | 242 | FilePath path = extension_path.AppendASCII(filenames::kDecodedImagesFilename); |
[email protected] | facd7a765 | 2009-06-05 23:15:02 | [diff] [blame] | 243 | std::string file_str; |
| 244 | if (!file_util::ReadFileToString(path, &file_str)) |
| 245 | return false; |
| 246 | |
| 247 | IPC::Message pickle(file_str.data(), file_str.size()); |
| 248 | void* iter = NULL; |
| 249 | return IPC::ReadParam(&pickle, &iter, images); |
| 250 | } |
| 251 | |
[email protected] | 6d37714 | 2010-03-17 20:36:05 | [diff] [blame] | 252 | // static |
| 253 | bool ExtensionUnpacker::ReadMessageCatalogsFromFile( |
| 254 | const FilePath& extension_path, DictionaryValue* catalogs) { |
[email protected] | b0b3abd9 | 2010-04-30 17:00:09 | [diff] [blame] | 255 | FilePath path = extension_path.AppendASCII( |
| 256 | filenames::kDecodedMessageCatalogsFilename); |
[email protected] | 6d37714 | 2010-03-17 20:36:05 | [diff] [blame] | 257 | std::string file_str; |
| 258 | if (!file_util::ReadFileToString(path, &file_str)) |
| 259 | return false; |
| 260 | |
| 261 | IPC::Message pickle(file_str.data(), file_str.size()); |
| 262 | void* iter = NULL; |
| 263 | return IPC::ReadParam(&pickle, &iter, catalogs); |
| 264 | } |
| 265 | |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 266 | bool ExtensionUnpacker::AddDecodedImage(const FilePath& path) { |
| 267 | // Make sure it's not referencing a file outside the extension's subdir. |
| 268 | if (path.IsAbsolute() || PathContainsParentDirectory(path)) { |
[email protected] | fbcc4030 | 2009-06-12 20:45:45 | [diff] [blame] | 269 | SetError(kPathNamesMustBeAbsoluteOrLocalError); |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 270 | return false; |
| 271 | } |
| 272 | |
| 273 | SkBitmap image_bitmap = DecodeImage(temp_install_dir_.Append(path)); |
| 274 | if (image_bitmap.isNull()) { |
[email protected] | fbcc4030 | 2009-06-12 20:45:45 | [diff] [blame] | 275 | SetError(kCouldNotDecodeImageError); |
[email protected] | 902f7cd | 2009-05-22 19:02:19 | [diff] [blame] | 276 | return false; |
| 277 | } |
| 278 | |
| 279 | decoded_images_.push_back(MakeTuple(image_bitmap, path)); |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 280 | return true; |
| 281 | } |
| 282 | |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 283 | bool ExtensionUnpacker::ReadMessageCatalog(const FilePath& message_path) { |
| 284 | std::string error; |
| 285 | JSONFileValueSerializer serializer(message_path); |
[email protected] | 6d37714 | 2010-03-17 20:36:05 | [diff] [blame] | 286 | scoped_ptr<DictionaryValue> root( |
[email protected] | ba39967 | 2010-04-06 15:42:39 | [diff] [blame] | 287 | static_cast<DictionaryValue*>(serializer.Deserialize(NULL, &error))); |
[email protected] | 6d37714 | 2010-03-17 20:36:05 | [diff] [blame] | 288 | if (!root.get()) { |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 289 | std::string messages_file = WideToASCII(message_path.ToWStringHack()); |
| 290 | if (error.empty()) { |
| 291 | // If file is missing, Deserialize will fail with empty error. |
[email protected] | 93f1052 | 2010-10-31 16:27:48 | [diff] [blame^] | 292 | SetError(base::StringPrintf("%s %s", errors::kLocalesMessagesFileMissing, |
| 293 | messages_file.c_str())); |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 294 | } else { |
[email protected] | 93f1052 | 2010-10-31 16:27:48 | [diff] [blame^] | 295 | SetError(base::StringPrintf("%s: %s", messages_file.c_str(), |
| 296 | error.c_str())); |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 297 | } |
| 298 | return false; |
| 299 | } |
| 300 | |
| 301 | FilePath relative_path; |
| 302 | // message_path was created from temp_install_dir. This should never fail. |
| 303 | if (!temp_install_dir_.AppendRelativePath(message_path, &relative_path)) |
| 304 | NOTREACHED(); |
| 305 | |
[email protected] | 9992266 | 2010-08-17 16:24:25 | [diff] [blame] | 306 | parsed_catalogs_->Set(WideToUTF8(relative_path.DirName().ToWStringHack()), |
[email protected] | 6d37714 | 2010-03-17 20:36:05 | [diff] [blame] | 307 | root.release()); |
[email protected] | 9428edc | 2009-11-18 18:02:47 | [diff] [blame] | 308 | |
| 309 | return true; |
| 310 | } |
| 311 | |
[email protected] | 1fca149 | 2009-05-15 22:23:43 | [diff] [blame] | 312 | void ExtensionUnpacker::SetError(const std::string &error) { |
| 313 | error_message_ = error; |
| 314 | } |