Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1564)

Side by Side Diff: content/browser/webui/url_data_manager_backend.cc

Issue 2176373005: [Housekeeping] Move file IO to slow pool. Base URL: https://chromium.googlesource.com/chromium/src.git@urlread
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/url_request/url_request_simple_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | net/url_request/url_request_simple_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698