| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/web/webui/url_data_manager_ios_backend.h" | 5 #include "ios/web/webui/url_data_manager_ios_backend.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 i != data_sources_.end(); ++i) { | 394 i != data_sources_.end(); ++i) { |
| 395 i->second->backend_ = NULL; | 395 i->second->backend_ = NULL; |
| 396 } | 396 } |
| 397 data_sources_.clear(); | 397 data_sources_.clear(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 // static | 400 // static |
| 401 std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler> | 401 std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 402 URLDataManagerIOSBackend::CreateProtocolHandler(BrowserState* browser_state) { | 402 URLDataManagerIOSBackend::CreateProtocolHandler(BrowserState* browser_state) { |
| 403 DCHECK(browser_state); | 403 DCHECK(browser_state); |
| 404 return base::WrapUnique(new ChromeProtocolHandler( | 404 return base::MakeUnique<ChromeProtocolHandler>( |
| 405 browser_state, browser_state->IsOffTheRecord())); | 405 browser_state, browser_state->IsOffTheRecord()); |
| 406 } | 406 } |
| 407 | 407 |
| 408 void URLDataManagerIOSBackend::AddDataSource(URLDataSourceIOSImpl* source) { | 408 void URLDataManagerIOSBackend::AddDataSource(URLDataSourceIOSImpl* source) { |
| 409 DCHECK_CURRENTLY_ON(WebThread::IO); | 409 DCHECK_CURRENTLY_ON(WebThread::IO); |
| 410 DataSourceMap::iterator i = data_sources_.find(source->source_name()); | 410 DataSourceMap::iterator i = data_sources_.find(source->source_name()); |
| 411 if (i != data_sources_.end()) { | 411 if (i != data_sources_.end()) { |
| 412 if (!source->source()->ShouldReplaceExistingSource()) | 412 if (!source->source()->ShouldReplaceExistingSource()) |
| 413 return; | 413 return; |
| 414 i->second->backend_ = NULL; | 414 i->second->backend_ = NULL; |
| 415 } | 415 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 // Forward this data on to the pending net::URLRequest, if it exists. | 516 // Forward this data on to the pending net::URLRequest, if it exists. |
| 517 PendingRequestMap::iterator i = pending_requests_.find(request_id); | 517 PendingRequestMap::iterator i = pending_requests_.find(request_id); |
| 518 if (i != pending_requests_.end()) { | 518 if (i != pending_requests_.end()) { |
| 519 URLRequestChromeJob* job(i->second); | 519 URLRequestChromeJob* job(i->second); |
| 520 pending_requests_.erase(i); | 520 pending_requests_.erase(i); |
| 521 job->DataAvailable(bytes); | 521 job->DataAvailable(bytes); |
| 522 } | 522 } |
| 523 } | 523 } |
| 524 | 524 |
| 525 } // namespace web | 525 } // namespace web |
| OLD | NEW |