| 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 "base/memory/weak_ptr.h" | 5 #include "base/memory/weak_ptr.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 template <class T> | 20 template <class T> |
| 21 class OffThreadObjectCreator { | 21 class OffThreadObjectCreator { |
| 22 public: | 22 public: |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 background.Start(); | 582 background.Start(); |
| 583 background.DeleteTarget(target.release()); | 583 background.DeleteTarget(target.release()); |
| 584 | 584 |
| 585 // Main thread attempts to dereference the target, violating thread binding. | 585 // Main thread attempts to dereference the target, violating thread binding. |
| 586 ASSERT_DEATH(arrow.target.get(), ""); | 586 ASSERT_DEATH(arrow.target.get(), ""); |
| 587 } | 587 } |
| 588 | 588 |
| 589 #endif | 589 #endif |
| 590 | 590 |
| 591 } // namespace base | 591 } // namespace base |
| OLD | NEW |