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 12 matching lines...) Expand all Loading... |
23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/url_constants.h" | 25 #include "chrome/common/url_constants.h" |
26 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
27 #include "googleurl/src/url_util.h" | 27 #include "googleurl/src/url_util.h" |
28 #include "grit/platform_locale_settings.h" | 28 #include "grit/platform_locale_settings.h" |
29 #include "net/base/io_buffer.h" | 29 #include "net/base/io_buffer.h" |
30 #include "net/base/net_errors.h" | 30 #include "net/base/net_errors.h" |
31 #include "net/http/http_response_headers.h" | 31 #include "net/http/http_response_headers.h" |
32 #include "net/url_request/url_request.h" | 32 #include "net/url_request/url_request.h" |
| 33 #include "net/url_request/url_request_context.h" |
33 #include "net/url_request/url_request_file_job.h" | 34 #include "net/url_request/url_request_file_job.h" |
34 #include "net/url_request/url_request_job.h" | 35 #include "net/url_request/url_request_job.h" |
35 #include "net/url_request/url_request_job_factory.h" | 36 #include "net/url_request/url_request_job_factory.h" |
36 | 37 |
37 using content::BrowserThread; | 38 using content::BrowserThread; |
38 | 39 |
39 namespace { | 40 namespace { |
40 | 41 |
41 // X-WebKit-CSP is our development name for Content-Security-Policy. | 42 // X-WebKit-CSP is our development name for Content-Security-Policy. |
42 // TODO(tsepez) rename when Content-security-policy is done. | 43 // TODO(tsepez) rename when Content-security-policy is done. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // The backend is owned by ChromeURLRequestContext and always outlives us. | 212 // The backend is owned by ChromeURLRequestContext and always outlives us. |
212 ChromeURLDataManagerBackend* backend_; | 213 ChromeURLDataManagerBackend* backend_; |
213 | 214 |
214 base::WeakPtrFactory<URLRequestChromeJob> weak_factory_; | 215 base::WeakPtrFactory<URLRequestChromeJob> weak_factory_; |
215 | 216 |
216 DISALLOW_COPY_AND_ASSIGN(URLRequestChromeJob); | 217 DISALLOW_COPY_AND_ASSIGN(URLRequestChromeJob); |
217 }; | 218 }; |
218 | 219 |
219 URLRequestChromeJob::URLRequestChromeJob(net::URLRequest* request, | 220 URLRequestChromeJob::URLRequestChromeJob(net::URLRequest* request, |
220 ChromeURLDataManagerBackend* backend) | 221 ChromeURLDataManagerBackend* backend) |
221 : net::URLRequestJob(request), | 222 : net::URLRequestJob(request, request->context()->network_delegate()), |
222 data_offset_(0), | 223 data_offset_(0), |
223 pending_buf_size_(0), | 224 pending_buf_size_(0), |
224 allow_caching_(true), | 225 allow_caching_(true), |
225 backend_(backend), | 226 backend_(backend), |
226 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 227 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
227 DCHECK(backend); | 228 DCHECK(backend); |
228 } | 229 } |
229 | 230 |
230 URLRequestChromeJob::~URLRequestChromeJob() { | 231 URLRequestChromeJob::~URLRequestChromeJob() { |
231 CHECK(!backend_->HasPendingJob(this)); | 232 CHECK(!backend_->HasPendingJob(this)); |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 564 |
564 return new URLRequestChromeJob(request, backend_); | 565 return new URLRequestChromeJob(request, backend_); |
565 } | 566 } |
566 | 567 |
567 } // namespace | 568 } // namespace |
568 | 569 |
569 net::URLRequestJobFactory::ProtocolHandler* | 570 net::URLRequestJobFactory::ProtocolHandler* |
570 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend) { | 571 CreateDevToolsProtocolHandler(ChromeURLDataManagerBackend* backend) { |
571 return new DevToolsJobFactory(backend); | 572 return new DevToolsJobFactory(backend); |
572 } | 573 } |
OLD | NEW |