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

Side by Side Diff: remoting/jingle_glue/jingle_thread.cc

Issue 9582031: Don't crash in ~HostNPScriptObject() when the object wasn't initialized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 years, 9 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
« no previous file with comments | « remoting/jingle_glue/jingle_thread.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "remoting/jingle_glue/jingle_thread.h" 5 #include "remoting/jingle_glue/jingle_thread.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/message_pump.h" 10 #include "base/message_pump.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 JingleThread::~JingleThread() { 147 JingleThread::~JingleThread() {
148 // It is important to call Stop here. If we wait for the base class to 148 // It is important to call Stop here. If we wait for the base class to
149 // call Stop in it's d'tor, then JingleThread::Run() will access member 149 // call Stop in it's d'tor, then JingleThread::Run() will access member
150 // variables that are already gone. See similar comments in 150 // variables that are already gone. See similar comments in
151 // base/threading/thread.h. 151 // base/threading/thread.h.
152 if (message_loop_) 152 if (message_loop_)
153 Stop(); 153 Stop();
154 } 154 }
155 155
156 void JingleThread::Start() { 156 bool JingleThread::Start() {
157 Thread::Start(); 157 if (!Thread::Start())
158 return false;
158 started_event_.Wait(); 159 started_event_.Wait();
160 return true;
159 } 161 }
160 162
161 void JingleThread::Run() { 163 void JingleThread::Run() {
162 JingleThreadMessageLoop message_loop(this); 164 JingleThreadMessageLoop message_loop(this);
163 message_loop_ = &message_loop; 165 message_loop_ = &message_loop;
164 message_loop_proxy_ = base::MessageLoopProxy::current(); 166 message_loop_proxy_ = base::MessageLoopProxy::current();
165 167
166 TaskPump task_pump; 168 TaskPump task_pump;
167 task_pump_ = &task_pump; 169 task_pump_ = &task_pump;
168 170
(...skipping 22 matching lines...) Expand all
191 193
192 base::MessageLoopProxy* JingleThread::message_loop_proxy() { 194 base::MessageLoopProxy* JingleThread::message_loop_proxy() {
193 return message_loop_proxy_; 195 return message_loop_proxy_;
194 } 196 }
195 197
196 TaskPump* JingleThread::task_pump() { 198 TaskPump* JingleThread::task_pump() {
197 return task_pump_; 199 return task_pump_;
198 } 200 }
199 201
200 } // namespace remoting 202 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/jingle_glue/jingle_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698