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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 CHECK(buf->data()); | 467 CHECK(buf->data()); |
468 | 468 |
469 int remaining = data_->size() - data_offset_; | 469 int remaining = data_->size() - data_offset_; |
470 if (buf_size > remaining) | 470 if (buf_size > remaining) |
471 buf_size = remaining; | 471 buf_size = remaining; |
472 | 472 |
473 if (buf_size == 0) | 473 if (buf_size == 0) |
474 return 0; | 474 return 0; |
475 | 475 |
476 base::PostTaskWithTraitsAndReply( | 476 base::PostTaskWithTraitsAndReply( |
477 FROM_HERE, base::TaskTraits().WithShutdownBehavior( | 477 FROM_HERE, {base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
478 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN), | |
479 base::Bind(&CopyData, base::RetainedRef(buf), buf_size, data_, | 478 base::Bind(&CopyData, base::RetainedRef(buf), buf_size, data_, |
480 data_offset_), | 479 data_offset_), |
481 base::Bind(&URLRequestChromeJob::ReadRawDataComplete, AsWeakPtr(), | 480 base::Bind(&URLRequestChromeJob::ReadRawDataComplete, AsWeakPtr(), |
482 buf_size)); | 481 buf_size)); |
483 data_offset_ += buf_size; | 482 data_offset_ += buf_size; |
484 | 483 |
485 return net::ERR_IO_PENDING; | 484 return net::ERR_IO_PENDING; |
486 } | 485 } |
487 | 486 |
488 void URLRequestChromeJob::DelayStartForDevTools( | 487 void URLRequestChromeJob::DelayStartForDevTools( |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 | 852 |
854 } // namespace | 853 } // namespace |
855 | 854 |
856 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( | 855 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( |
857 ResourceContext* resource_context, | 856 ResourceContext* resource_context, |
858 bool is_incognito) { | 857 bool is_incognito) { |
859 return new DevToolsJobFactory(resource_context, is_incognito); | 858 return new DevToolsJobFactory(resource_context, is_incognito); |
860 } | 859 } |
861 | 860 |
862 } // namespace content | 861 } // namespace content |
OLD | NEW |