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

Side by Side Diff: content/browser/renderer_host/render_widget_resize_helper.h

Issue 399213003: Fix crash in Mac ASAN RenderWidgetResizeHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_to_cpp
Patch Set: More comments Created 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_RESIZE_HELPER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_RESIZE_HELPER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_RESIZE_HELPER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_RESIZE_HELPER_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 ~RenderWidgetResizeHelper(); 75 ~RenderWidgetResizeHelper();
76 76
77 // A classed used to wrap an IPC or a task. 77 // A classed used to wrap an IPC or a task.
78 class EnqueuedTask; 78 class EnqueuedTask;
79 friend class EnqueuedTask; 79 friend class EnqueuedTask;
80 80
81 // Called on the IO thread to add a task to the queue. 81 // Called on the IO thread to add a task to the queue.
82 void PostEnqueuedTask(EnqueuedTask* proxy); 82 void PostEnqueuedTask(EnqueuedTask* proxy);
83 83
84 // Called on the UI to remove the task from the queue when it is run. 84 // Called on the UI to remove the task from the queue when it is run.
85 void WillRunEnqueuedTask(EnqueuedTask* proxy); 85 void RemoveEnqueuedTaskFromQueue(EnqueuedTask* proxy);
86 86
87 // A queue of live messages. Must hold |task_queue_lock_| to access. 87 // A queue of live messages. Must hold |task_queue_lock_| to access. Tasks
88 // The EnqueuedTask objects are removed from the front of the queue when 88 // are added only on the IO thread and removed only on the UI thread. The
89 // they are run (either by TaskRunner they were posted to or by a call to 89 // EnqueuedTask objects are removed from the front of the queue when they are
90 // WaitForSingleTaskToRun pulling them off of the queue). 90 // run (by TaskRunner they were posted to, by a call to WaitForSingleTaskToRun
91 // pulling them off of the queue, or by TaskRunner when it is destroyed).
91 typedef std::deque<EnqueuedTask*> EnqueuedTaskQueue; 92 typedef std::deque<EnqueuedTask*> EnqueuedTaskQueue;
92 EnqueuedTaskQueue task_queue_; 93 EnqueuedTaskQueue task_queue_;
93 base::Lock task_queue_lock_; 94 base::Lock task_queue_lock_;
94 95
95 // Event used to wake up the UI thread if it is sleeping in 96 // Event used to wake up the UI thread if it is sleeping in
96 // WaitForSingleTaskToRun. 97 // WaitForSingleTaskToRun.
97 base::WaitableEvent event_; 98 base::WaitableEvent event_;
98 }; 99 };
99 100
100 } // namespace content 101 } // namespace content
101 102
102 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_RESIZE_HELPER_H_ 103 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_RESIZE_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698