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

Side by Side Diff: content/browser/streams/stream_url_request_job.h

Issue 12212031: Add support for redirecting ResourceHandlers to a blob: URL (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Code review fixes Created 7 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 CONTENT_BROWSER_STREAMS_STREAM_URL_REQUEST_JOB_H_
6 #define CONTENT_BROWSER_STREAMS_STREAM_URL_REQUEST_JOB_H_
7
8 #include "net/url_request/url_request_job.h"
9 #include "content/browser/streams/stream_read_observer.h"
10 #include "content/common/content_export.h"
11
12 namespace content {
13 class Stream;
14
15 // A request job that handles reading stream URLs.
16 class CONTENT_EXPORT StreamURLRequestJob
17 : public net::URLRequestJob,
18 public StreamReadObserver {
19 public:
20 StreamURLRequestJob(net::URLRequest* request,
21 net::NetworkDelegate* network_delegate,
22 scoped_refptr<Stream> stream);
23
24 // StreamObserver methods.
25 virtual void OnDataAvailable(Stream* stream) OVERRIDE;
26 virtual void OnStreamConsumed(Stream* stream) OVERRIDE;
27
28 // net::URLRequestJob methods.
29 virtual void Start() OVERRIDE;
30 virtual void Kill() OVERRIDE;
31 virtual bool ReadRawData(net::IOBuffer* buf,
32 int buf_size,
33 int* bytes_read) OVERRIDE;
34 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
35 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE;
36 virtual int GetResponseCode() const OVERRIDE;
37 virtual void SetExtraRequestHeaders(
38 const net::HttpRequestHeaders& headers) OVERRIDE;
39
40 protected:
41 virtual ~StreamURLRequestJob();
42
43 private:
44 void DidStart();
45 void NotifyFailure(int);
46 void HeadersCompleted(int status_code, const std::string& status_txt);
47
48 base::WeakPtrFactory<StreamURLRequestJob> weak_factory_;
49 scoped_refptr<content::Stream> stream_;
50 bool headers_set_;
51 scoped_refptr<net::IOBuffer> pending_buffer_;
52 int pending_buffer_size_;
53 scoped_ptr<net::HttpResponseInfo> response_info_;
54
55 DISALLOW_COPY_AND_ASSIGN(StreamURLRequestJob);
56 };
57
58 } // namespace content
59
60 #endif // CONTENT_BROWSER_STREAMS_STREAM_URL_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « content/browser/streams/stream_registry.cc ('k') | content/browser/streams/stream_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698