blob: 269a86b5da083bf2e2712671f293bb9f893617c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/utility/utility_thread.h"
#include "chrome/common/child_process.h"
#include "chrome/common/extensions/extension_unpacker.h"
#include "chrome/common/render_messages.h"
UtilityThread::UtilityThread() : ChildThread(base::Thread::Options()) {
}
UtilityThread::~UtilityThread() {
}
void UtilityThread::Init() {
ChildThread::Init();
ChildProcess::current()->AddRefProcess();
}
void UtilityThread::CleanUp() {
// Shutdown in reverse of the initialization order.
ChildThread::CleanUp();
}
void UtilityThread::OnControlMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(UtilityThread, msg)
IPC_MESSAGE_HANDLER(UtilityMsg_UnpackExtension, OnUnpackExtension)
IPC_END_MESSAGE_MAP()
}
void UtilityThread::OnUnpackExtension(const FilePath& extension_path) {
ExtensionUnpacker unpacker(extension_path);
bool success = unpacker.Run();
Send(new UtilityHostMsg_UnpackExtension_Reply(success,
unpacker.error_message()));
ChildProcess::current()->ReleaseProcess();
}
|