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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
6 | 6 |
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
8 | 8 |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2552 std::make_pair( | 2552 std::make_pair( |
2553 id, | 2553 id, |
2554 new base::ObserverList<ResourceMessageDelegate>)) | 2554 new base::ObserverList<ResourceMessageDelegate>)) |
2555 .first; | 2555 .first; |
2556 } | 2556 } |
2557 it->second->AddObserver(delegate); | 2557 it->second->AddObserver(delegate); |
2558 } | 2558 } |
2559 | 2559 |
2560 void ResourceDispatcherHostImpl::UnregisterResourceMessageDelegate( | 2560 void ResourceDispatcherHostImpl::UnregisterResourceMessageDelegate( |
2561 const GlobalRequestID& id, ResourceMessageDelegate* delegate) { | 2561 const GlobalRequestID& id, ResourceMessageDelegate* delegate) { |
2562 DCHECK(ContainsKey(delegate_map_, id)); | 2562 DCHECK(base::ContainsKey(delegate_map_, id)); |
2563 DelegateMap::iterator it = delegate_map_.find(id); | 2563 DelegateMap::iterator it = delegate_map_.find(id); |
2564 DCHECK(it->second->HasObserver(delegate)); | 2564 DCHECK(it->second->HasObserver(delegate)); |
2565 it->second->RemoveObserver(delegate); | 2565 it->second->RemoveObserver(delegate); |
2566 if (!it->second->might_have_observers()) { | 2566 if (!it->second->might_have_observers()) { |
2567 delete it->second; | 2567 delete it->second; |
2568 delegate_map_.erase(it); | 2568 delegate_map_.erase(it); |
2569 } | 2569 } |
2570 } | 2570 } |
2571 | 2571 |
2572 int ResourceDispatcherHostImpl::BuildLoadFlagsForRequest( | 2572 int ResourceDispatcherHostImpl::BuildLoadFlagsForRequest( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2668 << iter->filesystem_url().spec(); | 2668 << iter->filesystem_url().spec(); |
2669 return false; | 2669 return false; |
2670 } | 2670 } |
2671 } | 2671 } |
2672 } | 2672 } |
2673 } | 2673 } |
2674 return true; | 2674 return true; |
2675 } | 2675 } |
2676 | 2676 |
2677 } // namespace content | 2677 } // namespace content |
OLD | NEW |