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

Side by Side Diff: content/browser/loader/stream_writer.h

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_LOADER_STREAM_WRITER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_STREAM_WRITER_H_
6 #define CONTENT_BROWSER_LOADER_STREAM_WRITER_H_ 6 #define CONTENT_BROWSER_LOADER_STREAM_WRITER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "content/browser/streams/stream_write_observer.h" 10 #include "content/browser/streams/stream_write_observer.h"
(...skipping 11 matching lines...) Expand all
22 class StreamRegistry; 22 class StreamRegistry;
23 23
24 // StreamWriter is a helper class for ResourceHandlers which route their output 24 // StreamWriter is a helper class for ResourceHandlers which route their output
25 // into a Stream. It manages an internal buffer and handles back-pressure from 25 // into a Stream. It manages an internal buffer and handles back-pressure from
26 // the Stream's reader. 26 // the Stream's reader.
27 class StreamWriter : public StreamWriteObserver { 27 class StreamWriter : public StreamWriteObserver {
28 public: 28 public:
29 // Creates a new StreamWriter without an initialized Stream or controller. The 29 // Creates a new StreamWriter without an initialized Stream or controller. The
30 // controller must be set before the writer is used. 30 // controller must be set before the writer is used.
31 StreamWriter(); 31 StreamWriter();
32 virtual ~StreamWriter(); 32 ~StreamWriter() override;
33 33
34 Stream* stream() { return stream_.get(); } 34 Stream* stream() { return stream_.get(); }
35 35
36 void set_controller(ResourceController* controller) { 36 void set_controller(ResourceController* controller) {
37 controller_ = controller; 37 controller_ = controller;
38 } 38 }
39 39
40 // Initializes the writer with a new Stream in |registry|. |origin| will be 40 // Initializes the writer with a new Stream in |registry|. |origin| will be
41 // used to construct the URL for the Stream. See WebCore::BlobURL and and 41 // used to construct the URL for the Stream. See WebCore::BlobURL and and
42 // WebCore::SecurityOrigin in Blink to understand how origin check is done on 42 // WebCore::SecurityOrigin in Blink to understand how origin check is done on
(...skipping 18 matching lines...) Expand all
61 // Resume is called on |controller_|. 61 // Resume is called on |controller_|.
62 // 62 //
63 // InitializeStream must have been called before calling OnReadCompleted. 63 // InitializeStream must have been called before calling OnReadCompleted.
64 void OnReadCompleted(int bytes_read, bool* defer); 64 void OnReadCompleted(int bytes_read, bool* defer);
65 65
66 // Called when there is no more data to read to the stream. 66 // Called when there is no more data to read to the stream.
67 void Finalize(); 67 void Finalize();
68 68
69 private: 69 private:
70 // StreamWriteObserver implementation. 70 // StreamWriteObserver implementation.
71 virtual void OnSpaceAvailable(Stream* stream) override; 71 void OnSpaceAvailable(Stream* stream) override;
72 virtual void OnClose(Stream* stream) override; 72 void OnClose(Stream* stream) override;
73 73
74 ResourceController* controller_; 74 ResourceController* controller_;
75 scoped_refptr<Stream> stream_; 75 scoped_refptr<Stream> stream_;
76 scoped_refptr<net::IOBuffer> read_buffer_; 76 scoped_refptr<net::IOBuffer> read_buffer_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(StreamWriter); 78 DISALLOW_COPY_AND_ASSIGN(StreamWriter);
79 }; 79 };
80 80
81 } // namespace content 81 } // namespace content
82 82
83 #endif // CONTENT_BROWSER_LOADER_STREAM_WRITER_H_ 83 #endif // CONTENT_BROWSER_LOADER_STREAM_WRITER_H_
OLDNEW
« no previous file with comments | « content/browser/loader/stream_resource_handler.h ('k') | content/browser/loader/sync_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698