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

Unified Diff: chrome/browser/extensions/sandboxed_extension_unpacker.h

Issue 390019: Parse messages.json in ExtensionUnpacker (like we do for manifest).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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: chrome/browser/extensions/sandboxed_extension_unpacker.h
===================================================================
--- chrome/browser/extensions/sandboxed_extension_unpacker.h (revision 32098)
+++ chrome/browser/extensions/sandboxed_extension_unpacker.h (working copy)
@@ -20,7 +20,7 @@
class SandboxedExtensionUnpackerClient
: public base::RefCountedThreadSafe<SandboxedExtensionUnpackerClient> {
public:
- // temp_dir - A temporary directoy containing the results of the extension
+ // temp_dir - A temporary directory containing the results of the extension
// unpacking. The client is responsible for deleting this directory.
//
// extension_root - The path to the extension root inside of temp_dir.
@@ -44,9 +44,9 @@
// sources.
//
// Unpacking an extension using this class makes minor changes to its source,
-// such as transcoding all images to PNG and rewriting the manifest JSON. As
-// such, it should not be used when the output is not intended to be given back
-// to the author.
+// such as transcoding all images to PNG, parsing all message catalogs
+// and rewriting the manifest JSON. As such, it should not be used when the
+// output is not intended to be given back to the author.
//
//
// Lifetime management:
@@ -102,6 +102,7 @@
private:
class ProcessHostClient;
friend class ProcessHostClient;
+ friend class SandboxedExtensionUnpackerTest;
~SandboxedExtensionUnpacker() {}
@@ -120,13 +121,23 @@
void StartProcessOnIOThread(const FilePath& temp_crx_path);
// SandboxedExtensionUnpacker
- void OnUnpackExtensionSucceeded(const DictionaryValue& manifest);
+ void OnUnpackExtensionSucceeded(const DictionaryValue& manifest,
+ const DictionaryValue& catalogs);
void OnUnpackExtensionFailed(const std::string& error_message);
void OnProcessCrashed();
void ReportFailure(const std::string& message);
void ReportSuccess();
+ // Overwrites original manifest with safe result from utility process.
+ // Returns NULL on error. Caller owns the returned object.
+ DictionaryValue* RewriteManifestFile(const DictionaryValue& manifest);
+
+ // Overwrites original files with safe results from utility process.
+ // Reports error and returns false if it fails.
+ bool RewriteImageFiles();
+ bool RewriteCatalogFiles(const DictionaryValue& parsed_catalogs);
+
FilePath crx_path_;
ChromeThread::ID thread_identifier_;
ResourceDispatcherHost* rdh_;

Powered by Google App Engine
This is Rietveld 408576698