OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/dom_ui/chrome_url_data_manager.h" | 5 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/ref_counted_memory.h" |
12 #include "base/singleton.h" | 13 #include "base/singleton.h" |
13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
14 #include "base/thread.h" | 15 #include "base/thread.h" |
15 #include "base/values.h" | 16 #include "base/values.h" |
16 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
17 #include "base/win_util.h" | 18 #include "base/win_util.h" |
18 #endif | 19 #endif |
19 #include "chrome/browser/appcache/view_appcache_internals_job_factory.h" | 20 #include "chrome/browser/appcache/view_appcache_internals_job_factory.h" |
20 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/chrome_thread.h" | 22 #include "chrome/browser/chrome_thread.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 PendingRequestMap::iterator i = pending_requests_.find(request_id); | 264 PendingRequestMap::iterator i = pending_requests_.find(request_id); |
264 if (i != pending_requests_.end()) { | 265 if (i != pending_requests_.end()) { |
265 // We acquire a reference to the job so that it doesn't disappear under the | 266 // We acquire a reference to the job so that it doesn't disappear under the |
266 // feet of any method invoked here (we could trigger a callback). | 267 // feet of any method invoked here (we could trigger a callback). |
267 scoped_refptr<URLRequestChromeJob> job = i->second; | 268 scoped_refptr<URLRequestChromeJob> job = i->second; |
268 pending_requests_.erase(i); | 269 pending_requests_.erase(i); |
269 job->DataAvailable(bytes); | 270 job->DataAvailable(bytes); |
270 } | 271 } |
271 } | 272 } |
272 | 273 |
| 274 ChromeURLDataManager::DataSource::DataSource(const std::string& source_name, |
| 275 MessageLoop* message_loop) |
| 276 : source_name_(source_name), message_loop_(message_loop) { |
| 277 } |
| 278 |
| 279 ChromeURLDataManager::DataSource::~DataSource() { |
| 280 } |
| 281 |
273 void ChromeURLDataManager::DataSource::SendResponse( | 282 void ChromeURLDataManager::DataSource::SendResponse( |
274 RequestID request_id, | 283 RequestID request_id, |
275 RefCountedMemory* bytes) { | 284 RefCountedMemory* bytes) { |
276 ChromeThread::PostTask( | 285 ChromeThread::PostTask( |
277 ChromeThread::IO, FROM_HERE, | 286 ChromeThread::IO, FROM_HERE, |
278 NewRunnableMethod(Singleton<ChromeURLDataManager>::get(), | 287 NewRunnableMethod(Singleton<ChromeURLDataManager>::get(), |
279 &ChromeURLDataManager::DataAvailable, | 288 &ChromeURLDataManager::DataAvailable, |
280 request_id, scoped_refptr<RefCountedMemory>(bytes))); | 289 request_id, scoped_refptr<RefCountedMemory>(bytes))); |
281 } | 290 } |
282 | 291 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 net::ERR_INVALID_URL)); | 418 net::ERR_INVALID_URL)); |
410 } | 419 } |
411 } | 420 } |
412 | 421 |
413 URLRequestChromeFileJob::URLRequestChromeFileJob(URLRequest* request, | 422 URLRequestChromeFileJob::URLRequestChromeFileJob(URLRequest* request, |
414 const FilePath& path) | 423 const FilePath& path) |
415 : URLRequestFileJob(request, path) { | 424 : URLRequestFileJob(request, path) { |
416 } | 425 } |
417 | 426 |
418 URLRequestChromeFileJob::~URLRequestChromeFileJob() { } | 427 URLRequestChromeFileJob::~URLRequestChromeFileJob() { } |
OLD | NEW |