Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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_STREAMS_STREAM_H_ | 5 #ifndef CONTENT_BROWSER_STREAMS_STREAM_H_ |
| 6 #define CONTENT_BROWSER_STREAMS_STREAM_H_ | 6 #define CONTENT_BROWSER_STREAMS_STREAM_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 | 68 |
| 69 scoped_ptr<StreamHandle> CreateHandle(const GURL& original_url, | 69 scoped_ptr<StreamHandle> CreateHandle(const GURL& original_url, |
| 70 const std::string& mime_type); | 70 const std::string& mime_type); |
| 71 void CloseHandle(); | 71 void CloseHandle(); |
| 72 | 72 |
| 73 // Indicates whether there is space in the buffer to add more data. | 73 // Indicates whether there is space in the buffer to add more data. |
| 74 bool can_add_data() const { return can_add_data_; } | 74 bool can_add_data() const { return can_add_data_; } |
| 75 | 75 |
| 76 const GURL& url() const { return url_; } | 76 const GURL& url() const { return url_; } |
| 77 | 77 |
| 78 // TODO(tyoshino): Once security origin handling inside Chromium is fixed, | |
| 79 // revisit callers of the Stream constructor and fix them if necessary to | |
| 80 // pass right data (e.g. FileAPIMessageFilter). | |
|
kinuko
2013/07/18 06:06:55
Do you have an issue number or link to the discuss
tyoshino (SeeGerritForStatus)
2013/07/23 11:54:38
Just filed. crbug.com/263342
| |
| 78 const GURL& security_origin() const { return security_origin_; } | 81 const GURL& security_origin() const { return security_origin_; } |
| 79 | 82 |
| 80 private: | 83 private: |
| 81 friend class base::RefCountedThreadSafe<Stream>; | 84 friend class base::RefCountedThreadSafe<Stream>; |
| 82 | 85 |
| 83 virtual ~Stream(); | 86 virtual ~Stream(); |
| 84 | 87 |
| 85 void OnSpaceAvailable(); | 88 void OnSpaceAvailable(); |
| 86 void OnDataAvailable(); | 89 void OnDataAvailable(); |
| 87 | 90 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 103 | 106 |
| 104 StreamHandleImpl* stream_handle_; | 107 StreamHandleImpl* stream_handle_; |
| 105 | 108 |
| 106 base::WeakPtrFactory<Stream> weak_ptr_factory_; | 109 base::WeakPtrFactory<Stream> weak_ptr_factory_; |
| 107 DISALLOW_COPY_AND_ASSIGN(Stream); | 110 DISALLOW_COPY_AND_ASSIGN(Stream); |
| 108 }; | 111 }; |
| 109 | 112 |
| 110 } // namespace content | 113 } // namespace content |
| 111 | 114 |
| 112 #endif // CONTENT_BROWSER_STREAMS_STREAM_H_ | 115 #endif // CONTENT_BROWSER_STREAMS_STREAM_H_ |
| OLD | NEW |