当前位置: 首页>>代码示例>>C++>>正文


C++ base::KillProcess方法代码示例

本文整理汇总了C++中base::KillProcess方法的典型用法代码示例。如果您正苦于以下问题:C++ base::KillProcess方法的具体用法?C++ base::KillProcess怎么用?C++ base::KillProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在base的用法示例。


在下文中一共展示了base::KillProcess方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CrashReporter

bool
PluginModuleParent::ShouldContinueFromReplyTimeout()
{
#ifdef MOZ_CRASHREPORTER
    CrashReporterParent* crashReporter = CrashReporter();
    if (crashReporter->GeneratePairedMinidump(this)) {
        mBrowserDumpID = crashReporter->ParentDumpID();
        mPluginDumpID = crashReporter->ChildDumpID();
        PLUGIN_LOG_DEBUG(
                ("generated paired browser/plugin minidumps: %s/%s (ID=%s)",
                 NS_ConvertUTF16toUTF8(mBrowserDumpID).get(),
                 NS_ConvertUTF16toUTF8(mPluginDumpID).get(),
                 NS_ConvertUTF16toUTF8(crashReporter->HangID()).get()));
    } else {
        NS_WARNING("failed to capture paired minidumps from hang");
    }
#endif

    // this must run before the error notification from the channel,
    // or not at all
    MessageLoop::current()->PostTask(
        FROM_HERE,
        mTaskFactory.NewRunnableMethod(
            &PluginModuleParent::CleanupFromTimeout));

    if (!KillProcess(OtherProcess(), 1, false))
        NS_WARNING("failed to kill subprocess!");

    return false;
}
开发者ID:typ4rk,项目名称:mozilla-history,代码行数:30,代码来源:PluginModuleParent.cpp

示例2: if

void
PluginModuleParent::OnCrash(DWORD processID, const nsAString& aDumpID)
{
    if (!mPluginDumpID.IsEmpty()) {
        // One process has already crashed: we assume that the first-to-crash
        // is the interesting one
        return;
    }

    mPluginDumpID = aDumpID;

    CrashReporter::AnnotationTable notes;
    notes.Init(4);
    WriteExtraDataForMinidump(notes);
    notes.Put(NS_LITERAL_CSTRING("ProcessType"), NS_LITERAL_CSTRING("plugin"));
    if (processID == mFlashProcess1) {
        notes.Put(NS_LITERAL_CSTRING("FlashProcessDump"),
                  NS_LITERAL_CSTRING("Broker"));
    }
    else if (processID == mFlashProcess2) {
        notes.Put(NS_LITERAL_CSTRING("FlashProcessDump"),
                  NS_LITERAL_CSTRING("Sandbox"));
    }
    else {
        NS_ERROR("Got minidump for Flash process neither broker nor sandbox.");
    }

    CrashReporter::AppendExtraData(aDumpID, notes);
    MessageLoop::current()->PostTask(
        FROM_HERE,
        mTaskFactory.NewRunnableMethod(
            &PluginModuleParent::CleanupFromTimeout));

    KillProcess(OtherProcess(), 1, false);
}
开发者ID:secretrobotron,项目名称:mozilla-central,代码行数:35,代码来源:PluginModuleParent.cpp

示例3: CrashReporter

bool
PluginModuleParent::ShouldContinueFromReplyTimeout()
{
#ifdef MOZ_CRASHREPORTER
    CrashReporterParent* crashReporter = CrashReporter();
    crashReporter->AnnotateCrashReport(NS_LITERAL_CSTRING("PluginHang"),
                                       NS_LITERAL_CSTRING("1"));
    if (crashReporter->GeneratePairedMinidump(this)) {
        mPluginDumpID = crashReporter->ChildDumpID();
        PLUGIN_LOG_DEBUG(
                ("generated paired browser/plugin minidumps: %s)",
                 NS_ConvertUTF16toUTF8(mPluginDumpID).get()));

        crashReporter->AnnotateCrashReport(
            NS_LITERAL_CSTRING("additional_minidumps"),
            NS_LITERAL_CSTRING("browser"));

        // TODO: collect Flash minidumps here
    } else {
        NS_WARNING("failed to capture paired minidumps from hang");
    }
#endif

#ifdef XP_WIN
    // collect cpu usage for plugin processes

    InfallibleTArray<base::ProcessHandle> processHandles;
    base::ProcessHandle handle;

    processHandles.AppendElement(OtherProcess());
#ifdef MOZ_CRASHREPORTER_INJECTOR
    if (mFlashProcess1 && base::OpenProcessHandle(mFlashProcess1, &handle)) {
      processHandles.AppendElement(handle);
    }
    if (mFlashProcess2 && base::OpenProcessHandle(mFlashProcess2, &handle)) {
      processHandles.AppendElement(handle);
    }
#endif

    if (!GetProcessCpuUsage(processHandles, mPluginCpuUsageOnHang)) {
      mPluginCpuUsageOnHang.Clear();
    }
#endif

    // this must run before the error notification from the channel,
    // or not at all
    MessageLoop::current()->PostTask(
        FROM_HERE,
        mTaskFactory.NewRunnableMethod(
            &PluginModuleParent::CleanupFromTimeout));

    if (!KillProcess(OtherProcess(), 1, false))
        NS_WARNING("failed to kill subprocess!");

    return false;
}
开发者ID:ChicoTeam,项目名称:mozilla-central,代码行数:56,代码来源:PluginModuleParent.cpp

示例4: OtherProcess

bool
PluginModuleParent::ShouldContinueFromReplyTimeout()
{
#ifdef MOZ_CRASHREPORTER
    nsCOMPtr<nsILocalFile> pluginDump;
    nsCOMPtr<nsILocalFile> browserDump;
    CrashReporter::ProcessHandle child;
#ifdef XP_MACOSX
    child = mSubprocess->GetChildTask();
#else
    child = OtherProcess();
#endif
    if (CrashReporter::CreatePairedMinidumps(child,
                                             mPluginThread,
                                             &mHangID,
                                             getter_AddRefs(pluginDump),
                                             getter_AddRefs(browserDump)) &&
        CrashReporter::GetIDFromMinidump(pluginDump, mPluginDumpID) &&
        CrashReporter::GetIDFromMinidump(browserDump, mBrowserDumpID)) {

        PLUGIN_LOG_DEBUG(
            ("generated paired browser/plugin minidumps: %s/%s (ID=%s)",
             NS_ConvertUTF16toUTF8(mBrowserDumpID).get(),
             NS_ConvertUTF16toUTF8(mPluginDumpID).get(),
             NS_ConvertUTF16toUTF8(mHangID).get()));
    }
    else {
        NS_WARNING("failed to capture paired minidumps from hang");
    }
#endif

    // this must run before the error notification from the channel,
    // or not at all
    MessageLoop::current()->PostTask(
        FROM_HERE,
        mTaskFactory.NewRunnableMethod(
            &PluginModuleParent::CleanupFromTimeout));

    if (!KillProcess(OtherProcess(), 1, false))
        NS_WARNING("failed to kill subprocess!");

    return false;
}
开发者ID:gorakhargosh,项目名称:mozilla-central,代码行数:43,代码来源:PluginModuleParent.cpp


注:本文中的base::KillProcess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。