Lines Matching refs:arrow
50 struct Arrow {
66 void CreateArrowFromTarget(Arrow** arrow, Target* target) {
69 FROM_HERE, base::Bind(&BackgroundThread::DoCreateArrowFromTarget, arrow,
74 void CreateArrowFromArrow(Arrow** arrow, const Arrow* other) {
77 FROM_HERE, base::Bind(&BackgroundThread::DoCreateArrowFromArrow, arrow,
90 void CopyAndAssignArrow(Arrow* object) {
98 void CopyAndAssignArrowBase(Arrow* object) {
106 void DeleteArrow(Arrow* object) {
114 Target* DeRef(const Arrow* arrow) {
118 arrow, &result, &completion));
124 static void DoCreateArrowFromArrow(Arrow** arrow,
125 const Arrow* other,
127 *arrow = new Arrow;
128 **arrow = *other;
132 static void DoCreateArrowFromTarget(Arrow** arrow,
135 *arrow = new Arrow;
136 (*arrow)->target = target->AsWeakPtr();
140 static void DoDeRef(const Arrow* arrow,
143 *result = arrow->target.get();
152 static void DoCopyAndAssignArrow(Arrow* object, WaitableEvent* completion) {
154 Arrow a = *object;
161 Arrow* object,
171 static void DoDeleteArrow(Arrow* object, WaitableEvent* completion) {
307 scoped_ptr<Arrow> arrow(OffThreadObjectCreator<Arrow>::NewObject());
309 arrow->target = target.AsWeakPtr();
310 EXPECT_EQ(&target, arrow->target.get());
326 Arrow* arrow;
329 background.CreateArrowFromTarget(&arrow, target);
330 EXPECT_EQ(background.DeRef(arrow), target);
335 Arrow arrow;
336 arrow.target = target->AsWeakPtr();
339 EXPECT_EQ(target, background.DeRef(&arrow));
344 background.DeleteArrow(arrow);
351 Arrow* arrow;
355 background.CreateArrowFromTarget(&arrow, &target);
358 EXPECT_EQ(&target, background.DeRef(arrow));
361 arrow->target.reset();
364 arrow->target = target.AsWeakPtr();
367 EXPECT_EQ(&target, arrow->target.get());
372 delete arrow;
379 Arrow arrow;
383 arrow.target = target->factory.GetWeakPtr();
384 EXPECT_EQ(target.get(), arrow.target.get());
387 EXPECT_EQ(NULL, arrow.target.get());
389 arrow.target = target->factory.GetWeakPtr();
391 EXPECT_EQ(target.get(), background.DeRef(&arrow));
407 Arrow arrow;
408 arrow.target = target.AsWeakPtr();
410 Arrow* arrow_copy;
411 background.CreateArrowFromArrow(&arrow_copy, &arrow);
425 Arrow* arrow_copy;
427 Arrow arrow;
428 arrow.target = target.AsWeakPtr();
429 background.CreateArrowFromArrow(&arrow_copy, &arrow);
443 Arrow* arrow_copy;
446 Arrow arrow;
447 arrow.target = target.AsWeakPtr();
448 background.CreateArrowFromArrow(&arrow_copy, &arrow);
457 // Main thread creates an arrow referencing the Target.
458 Arrow *arrow = new Arrow();
459 arrow->target = target.AsWeakPtr();
461 // Background can copy and assign arrow (as well as the WeakPtr inside).
464 background.CopyAndAssignArrow(arrow);
465 background.DeleteArrow(arrow);
471 // Main thread creates an arrow referencing the Target.
472 Arrow *arrow = new Arrow();
473 arrow->target = target.AsWeakPtr();
475 // Background can copy and assign arrow's WeakPtr to a base class WeakPtr.
478 background.CopyAndAssignArrowBase(arrow);
479 background.DeleteArrow(arrow);
485 // Main thread creates an arrow referencing the Target.
486 Arrow* arrow = new Arrow();
487 arrow->target = target.AsWeakPtr();
489 // Background can delete arrow (as well as the WeakPtr inside).
492 background.DeleteArrow(arrow);
507 // Main thread creates an arrow referencing the Target.
508 Arrow arrow;
509 arrow.target = target.AsWeakPtr();
512 Arrow* arrow_copy;
513 background.CreateArrowFromArrow(&arrow_copy, &arrow);
516 EXPECT_EQ(arrow.target.get(), arrow_copy->target.get());
533 // Main thread creates an arrow referencing the Target (so target's
535 Arrow arrow;
536 arrow.target = target.AsWeakPtr();
537 arrow.target.get();
542 ASSERT_DEATH(background.DeRef(&arrow), "");
552 // Main thread creates an arrow referencing the Target.
553 Arrow arrow;
554 arrow.target = target->AsWeakPtr();
559 background.DeRef(&arrow);
576 // Main thread creates an arrow referencing the Target, and references it, so
578 Arrow arrow;
579 arrow.target = target->AsWeakPtr();
580 arrow.target.get();
595 // Main thread creates an arrow referencing the Target.
596 Arrow arrow;
597 arrow.target = target->AsWeakPtr();
605 ASSERT_DEATH(arrow.target.get(), "");