Beispiel #1
0
void Debugger::updateProxySandbox(DebuggerProxyPtr proxy,
                                  const StringData* sandboxId) {
  // update proxy's sandbox info from what is on file
  SandboxMap::const_accessor acc;
  if (m_sandboxMap.find(acc, sandboxId)) {
    proxy->updateSandbox(acc->second);
  } else {
    // don't have the sandbox on file yet. create a sandbox info with
    // no path for now. Sandbox path will be updated upon first request
    // with that sandbox arrives
    DSandboxInfoPtr sb(new DSandboxInfo(sandboxId->toCPPString()));
    proxy->updateSandbox(sb);
  }
}
Beispiel #2
0
void Debugger::switchSandbox(DebuggerProxyPtr proxy,
                             const std::string &newId) {
  WriteLock lock(m_mutex);

  string oldId = proxy->getSandboxId();
  m_proxies[oldId].reset();
  m_proxies[newId] = proxy;

  // makes sure proxy's sandbox info is complete with path, etc..
  if (m_sandboxes.find(newId) != m_sandboxes.end()) {
    proxy->updateSandbox(m_sandboxes[newId]);
  } else {
    DSandboxInfoPtr sb(new DSandboxInfo(newId));
    m_sandboxes[newId] = sb;
    proxy->updateSandbox(sb);
  }

  flagDebugger(newId);
}