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

Side by Side Diff: chrome/utility/utility_thread.cc

Issue 526012: Merge 32345 - Parse messages.json in ExtensionUnpacker (like we do for manife... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 10 years, 11 months 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 | « chrome/test/data/extensions/unpacker/no_locale_data/manifest.json ('k') | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/utility/utility_thread.h" 5 #include "chrome/utility/utility_thread.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/common/child_process.h" 9 #include "chrome/common/child_process.h"
10 #include "chrome/common/extensions/extension_unpacker.h" 10 #include "chrome/common/extensions/extension_unpacker.h"
(...skipping 13 matching lines...) Expand all
24 IPC_MESSAGE_HANDLER(UtilityMsg_UnpackExtension, OnUnpackExtension) 24 IPC_MESSAGE_HANDLER(UtilityMsg_UnpackExtension, OnUnpackExtension)
25 IPC_MESSAGE_HANDLER(UtilityMsg_UnpackWebResource, OnUnpackWebResource) 25 IPC_MESSAGE_HANDLER(UtilityMsg_UnpackWebResource, OnUnpackWebResource)
26 IPC_MESSAGE_HANDLER(UtilityMsg_ParseUpdateManifest, OnParseUpdateManifest) 26 IPC_MESSAGE_HANDLER(UtilityMsg_ParseUpdateManifest, OnParseUpdateManifest)
27 IPC_END_MESSAGE_MAP() 27 IPC_END_MESSAGE_MAP()
28 } 28 }
29 29
30 void UtilityThread::OnUnpackExtension(const FilePath& extension_path) { 30 void UtilityThread::OnUnpackExtension(const FilePath& extension_path) {
31 ExtensionUnpacker unpacker(extension_path); 31 ExtensionUnpacker unpacker(extension_path);
32 if (unpacker.Run() && unpacker.DumpImagesToFile()) { 32 if (unpacker.Run() && unpacker.DumpImagesToFile()) {
33 Send(new UtilityHostMsg_UnpackExtension_Succeeded( 33 Send(new UtilityHostMsg_UnpackExtension_Succeeded(
34 *unpacker.parsed_manifest())); 34 *unpacker.parsed_manifest(), *unpacker.parsed_catalogs()));
35 } else { 35 } else {
36 Send(new UtilityHostMsg_UnpackExtension_Failed(unpacker.error_message())); 36 Send(new UtilityHostMsg_UnpackExtension_Failed(unpacker.error_message()));
37 } 37 }
38 38
39 ChildProcess::current()->ReleaseProcess(); 39 ChildProcess::current()->ReleaseProcess();
40 } 40 }
41 41
42 void UtilityThread::OnUnpackWebResource(const std::string& resource_data) { 42 void UtilityThread::OnUnpackWebResource(const std::string& resource_data) {
43 // Parse json data. 43 // Parse json data.
44 // TODO(mrc): Add the possibility of a template that controls parsing, and 44 // TODO(mrc): Add the possibility of a template that controls parsing, and
(...skipping 12 matching lines...) Expand all
57 57
58 void UtilityThread::OnParseUpdateManifest(const std::string& xml) { 58 void UtilityThread::OnParseUpdateManifest(const std::string& xml) {
59 UpdateManifest manifest; 59 UpdateManifest manifest;
60 if (!manifest.Parse(xml)) { 60 if (!manifest.Parse(xml)) {
61 Send(new UtilityHostMsg_ParseUpdateManifest_Failed(manifest.errors())); 61 Send(new UtilityHostMsg_ParseUpdateManifest_Failed(manifest.errors()));
62 } else { 62 } else {
63 Send(new UtilityHostMsg_ParseUpdateManifest_Succeeded(manifest.results())); 63 Send(new UtilityHostMsg_ParseUpdateManifest_Succeeded(manifest.results()));
64 } 64 }
65 ChildProcess::current()->ReleaseProcess(); 65 ChildProcess::current()->ReleaseProcess();
66 } 66 }
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/unpacker/no_locale_data/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698