Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: content/public/test/browser_test_utils.h

Issue 1155993003: Fix accessibility with out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_BROWSER_TEST_UTILS_H_ 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 bool OnMessageReceived(const IPC::Message& message) override; 427 bool OnMessageReceived(const IPC::Message& message) override;
428 428
429 void ReceivedFrameSwap(); 429 void ReceivedFrameSwap();
430 430
431 int frames_to_wait_; 431 int frames_to_wait_;
432 base::Closure quit_; 432 base::Closure quit_;
433 433
434 DISALLOW_COPY_AND_ASSIGN(FrameWatcher); 434 DISALLOW_COPY_AND_ASSIGN(FrameWatcher);
435 }; 435 };
436 436
437 // This observer keeps track of the last deleted RenderViewHost to avoid
438 // accessing it and causing use-after-free condition.
439 class RenderViewHostDeletedObserver : public WebContentsObserver {
440 public:
441 RenderViewHostDeletedObserver(RenderViewHost* rvh);
442 ~RenderViewHostDeletedObserver() override;
443 void RenderViewDeleted(RenderViewHost* render_view_host) override;
444 bool deleted();
445 void WaitUntilDeleted();
446
447 private:
448 int process_id_;
449 int routing_id_;
450 bool deleted_;
451 scoped_ptr<base::RunLoop> runner_;
452
453 DISALLOW_COPY_AND_ASSIGN(RenderViewHostDeletedObserver);
454 };
455
456 // This observer keeps track of the last deleted RenderFrameHost to avoid
457 // accessing it and causing use-after-free condition.
458 class RenderFrameHostDeletedObserver : public WebContentsObserver {
459 public:
460 RenderFrameHostDeletedObserver(RenderFrameHost* rfh);
461 ~RenderFrameHostDeletedObserver() override;
462 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override;
463 bool deleted();
464 void WaitUntilDeleted();
465
466 private:
467 int process_id_;
468 int routing_id_;
469 bool deleted_;
470 scoped_ptr<base::RunLoop> runner_;
471
472 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostDeletedObserver);
473 };
474
437 } // namespace content 475 } // namespace content
438 476
439 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 477 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698