diff options
author | jamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-16 21:53:51 +0000 |
---|---|---|
committer | jamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-16 21:53:51 +0000 |
commit | 53021f822333a6e12a552b37a0e82b41bc85c867 (patch) | |
tree | 38278a89a6c379b286c8077ac40e4951796736d1 /remoting/host/url_request_context.h | |
parent | 90f53ef834d187fe71d4deb102c822475295aa8a (diff) | |
download | chromium_src-53021f822333a6e12a552b37a0e82b41bc85c867.zip chromium_src-53021f822333a6e12a552b37a0e82b41bc85c867.tar.gz chromium_src-53021f822333a6e12a552b37a0e82b41bc85c867.tar.bz2 |
Added helper classes to allow OAuth to be used in Me2Me.
These classes are heavily based on equivalents under chrome/service, although
they're somewhat simpler.
This is part of the groundwork needed to let us use OAuth instead of Client
Login for Me2Me. The web-app can present a refresh token, and these classes
will allow us to turn it into an access token on-demand.
BUG=None
TEST=None
Review URL: https://chromiumcodereview.appspot.com/9677027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127260 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/url_request_context.h')
-rw-r--r-- | remoting/host/url_request_context.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/remoting/host/url_request_context.h b/remoting/host/url_request_context.h new file mode 100644 index 0000000..c8aaeaf --- /dev/null +++ b/remoting/host/url_request_context.h @@ -0,0 +1,53 @@ +// Copyright (c) 2012 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. + +#ifndef REMOTING_HOST_URL_REQUEST_CONTEXT_H_ +#define REMOTING_HOST_URL_REQUEST_CONTEXT_H_ + +#include <string> + +#include "base/memory/scoped_ptr.h" +#include "base/message_loop.h" +#include "net/proxy/proxy_config_service.h" +#include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" +#include "net/url_request/url_request_context_storage.h" + +namespace base { +class MessageLoopProxy; +} // namespace base + +namespace remoting { + +// Subclass of net::URLRequestContext which can be used to store extra +// information for requests. This subclass is meant to be used in the +// remoting Me2Me host process where the profile is not available. +class URLRequestContext : public net::URLRequestContext { + public: + explicit URLRequestContext(net::ProxyConfigService* net_proxy_config_service); + + private: + net::URLRequestContextStorage storage_; +}; + +class URLRequestContextGetter : public net::URLRequestContextGetter { + public: + URLRequestContextGetter(MessageLoop* io_message_loop, + MessageLoop* file_message_loop); + virtual ~URLRequestContextGetter(); + + // Overridden from net::URLRequestContextGetter: + virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE; + virtual scoped_refptr<base::MessageLoopProxy> + GetIOMessageLoopProxy() const OVERRIDE; + + private: + scoped_refptr<net::URLRequestContext> url_request_context_; + scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; + scoped_ptr<net::ProxyConfigService> proxy_config_service_; +}; + +} // namespace remoting + +#endif // CHROME_SERVICE_NET_SERVICE_URL_REQUEST_CONTEXT_H_ |