OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef BASE_TASK_H_ | 5 #ifndef BASE_TASK_H_ |
6 #define BASE_TASK_H_ | 6 #define BASE_TASK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 COMPILE_ASSERT( | 455 COMPILE_ASSERT( |
456 (base::internal::ParamsUseScopedRefptrCorrectly<Params>::value), | 456 (base::internal::ParamsUseScopedRefptrCorrectly<Params>::value), |
457 badrunnablefunctionparams); | 457 badrunnablefunctionparams); |
458 } | 458 } |
459 | 459 |
460 ~RunnableFunction() { | 460 ~RunnableFunction() { |
461 function_ = reinterpret_cast<Function>(base::kDeadTask); | 461 function_ = reinterpret_cast<Function>(base::kDeadTask); |
462 } | 462 } |
463 | 463 |
464 virtual void Run() { | 464 virtual void Run() { |
465 // TODO(apatrick): Remove this ASAP. This ensures that the function pointer | |
466 // is available in minidumps for the purpose of diagnosing | |
467 // http://crbug.com/81449. | |
468 Function function = function_; | |
469 base::debug::Alias(&function); | |
470 Params params = params_; | |
471 base::debug::Alias(¶ms); | |
472 | |
473 if (function_) | 465 if (function_) |
474 DispatchToFunction(function_, params_); | 466 DispatchToFunction(function_, params_); |
475 } | 467 } |
476 | 468 |
477 private: | 469 private: |
478 Function function_; | 470 Function function_; |
479 Params params_; | 471 Params params_; |
480 }; | 472 }; |
481 | 473 |
482 template <class Function> | 474 template <class Function> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 Task* task_; | 590 Task* task_; |
599 bool* should_leak_task_; | 591 bool* should_leak_task_; |
600 static bool kTaskLeakingDefault; | 592 static bool kTaskLeakingDefault; |
601 }; | 593 }; |
602 | 594 |
603 } // namespace subtle | 595 } // namespace subtle |
604 | 596 |
605 } // namespace base | 597 } // namespace base |
606 | 598 |
607 #endif // BASE_TASK_H_ | 599 #endif // BASE_TASK_H_ |
OLD | NEW |