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

Side by Side Diff: Source/core/streams/Stream.h

Issue 1229743005: Fix virtual/override/final usage in Source/core/{fetch,loader,streams,xmlhttprequest}/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Stream); 46 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Stream);
47 DEFINE_WRAPPERTYPEINFO(); 47 DEFINE_WRAPPERTYPEINFO();
48 public: 48 public:
49 static Stream* create(ExecutionContext* context, const String& mediaType) 49 static Stream* create(ExecutionContext* context, const String& mediaType)
50 { 50 {
51 Stream* stream = new Stream(context, mediaType); 51 Stream* stream = new Stream(context, mediaType);
52 stream->suspendIfNeeded(); 52 stream->suspendIfNeeded();
53 return stream; 53 return stream;
54 } 54 }
55 55
56 virtual ~Stream(); 56 ~Stream() override;
57 57
58 // Returns the internal URL referring to this stream. 58 // Returns the internal URL referring to this stream.
59 const KURL& url() const { return m_internalURL; } 59 const KURL& url() const { return m_internalURL; }
60 // Returns the media type of this stream. 60 // Returns the media type of this stream.
61 const String& type() const { return m_mediaType; } 61 const String& type() const { return m_mediaType; }
62 62
63 // Appends data to this stream. 63 // Appends data to this stream.
64 void addData(const char* data, size_t len); 64 void addData(const char* data, size_t len);
65 // Flushes contents buffered in the stream. 65 // Flushes contents buffered in the stream.
66 void flush(); 66 void flush();
67 // Mark this stream finalized so that a reader of this stream is notified 67 // Mark this stream finalized so that a reader of this stream is notified
68 // of EOF. 68 // of EOF.
69 void finalize(); 69 void finalize();
70 // Mark this stream finalized due to an error so that a reader of this 70 // Mark this stream finalized due to an error so that a reader of this
71 // stream is notified of EOF due to the error. 71 // stream is notified of EOF due to the error.
72 void abort(); 72 void abort();
73 73
74 // Allow an external reader class to mark this object neutered so that they 74 // Allow an external reader class to mark this object neutered so that they
75 // won't load the corresponding stream again. All stream objects are 75 // won't load the corresponding stream again. All stream objects are
76 // read-once for now. 76 // read-once for now.
77 void neuter() { m_isNeutered = true; } 77 void neuter() { m_isNeutered = true; }
78 bool isNeutered() const { return m_isNeutered; } 78 bool isNeutered() const { return m_isNeutered; }
79 79
80 // Implementation of ActiveDOMObject. 80 // Implementation of ActiveDOMObject.
81 // 81 //
82 // FIXME: Implement suspend() and resume() when necessary. 82 // FIXME: Implement suspend() and resume() when necessary.
83 virtual void suspend() override; 83 void suspend() override;
84 virtual void resume() override; 84 void resume() override;
85 virtual void stop() override; 85 void stop() override;
86 86
87 DECLARE_VIRTUAL_TRACE(); 87 DECLARE_VIRTUAL_TRACE();
88 88
89 protected: 89 protected:
90 Stream(ExecutionContext*, const String& mediaType); 90 Stream(ExecutionContext*, const String& mediaType);
91 91
92 // This is an internal URL referring to the blob data associated with this o bject. It serves 92 // This is an internal URL referring to the blob data associated with this o bject. It serves
93 // as an identifier for this blob. The internal URL is never used to source the blob's content 93 // as an identifier for this blob. The internal URL is never used to source the blob's content
94 // into an HTML or for FileRead'ing, public blob URLs must be used for those purposes. 94 // into an HTML or for FileRead'ing, public blob URLs must be used for those purposes.
95 KURL m_internalURL; 95 KURL m_internalURL;
96 96
97 String m_mediaType; 97 String m_mediaType;
98 98
99 bool m_isNeutered; 99 bool m_isNeutered;
100 }; 100 };
101 101
102 } // namespace blink 102 } // namespace blink
103 103
104 #endif // Stream_h 104 #endif // Stream_h
OLDNEW
« no previous file with comments | « Source/core/loader/appcache/ApplicationCacheHost.h ('k') | Source/core/xmlhttprequest/XMLHttpRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698