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

Unified Diff: chrome_frame/cfproxy_factory.cc

Issue 9838102: Remove ChromeProxy and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/cfproxy.h ('k') | chrome_frame/cfproxy_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/cfproxy_factory.cc
diff --git a/chrome_frame/cfproxy_factory.cc b/chrome_frame/cfproxy_factory.cc
deleted file mode 100644
index 35694afdfdc08f1503ca2a6c2b35f3985d40ddbd..0000000000000000000000000000000000000000
--- a/chrome_frame/cfproxy_factory.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2011 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_frame/cfproxy_private.h"
-#include "base/process_util.h"
-
-IPC::Message::Sender* CFProxyTraits::CreateChannel(const std::string& id,
- IPC::Channel::Listener* listener) {
- IPC::Channel* c = new IPC::Channel(id, IPC::Channel::MODE_SERVER, listener);
- if (c)
- c->Connect(); // must be called on the IPC thread.
- return c;
-}
-
-void CFProxyTraits::CloseChannel(IPC::Message::Sender* s) {
- IPC::Channel *c = static_cast<IPC::Channel*>(s);
- delete c;
-}
-
-bool CFProxyTraits::LaunchApp(const std::wstring& cmd_line) {
- return base::LaunchProcess(cmd_line, base::LaunchOptions(), NULL);
-}
-
-//////////////////////////////////////////////////////////
-// ChromeProxyFactory
-
-ChromeProxyFactory::ChromeProxyFactory() {
-}
-
-ChromeProxyFactory::~ChromeProxyFactory() {
- base::AutoLock lock(lock_);
- ProxyMap::iterator it = proxies_.begin();
- for (; it != proxies_.end(); ++it) {
- ChromeProxy* proxy = it->second;
- delete proxy;
- }
- proxies_.clear();
-}
-
-void ChromeProxyFactory::GetProxy(ChromeProxyDelegate* delegate,
- const ProxyParams& params) {
- base::AutoLock lock(lock_);
- ChromeProxy* proxy = NULL;
- // TODO(stoyan): consider extra_params/timeout
- ProxyMap::iterator it = proxies_.find(params.profile);
- if (it == proxies_.end()) {
- proxy = CreateProxy();
- proxy->Init(params);
- proxies_.insert(make_pair(params.profile, proxy));
- } else {
- proxy = it->second;
- }
-
- proxy->AddDelegate(delegate);
- // TODO(stoyan): ::DeleteTimerQueueTimer (if any).
-}
-
-bool ChromeProxyFactory::ReleaseProxy(ChromeProxyDelegate* delegate,
- const std::string& profile) {
- base::AutoLock lock(lock_);
- ProxyMap::iterator it = proxies_.find(profile);
- if (it == proxies_.end())
- return false;
-
- if (0 == it->second->RemoveDelegate(delegate)) {
- // This was the last delegate for this proxy.
- // TODO(stoyan): Use ::CreateTimerQueueTimer to schedule destroy of
- // the proxy in a reasonable timeout.
- }
-
- return true;
-}
-
-static CFProxyTraits g_default_traits;
-ChromeProxy* ChromeProxyFactory::CreateProxy() {
- ChromeProxy* p = new CFProxy(&g_default_traits);
- return p;
-}
« no previous file with comments | « chrome_frame/cfproxy.h ('k') | chrome_frame/cfproxy_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698