| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "extensions/browser/load_monitoring_extension_host_queue.h" | 5 #include "extensions/browser/load_monitoring_extension_host_queue.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 std::unique_ptr<ExtensionHostQueue>(new SerialExtensionHostQueue()), | 63 std::unique_ptr<ExtensionHostQueue>(new SerialExtensionHostQueue()), |
| 64 base::TimeDelta(), // no delay, easier to test | 64 base::TimeDelta(), // no delay, easier to test |
| 65 base::Bind(&LoadMonitoringExtensionHostQueueTest::Finished, | 65 base::Bind(&LoadMonitoringExtensionHostQueueTest::Finished, |
| 66 base::Unretained(this)))); | 66 base::Unretained(this)))); |
| 67 } | 67 } |
| 68 | 68 |
| 69 protected: | 69 protected: |
| 70 // Creates a new DeferredStartRenderHost. Ownership is held by this class, | 70 // Creates a new DeferredStartRenderHost. Ownership is held by this class, |
| 71 // not passed to caller. | 71 // not passed to caller. |
| 72 StubDeferredStartRenderHost* CreateHost() { | 72 StubDeferredStartRenderHost* CreateHost() { |
| 73 stubs_.push_back(base::WrapUnique(new StubDeferredStartRenderHost())); | 73 stubs_.push_back(base::MakeUnique<StubDeferredStartRenderHost>()); |
| 74 return stubs_.back().get(); | 74 return stubs_.back().get(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 // Our single LoadMonitoringExtensionHostQueue instance. | 77 // Our single LoadMonitoringExtensionHostQueue instance. |
| 78 LoadMonitoringExtensionHostQueue* queue() { return queue_.get(); } | 78 LoadMonitoringExtensionHostQueue* queue() { return queue_.get(); } |
| 79 | 79 |
| 80 // Returns true if the queue has finished monitoring. | 80 // Returns true if the queue has finished monitoring. |
| 81 bool finished() const { return finished_; } | 81 bool finished() const { return finished_; } |
| 82 | 82 |
| 83 // These are available after the queue has finished (in which case finished() | 83 // These are available after the queue has finished (in which case finished() |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 queue()->Remove(host3); | 348 queue()->Remove(host3); |
| 349 queue()->Remove(host4); | 349 queue()->Remove(host4); |
| 350 | 350 |
| 351 EXPECT_FALSE(host1->IsObservedBy(queue())); | 351 EXPECT_FALSE(host1->IsObservedBy(queue())); |
| 352 EXPECT_FALSE(host2->IsObservedBy(queue())); | 352 EXPECT_FALSE(host2->IsObservedBy(queue())); |
| 353 EXPECT_FALSE(host3->IsObservedBy(queue())); | 353 EXPECT_FALSE(host3->IsObservedBy(queue())); |
| 354 EXPECT_FALSE(host4->IsObservedBy(queue())); | 354 EXPECT_FALSE(host4->IsObservedBy(queue())); |
| 355 } | 355 } |
| 356 | 356 |
| 357 } // namespace extensions | 357 } // namespace extensions |
| OLD | NEW |