| OLD | NEW |
| 1 diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h | 1 diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h |
| 2 index 576695a..24c400e 100644 | 2 index 576695a..24c400e 100644 |
| 3 --- a/base/threading/platform_thread.h | 3 --- a/base/threading/platform_thread.h |
| 4 +++ b/base/threading/platform_thread.h | 4 +++ b/base/threading/platform_thread.h |
| 5 @@ -76,6 +76,15 @@ class BASE_EXPORT PlatformThread { | 5 @@ -76,6 +76,15 @@ class BASE_EXPORT PlatformThread { |
| 6 // Gets the thread name, if previously set by SetName. | 6 // Gets the thread name, if previously set by SetName. |
| 7 static const char* GetName(); | 7 static const char* GetName(); |
| 8 | 8 |
| 9 + // Sets the thread stack start address for this thread. This is used | 9 + // Sets the thread stack start address for this thread. This is used |
| 10 + // to pass the thread stack start to webkit for conservative stack | 10 + // to pass the thread stack start to webkit for conservative stack |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 + ThreadManager() : processing_(false) { } | 668 + ThreadManager() : processing_(false) { } |
| 669 + ~ThreadManager() { CHECK(processing_ == false); } | 669 + ~ThreadManager() { CHECK(processing_ == false); } |
| 670 + #endif | 670 + #endif |
| 671 + | 671 + |
| 672 + // This method is called before processing a task. | 672 + // This method is called before processing a task. |
| 673 + virtual void WillProcessTask(const base::PendingTask& pending_task) { | 673 + virtual void WillProcessTask(const base::PendingTask& pending_task) { |
| 674 + #ifndef NDEBUG | 674 + #ifndef NDEBUG |
| 675 + CHECK(processing_ == false); | 675 + CHECK(processing_ == false); |
| 676 + processing_ = true; | 676 + processing_ = true; |
| 677 + #endif | 677 + #endif |
| 678 + WebKit::Platform::markCurrentThreadResumed(); | 678 + WebKit::Platform::leaveSafePoint(); |
| 679 + } | 679 + } |
| 680 + | 680 + |
| 681 + // This method is called after processing a task. | 681 + // This method is called after processing a task. |
| 682 + virtual void DidProcessTask(const base::PendingTask& pending_task) { | 682 + virtual void DidProcessTask(const base::PendingTask& pending_task) { |
| 683 + #ifndef NDEBUG | 683 + #ifndef NDEBUG |
| 684 + processing_ = false; | 684 + processing_ = false; |
| 685 + #endif | 685 + #endif |
| 686 + WebKit::Platform::markCurrentThreadPaused(); | 686 + WebKit::Platform::enterSafePoint(); |
| 687 + } | 687 + } |
| 688 + | 688 + |
| 689 + private: | 689 + private: |
| 690 + #ifndef NDEBUG | 690 + #ifndef NDEBUG |
| 691 + bool processing_; | 691 + bool processing_; |
| 692 + #endif | 692 + #endif |
| 693 + }; | 693 + }; |
| 694 + | 694 + |
| 695 + virtual void CleanUp() OVERRIDE { | 695 + virtual void CleanUp() OVERRIDE { |
| 696 + WebKit::Platform::detachThread(); | 696 + WebKit::Platform::detachThread(); |
| 697 + } | 697 + } |
| 698 + | 698 + |
| 699 + virtual void Run(MessageLoop* message_loop) OVERRIDE { | 699 + virtual void Run(MessageLoop* message_loop) OVERRIDE { |
| 700 + intptr_t stackMark; | 700 + intptr_t stackMark; |
| 701 + WebKit::Platform::attachThread(&stackMark); | 701 + WebKit::Platform::attachThread(&stackMark); |
| 702 + WebKit::Platform::markCurrentThreadPaused(); | 702 + WebKit::Platform::enterSafePoint(); |
| 703 + message_loop->AddTaskObserver(new ThreadManager); | 703 + message_loop->AddTaskObserver(new ThreadManager); |
| 704 + base::Thread::Run(message_loop); | 704 + base::Thread::Run(message_loop); |
| 705 + } | 705 + } |
| 706 +}; | 706 +}; |
| 707 + | 707 + |
| 708 + | 708 + |
| 709 +WebThreadImpl::WebThreadImpl(const char* name, bool usesBlink) | 709 +WebThreadImpl::WebThreadImpl(const char* name, bool usesBlink) |
| 710 + : thread_(usesBlink ? new BlinkThread(name) : new base::Thread(n
ame)) { | 710 + : thread_(usesBlink ? new BlinkThread(name) : new base::Thread(n
ame)) { |
| 711 thread_->Start(); | 711 thread_->Start(); |
| 712 } | 712 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 742 | 742 |
| 743 - WebKit::initialize(this); | 743 - WebKit::initialize(this); |
| 744 + WebKit::initialize(this, start_of_stack); | 744 + WebKit::initialize(this, start_of_stack); |
| 745 WebKit::setLayoutTestMode(true); | 745 WebKit::setLayoutTestMode(true); |
| 746 WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( | 746 WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( |
| 747 WebKit::WebString::fromUTF8("test-shell-resource")); | 747 WebKit::WebString::fromUTF8("test-shell-resource")); |
| 748 @@ -517,13 +518,13 @@ void TestWebKitPlatformSupport::unregisterAllMockedURLs()
{ | 748 @@ -517,13 +518,13 @@ void TestWebKitPlatformSupport::unregisterAllMockedURLs()
{ |
| 749 | 749 |
| 750 void TestWebKitPlatformSupport::serveAsynchronousMockedRequests() { | 750 void TestWebKitPlatformSupport::serveAsynchronousMockedRequests() { |
| 751 url_loader_factory_.ServeAsynchronousRequests(); | 751 url_loader_factory_.ServeAsynchronousRequests(); |
| 752 + WebKit::Platform::markCurrentThreadResumed(); | 752 + WebKit::Platform::leaveSafePoint(); |
| 753 } | 753 } |
| 754 | 754 |
| 755 WebKit::WebString TestWebKitPlatformSupport::webKitRootDir() { | 755 WebKit::WebString TestWebKitPlatformSupport::webKitRootDir() { |
| 756 return webkit_support::GetWebKitRootDir(); | 756 return webkit_support::GetWebKitRootDir(); |
| 757 } | 757 } |
| 758 | 758 |
| 759 - | 759 - |
| 760 WebKit::WebLayerTreeView* | 760 WebKit::WebLayerTreeView* |
| 761 TestWebKitPlatformSupport::createLayerTreeViewForTesting() { | 761 TestWebKitPlatformSupport::createLayerTreeViewForTesting() { |
| 762 scoped_ptr<WebLayerTreeViewImplForTesting> view( | 762 scoped_ptr<WebLayerTreeViewImplForTesting> view( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 | 809 |
| 810 +namespace { | 810 +namespace { |
| 811 + | 811 + |
| 812 +class WebKitTestListener : public testing::EmptyTestEventListener { | 812 +class WebKitTestListener : public testing::EmptyTestEventListener { |
| 813 + public: | 813 + public: |
| 814 + virtual void OnTestStart(const testing::TestInfo& test_info); | 814 + virtual void OnTestStart(const testing::TestInfo& test_info); |
| 815 + virtual void OnTestEnd(const testing::TestInfo& test_info); | 815 + virtual void OnTestEnd(const testing::TestInfo& test_info); |
| 816 +}; | 816 +}; |
| 817 + | 817 + |
| 818 +void WebKitTestListener::OnTestStart(const testing::TestInfo& test_info) { | 818 +void WebKitTestListener::OnTestStart(const testing::TestInfo& test_info) { |
| 819 + WebKit::Platform::markCurrentThreadResumed(); | 819 + WebKit::Platform::leaveSafePoint(); |
| 820 +} | 820 +} |
| 821 + | 821 + |
| 822 +void WebKitTestListener::OnTestEnd(const testing::TestInfo& test_info) { | 822 +void WebKitTestListener::OnTestEnd(const testing::TestInfo& test_info) { |
| 823 + WebKit::Platform::markCurrentThreadPaused(); | 823 + WebKit::Platform::enterSafePoint(); |
| 824 +} | 824 +} |
| 825 + | 825 + |
| 826 +} // namespace | 826 +} // namespace |
| 827 + | 827 + |
| 828 + | 828 + |
| 829 void SetUpTestEnvironmentImpl(bool unit_test_mode, | 829 void SetUpTestEnvironmentImpl(bool unit_test_mode, |
| 830 - WebKit::Platform* shadow_platform_delegate) { | 830 - WebKit::Platform* shadow_platform_delegate) { |
| 831 + WebKit::Platform* shadow_platform_delegate, | 831 + WebKit::Platform* shadow_platform_delegate, |
| 832 + intptr_t* start_of_stack) { | 832 + intptr_t* start_of_stack) { |
| 833 base::debug::EnableInProcessStackDumping(); | 833 base::debug::EnableInProcessStackDumping(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 +++ b/webkit/tools/test_shell/test_shell_webkit_init.h | 939 +++ b/webkit/tools/test_shell/test_shell_webkit_init.h |
| 940 @@ -30,7 +30,7 @@ | 940 @@ -30,7 +30,7 @@ |
| 941 | 941 |
| 942 class TestShellWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { | 942 class TestShellWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { |
| 943 public: | 943 public: |
| 944 - explicit TestShellWebKitInit(bool layout_test_mode); | 944 - explicit TestShellWebKitInit(bool layout_test_mode); |
| 945 + TestShellWebKitInit(bool layout_test_mode, intptr_t* stack_start); | 945 + TestShellWebKitInit(bool layout_test_mode, intptr_t* stack_start); |
| 946 virtual ~TestShellWebKitInit(); | 946 virtual ~TestShellWebKitInit(); |
| 947 | 947 |
| 948 virtual WebKit::WebMimeRegistry* mimeRegistry() OVERRIDE; | 948 virtual WebKit::WebMimeRegistry* mimeRegistry() OVERRIDE; |
| OLD | NEW |