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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/debug/alias.h" | 13 #include "base/debug/alias.h" |
14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "base/memory/ref_counted_memory.h" | 19 #include "base/memory/ref_counted_memory.h" |
20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
21 #include "base/profiler/scoped_tracker.h" | 21 #include "base/profiler/scoped_tracker.h" |
22 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
23 #include "base/strings/string_number_conversions.h" | 23 #include "base/strings/string_number_conversions.h" |
24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
25 #include "base/strings/stringprintf.h" | 25 #include "base/strings/stringprintf.h" |
| 26 #include "base/threading/thread_task_runner_handle.h" |
26 #include "base/threading/worker_pool.h" | 27 #include "base/threading/worker_pool.h" |
27 #include "base/trace_event/trace_event.h" | 28 #include "base/trace_event/trace_event.h" |
28 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 29 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
29 #include "content/browser/histogram_internals_request_job.h" | 30 #include "content/browser/histogram_internals_request_job.h" |
30 #include "content/browser/net/view_blob_internals_job_factory.h" | 31 #include "content/browser/net/view_blob_internals_job_factory.h" |
31 #include "content/browser/net/view_http_cache_job_factory.h" | 32 #include "content/browser/net/view_http_cache_job_factory.h" |
32 #include "content/browser/resource_context_impl.h" | 33 #include "content/browser/resource_context_impl.h" |
33 #include "content/browser/webui/shared_resources_data_source.h" | 34 #include "content/browser/webui/shared_resources_data_source.h" |
34 #include "content/browser/webui/url_data_source_impl.h" | 35 #include "content/browser/webui/url_data_source_impl.h" |
35 #include "content/public/browser/browser_context.h" | 36 #include "content/public/browser/browser_context.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 BrowserThread::PostTask( | 320 BrowserThread::PostTask( |
320 BrowserThread::UI, | 321 BrowserThread::UI, |
321 FROM_HERE, | 322 FROM_HERE, |
322 base::Bind(&URLRequestChromeJob::DelayStartForDevTools, | 323 base::Bind(&URLRequestChromeJob::DelayStartForDevTools, |
323 weak_factory_.GetWeakPtr())); | 324 weak_factory_.GetWeakPtr())); |
324 return; | 325 return; |
325 } | 326 } |
326 | 327 |
327 // Start reading asynchronously so that all error reporting and data | 328 // Start reading asynchronously so that all error reporting and data |
328 // callbacks happen as they would for network requests. | 329 // callbacks happen as they would for network requests. |
329 base::MessageLoop::current()->task_runner()->PostTask( | 330 base::ThreadTaskRunnerHandle::Get()->PostTask( |
330 FROM_HERE, | 331 FROM_HERE, |
331 base::Bind(&URLRequestChromeJob::StartAsync, weak_factory_.GetWeakPtr())); | 332 base::Bind(&URLRequestChromeJob::StartAsync, weak_factory_.GetWeakPtr())); |
332 | 333 |
333 TRACE_EVENT_ASYNC_BEGIN1("browser", "DataManager:Request", this, "URL", | 334 TRACE_EVENT_ASYNC_BEGIN1("browser", "DataManager:Request", this, "URL", |
334 url.possibly_invalid_spec()); | 335 url.possibly_invalid_spec()); |
335 } | 336 } |
336 | 337 |
337 void URLRequestChromeJob::Kill() { | 338 void URLRequestChromeJob::Kill() { |
338 weak_factory_.InvalidateWeakPtrs(); | 339 weak_factory_.InvalidateWeakPtrs(); |
339 backend_->RemoveRequest(this); | 340 backend_->RemoveRequest(this); |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 | 838 |
838 } // namespace | 839 } // namespace |
839 | 840 |
840 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( | 841 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( |
841 ResourceContext* resource_context, | 842 ResourceContext* resource_context, |
842 bool is_incognito) { | 843 bool is_incognito) { |
843 return new DevToolsJobFactory(resource_context, is_incognito); | 844 return new DevToolsJobFactory(resource_context, is_incognito); |
844 } | 845 } |
845 | 846 |
846 } // namespace content | 847 } // namespace content |
OLD | NEW |