| 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" |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 for (PendingRequestMap::const_iterator i = pending_requests_.begin(); | 503 for (PendingRequestMap::const_iterator i = pending_requests_.begin(); |
| 504 i != pending_requests_.end(); ++i) { | 504 i != pending_requests_.end(); ++i) { |
| 505 if (i->second == job) | 505 if (i->second == job) |
| 506 return true; | 506 return true; |
| 507 } | 507 } |
| 508 return false; | 508 return false; |
| 509 } | 509 } |
| 510 | 510 |
| 511 bool URLDataManagerBackend::StartRequest(const net::URLRequest* request, | 511 bool URLDataManagerBackend::StartRequest(const net::URLRequest* request, |
| 512 URLRequestChromeJob* job) { | 512 URLRequestChromeJob* job) { |
| 513 // NOTE: this duplicates code in web_ui_url_loader_factory.cc's URLLoaderImpl. | 513 // NOTE: this duplicates code in web_ui_url_loader_factory.cc's |
| 514 // StartURLLoader. |
| 514 if (!CheckURLIsValid(request->url())) | 515 if (!CheckURLIsValid(request->url())) |
| 515 return false; | 516 return false; |
| 516 | 517 |
| 517 URLDataSourceImpl* source = GetDataSourceFromURL(request->url()); | 518 URLDataSourceImpl* source = GetDataSourceFromURL(request->url()); |
| 518 if (!source) | 519 if (!source) |
| 519 return false; | 520 return false; |
| 520 | 521 |
| 521 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 522 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
| 522 if (!source->source()->ShouldServiceRequest( | 523 if (!source->source()->ShouldServiceRequest( |
| 523 request->url(), info ? info->GetContext() : nullptr, | 524 request->url(), info ? info->GetContext() : nullptr, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 } | 737 } |
| 737 | 738 |
| 738 } // namespace | 739 } // namespace |
| 739 | 740 |
| 740 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( | 741 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( |
| 741 ResourceContext* resource_context) { | 742 ResourceContext* resource_context) { |
| 742 return new DevToolsJobFactory(resource_context); | 743 return new DevToolsJobFactory(resource_context); |
| 743 } | 744 } |
| 744 | 745 |
| 745 } // namespace content | 746 } // namespace content |
| OLD | NEW |