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

Side by Side Diff: Source/core/dom/MainThreadTaskRunner.cpp

Issue 1320563003: Oilpan: avoid using WeakPtr<> for heap residing objects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert unrelated unit test addition Created 5 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All Rights Reserved. 2 * Copyright (C) 2013 Google Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 30 matching lines...) Expand all
41 MainThreadTask(WeakPtrWillBeRawPtr<MainThreadTaskRunner> runner, PassOwnPtr< ExecutionContextTask> task, bool isInspectorTask) 41 MainThreadTask(WeakPtrWillBeRawPtr<MainThreadTaskRunner> runner, PassOwnPtr< ExecutionContextTask> task, bool isInspectorTask)
42 : m_runner(runner) 42 : m_runner(runner)
43 , m_task(task) 43 , m_task(task)
44 , m_isInspectorTask(isInspectorTask) 44 , m_isInspectorTask(isInspectorTask)
45 { 45 {
46 } 46 }
47 47
48 void run() override; 48 void run() override;
49 49
50 private: 50 private:
51 #if ENABLE(OILPAN) 51 WeakPtrWillBeCrossThreadWeakPersistent<MainThreadTaskRunner> m_runner;
52 CrossThreadWeakPersistent<MainThreadTaskRunner> m_runner;
53 #else
54 WeakPtr<MainThreadTaskRunner> m_runner;
55 #endif
56 OwnPtr<ExecutionContextTask> m_task; 52 OwnPtr<ExecutionContextTask> m_task;
57 bool m_isInspectorTask; 53 bool m_isInspectorTask;
58 }; 54 };
59 55
60 void MainThreadTask::run() 56 void MainThreadTask::run()
61 { 57 {
62 ASSERT(isMainThread()); 58 ASSERT(isMainThread());
63 59
64 if (!m_runner.get()) 60 if (!m_runner.get())
65 return; 61 return;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 WeakPtrWillBeRawPtr<MainThreadTaskRunner> MainThreadTaskRunner::createWeakPointe rToSelf() 141 WeakPtrWillBeRawPtr<MainThreadTaskRunner> MainThreadTaskRunner::createWeakPointe rToSelf()
146 { 142 {
147 #if ENABLE(OILPAN) 143 #if ENABLE(OILPAN)
148 return this; 144 return this;
149 #else 145 #else
150 return m_weakFactory.createWeakPtr(); 146 return m_weakFactory.createWeakPtr();
151 #endif 147 #endif
152 } 148 }
153 149
154 } // namespace 150 } // namespace
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/FormAssociatedElement.h » ('j') | Source/modules/cachestorage/Cache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698