| 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 #ifndef CONTENT_PUBLIC_TEST_TEST_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_UTILS_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 public: | 252 public: |
| 253 InProcessUtilityThreadHelper(); | 253 InProcessUtilityThreadHelper(); |
| 254 ~InProcessUtilityThreadHelper() override; | 254 ~InProcessUtilityThreadHelper() override; |
| 255 | 255 |
| 256 private: | 256 private: |
| 257 void BrowserChildProcessHostConnected(const ChildProcessData& data) override; | 257 void BrowserChildProcessHostConnected(const ChildProcessData& data) override; |
| 258 void BrowserChildProcessHostDisconnected( | 258 void BrowserChildProcessHostDisconnected( |
| 259 const ChildProcessData& data) override; | 259 const ChildProcessData& data) override; |
| 260 | 260 |
| 261 int child_thread_count_; | 261 int child_thread_count_; |
| 262 scoped_refptr<MessageLoopRunner> runner_; | 262 std::unique_ptr<base::RunLoop> run_loop_; |
| 263 std::unique_ptr<TestServiceManagerContext> shell_context_; | 263 std::unique_ptr<TestServiceManagerContext> shell_context_; |
| 264 | 264 |
| 265 DISALLOW_COPY_AND_ASSIGN(InProcessUtilityThreadHelper); | 265 DISALLOW_COPY_AND_ASSIGN(InProcessUtilityThreadHelper); |
| 266 }; | 266 }; |
| 267 | 267 |
| 268 // This observer keeps track of the last deleted RenderFrame to avoid | 268 // This observer keeps track of the last deleted RenderFrame to avoid |
| 269 // accessing it and causing use-after-free condition. | 269 // accessing it and causing use-after-free condition. |
| 270 class RenderFrameDeletedObserver : public WebContentsObserver { | 270 class RenderFrameDeletedObserver : public WebContentsObserver { |
| 271 public: | 271 public: |
| 272 RenderFrameDeletedObserver(RenderFrameHost* rfh); | 272 RenderFrameDeletedObserver(RenderFrameHost* rfh); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 293 explicit WebContentsDestroyedWatcher(WebContents* web_contents); | 293 explicit WebContentsDestroyedWatcher(WebContents* web_contents); |
| 294 ~WebContentsDestroyedWatcher() override; | 294 ~WebContentsDestroyedWatcher() override; |
| 295 | 295 |
| 296 // Waits until the WebContents is destroyed. | 296 // Waits until the WebContents is destroyed. |
| 297 void Wait(); | 297 void Wait(); |
| 298 | 298 |
| 299 private: | 299 private: |
| 300 // Overridden WebContentsObserver methods. | 300 // Overridden WebContentsObserver methods. |
| 301 void WebContentsDestroyed() override; | 301 void WebContentsDestroyed() override; |
| 302 | 302 |
| 303 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 303 base::RunLoop run_loop_; |
| 304 | 304 |
| 305 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); | 305 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); |
| 306 }; | 306 }; |
| 307 | 307 |
| 308 } // namespace content | 308 } // namespace content |
| 309 | 309 |
| 310 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_ | 310 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_ |
| OLD | NEW |