| 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_manager_backend.h" | 5 #include "content/browser/webui/url_data_manager_backend.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 DCHECK(data_); | 419 DCHECK(data_); |
| 420 CHECK(buf->data()); | 420 CHECK(buf->data()); |
| 421 | 421 |
| 422 int remaining = data_->size() - data_offset_; | 422 int remaining = data_->size() - data_offset_; |
| 423 if (buf_size > remaining) | 423 if (buf_size > remaining) |
| 424 buf_size = remaining; | 424 buf_size = remaining; |
| 425 | 425 |
| 426 if (buf_size == 0) | 426 if (buf_size == 0) |
| 427 return 0; | 427 return 0; |
| 428 | 428 |
| 429 base::WorkerPool::GetTaskRunner(false)->PostTaskAndReply( | 429 base::WorkerPool::GetTaskRunner(true)->PostTaskAndReply( |
| 430 FROM_HERE, base::Bind(&CopyData, base::RetainedRef(buf), buf_size, data_, | 430 FROM_HERE, base::Bind(&CopyData, base::RetainedRef(buf), buf_size, data_, |
| 431 data_offset_), | 431 data_offset_), |
| 432 base::Bind(&URLRequestChromeJob::ReadRawDataComplete, AsWeakPtr(), | 432 base::Bind(&URLRequestChromeJob::ReadRawDataComplete, AsWeakPtr(), |
| 433 buf_size)); | 433 buf_size)); |
| 434 data_offset_ += buf_size; | 434 data_offset_ += buf_size; |
| 435 | 435 |
| 436 return net::ERR_IO_PENDING; | 436 return net::ERR_IO_PENDING; |
| 437 } | 437 } |
| 438 | 438 |
| 439 void URLRequestChromeJob::DelayStartForDevTools( | 439 void URLRequestChromeJob::DelayStartForDevTools( |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 | 819 |
| 820 } // namespace | 820 } // namespace |
| 821 | 821 |
| 822 net::URLRequestJobFactory::ProtocolHandler* | 822 net::URLRequestJobFactory::ProtocolHandler* |
| 823 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 823 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
| 824 bool is_incognito) { | 824 bool is_incognito) { |
| 825 return new DevToolsJobFactory(resource_context, is_incognito); | 825 return new DevToolsJobFactory(resource_context, is_incognito); |
| 826 } | 826 } |
| 827 | 827 |
| 828 } // namespace content | 828 } // namespace content |
| OLD | NEW |