| 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 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 487 |
| 488 // Look up the data source for the request. | 488 // Look up the data source for the request. |
| 489 DataSourceMap::iterator i = data_sources_.find(source_name); | 489 DataSourceMap::iterator i = data_sources_.find(source_name); |
| 490 if (i == data_sources_.end()) | 490 if (i == data_sources_.end()) |
| 491 return false; | 491 return false; |
| 492 | 492 |
| 493 URLDataSourceImpl* source = i->second; | 493 URLDataSourceImpl* source = i->second; |
| 494 | 494 |
| 495 if (!source->source()->ShouldServiceRequest(request)) | 495 if (!source->source()->ShouldServiceRequest(request)) |
| 496 return false; | 496 return false; |
| 497 source->source()->WillServiceRequest(request, &path); |
| 497 | 498 |
| 498 // Save this request so we know where to send the data. | 499 // Save this request so we know where to send the data. |
| 499 RequestID request_id = next_request_id_++; | 500 RequestID request_id = next_request_id_++; |
| 500 pending_requests_.insert(std::make_pair(request_id, job)); | 501 pending_requests_.insert(std::make_pair(request_id, job)); |
| 501 | 502 |
| 502 job->set_allow_caching(source->source()->AllowCaching()); | 503 job->set_allow_caching(source->source()->AllowCaching()); |
| 503 job->set_add_content_security_policy( | 504 job->set_add_content_security_policy( |
| 504 source->source()->ShouldAddContentSecurityPolicy()); | 505 source->source()->ShouldAddContentSecurityPolicy()); |
| 505 job->set_content_security_policy_object_source( | 506 job->set_content_security_policy_object_source( |
| 506 source->source()->GetContentSecurityPolicyObjectSrc()); | 507 source->source()->GetContentSecurityPolicyObjectSrc()); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 | 643 |
| 643 } // namespace | 644 } // namespace |
| 644 | 645 |
| 645 net::URLRequestJobFactory::ProtocolHandler* | 646 net::URLRequestJobFactory::ProtocolHandler* |
| 646 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 647 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
| 647 bool is_incognito) { | 648 bool is_incognito) { |
| 648 return new DevToolsJobFactory(resource_context, is_incognito); | 649 return new DevToolsJobFactory(resource_context, is_incognito); |
| 649 } | 650 } |
| 650 | 651 |
| 651 } // namespace content | 652 } // namespace content |
| OLD | NEW |