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 "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 5 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
27 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
28 #include "googleurl/src/url_util.h" | 28 #include "googleurl/src/url_util.h" |
29 #include "grit/platform_locale_settings.h" | 29 #include "grit/platform_locale_settings.h" |
30 #include "net/base/io_buffer.h" | 30 #include "net/base/io_buffer.h" |
31 #include "net/base/net_errors.h" | 31 #include "net/base/net_errors.h" |
32 #include "net/http/http_response_headers.h" | 32 #include "net/http/http_response_headers.h" |
33 #include "net/url_request/url_request.h" | 33 #include "net/url_request/url_request.h" |
| 34 #include "net/url_request/url_request_context.h" |
34 #include "net/url_request/url_request_file_job.h" | 35 #include "net/url_request/url_request_file_job.h" |
35 #include "net/url_request/url_request_job.h" | 36 #include "net/url_request/url_request_job.h" |
36 #include "net/url_request/url_request_job_factory.h" | 37 #include "net/url_request/url_request_job_factory.h" |
37 | 38 |
38 using content::BrowserThread; | 39 using content::BrowserThread; |
39 | 40 |
40 namespace { | 41 namespace { |
41 | 42 |
42 // X-WebKit-CSP is our development name for Content-Security-Policy. | 43 // X-WebKit-CSP is our development name for Content-Security-Policy. |
43 // TODO(tsepez) rename when Content-security-policy is done. | 44 // TODO(tsepez) rename when Content-security-policy is done. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // The backend is owned by ChromeURLRequestContext and always outlives us. | 217 // The backend is owned by ChromeURLRequestContext and always outlives us. |
217 ChromeURLDataManagerBackend* backend_; | 218 ChromeURLDataManagerBackend* backend_; |
218 | 219 |
219 base::WeakPtrFactory<URLRequestChromeJob> weak_factory_; | 220 base::WeakPtrFactory<URLRequestChromeJob> weak_factory_; |
220 | 221 |
221 DISALLOW_COPY_AND_ASSIGN(URLRequestChromeJob); | 222 DISALLOW_COPY_AND_ASSIGN(URLRequestChromeJob); |
222 }; | 223 }; |
223 | 224 |
224 URLRequestChromeJob::URLRequestChromeJob(net::URLRequest* request, | 225 URLRequestChromeJob::URLRequestChromeJob(net::URLRequest* request, |
225 ChromeURLDataManagerBackend* backend) | 226 ChromeURLDataManagerBackend* backend) |
226 : net::URLRequestJob(request), | 227 : net::URLRequestJob(request, request->context()->network_delegate()), |
227 data_offset_(0), | 228 data_offset_(0), |
228 pending_buf_size_(0), | 229 pending_buf_size_(0), |
229 allow_caching_(true), | 230 allow_caching_(true), |
230 backend_(backend), | 231 backend_(backend), |
231 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 232 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
232 DCHECK(backend); | 233 DCHECK(backend); |
233 } | 234 } |
234 | 235 |
235 URLRequestChromeJob::~URLRequestChromeJob() { | 236 URLRequestChromeJob::~URLRequestChromeJob() { |
236 CHECK(!backend_->HasPendingJob(this)); | 237 CHECK(!backend_->HasPendingJob(this)); |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 | 598 |
598 return new URLRequestChromeJob(request, backend_); | 599 return new URLRequestChromeJob(request, backend_); |
599 } | 600 } |
600 | 601 |
601 } // namespace | 602 } // namespace |
602 | 603 |
603 net::URLRequestJobFactory::ProtocolHandler* | 604 net::URLRequestJobFactory::ProtocolHandler* |
604 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend) { | 605 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend) { |
605 return new DevToolsJobFactory(backend); | 606 return new DevToolsJobFactory(backend); |
606 } | 607 } |
OLD | NEW |