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

Side by Side Diff: net/url_request/url_request_job_factory.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « net/url_request/url_request_job.cc ('k') | net/url_request/url_request_job_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/threading/non_thread_safe.h"
13 #include "net/base/net_export.h"
14
15 class GURL;
16
17 namespace net {
18
19 class NetworkDelegate;
20 class URLRequest;
21 class URLRequestJob;
22
23 class NET_EXPORT URLRequestJobFactory
24 : NON_EXPORTED_BASE(public base::NonThreadSafe) {
25 public:
26 // TODO(shalev): Move this to URLRequestJobFactoryImpl.
27 class NET_EXPORT ProtocolHandler {
28 public:
29 virtual ~ProtocolHandler();
30
31 virtual URLRequestJob* MaybeCreateJob(
32 URLRequest* request, NetworkDelegate* network_delegate) const = 0;
33
34 // Indicates if it should be safe to redirect to |location|. Should handle
35 // protocols handled by MaybeCreateJob(). Only called when registered with
36 // URLRequestJobFactoryImpl::SetProtocolHandler() not called when used with
37 // ProtocolInterceptJobFactory.
38 // NOTE(pauljensen): Default implementation returns true.
39 virtual bool IsSafeRedirectTarget(const GURL& location) const;
40 };
41
42 URLRequestJobFactory();
43 virtual ~URLRequestJobFactory();
44
45 virtual URLRequestJob* MaybeCreateJobWithProtocolHandler(
46 const std::string& scheme,
47 URLRequest* request,
48 NetworkDelegate* network_delegate) const = 0;
49
50 virtual URLRequestJob* MaybeInterceptRedirect(
51 URLRequest* request,
52 NetworkDelegate* network_delegate,
53 const GURL& location) const = 0;
54
55 virtual URLRequestJob* MaybeInterceptResponse(
56 URLRequest* request,
57 NetworkDelegate* network_delegate) const = 0;
58
59 virtual bool IsHandledProtocol(const std::string& scheme) const = 0;
60
61 virtual bool IsHandledURL(const GURL& url) const = 0;
62
63 virtual bool IsSafeRedirectTarget(const GURL& location) const = 0;
64
65 private:
66 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory);
67 };
68
69 } // namespace net
70
71 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_job.cc ('k') | net/url_request/url_request_job_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698