| 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_WEBUI_URL_DATA_SOURCE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEBUI_URL_DATA_SOURCE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_WEBUI_URL_DATA_SOURCE_IMPL_H_ | 6 #define CONTENT_BROWSER_WEBUI_URL_DATA_SOURCE_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 // Report that a request has resulted in the data |bytes|. | 57 // Report that a request has resulted in the data |bytes|. |
| 58 // If the request can't be satisfied, pass NULL for |bytes| to indicate | 58 // If the request can't be satisfied, pass NULL for |bytes| to indicate |
| 59 // the request is over. | 59 // the request is over. |
| 60 virtual void SendResponse(int request_id, | 60 virtual void SendResponse(int request_id, |
| 61 scoped_refptr<base::RefCountedMemory> bytes); | 61 scoped_refptr<base::RefCountedMemory> bytes); |
| 62 | 62 |
| 63 const std::string& source_name() const { return source_name_; } | 63 const std::string& source_name() const { return source_name_; } |
| 64 URLDataSource* source() const { return source_.get(); } | 64 URLDataSource* source() const { return source_.get(); } |
| 65 | 65 |
| 66 virtual bool IsWebUIDataSourceImpl() const; |
| 67 |
| 66 protected: | 68 protected: |
| 67 virtual ~URLDataSourceImpl(); | 69 virtual ~URLDataSourceImpl(); |
| 68 | 70 |
| 69 private: | 71 private: |
| 70 friend class URLDataManager; | 72 friend class URLDataManager; |
| 71 friend class URLDataManagerBackend; | 73 friend class URLDataManagerBackend; |
| 72 friend class base::DeleteHelper<URLDataSourceImpl>; | 74 friend class base::DeleteHelper<URLDataSourceImpl>; |
| 73 | 75 |
| 74 // SendResponse invokes this on the IO thread. Notifies the backend to | 76 // SendResponse invokes this on the IO thread. Notifies the backend to |
| 75 // handle the actual work of sending the data. | 77 // handle the actual work of sending the data. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 90 // scoped_refptr else there would be a cycle between the backend and data | 92 // scoped_refptr else there would be a cycle between the backend and data |
| 91 // source. | 93 // source. |
| 92 URLDataManagerBackend* backend_; | 94 URLDataManagerBackend* backend_; |
| 93 | 95 |
| 94 std::unique_ptr<URLDataSource> source_; | 96 std::unique_ptr<URLDataSource> source_; |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 } // namespace content | 99 } // namespace content |
| 98 | 100 |
| 99 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_SOURCE_IMPL_H_ | 101 #endif // CONTENT_BROWSER_WEBUI_URL_DATA_SOURCE_IMPL_H_ |
| OLD | NEW |