| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/webui/url_data_source_impl.h" | 5 #include "content/browser/webui/url_data_source_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "content/browser/webui/url_data_manager_backend.h" | 10 #include "content/browser/webui/url_data_manager_backend.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // count). This means it's entirely possible for the DataSource to invoke | 38 // count). This means it's entirely possible for the DataSource to invoke |
| 39 // |SendResponse| between the time when there are no more refs and the time | 39 // |SendResponse| between the time when there are no more refs and the time |
| 40 // when the object is deleted. | 40 // when the object is deleted. |
| 41 return; | 41 return; |
| 42 } | 42 } |
| 43 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 43 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 44 base::Bind(&URLDataSourceImpl::SendResponseOnIOThread, | 44 base::Bind(&URLDataSourceImpl::SendResponseOnIOThread, |
| 45 this, request_id, std::move(bytes))); | 45 this, request_id, std::move(bytes))); |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool URLDataSourceImpl::IsWebUIDataSourceImpl() const { |
| 49 return false; |
| 50 } |
| 51 |
| 48 void URLDataSourceImpl::SendResponseOnIOThread( | 52 void URLDataSourceImpl::SendResponseOnIOThread( |
| 49 int request_id, | 53 int request_id, |
| 50 scoped_refptr<base::RefCountedMemory> bytes) { | 54 scoped_refptr<base::RefCountedMemory> bytes) { |
| 51 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 55 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 52 if (backend_) | 56 if (backend_) |
| 53 backend_->DataAvailable(request_id, bytes.get()); | 57 backend_->DataAvailable(request_id, bytes.get()); |
| 54 } | 58 } |
| 55 | 59 |
| 56 } // namespace content | 60 } // namespace content |
| OLD | NEW |