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

Side by Side Diff: ppapi/proxy/tracked_callback_unittest.cc

Issue 2310253002: Remove calls to deprecated MessageLoop methods in ppapi. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | 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) 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 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 base::SimpleThread::Join(); 56 base::SimpleThread::Join();
57 } 57 }
58 void Run() override { 58 void Run() override {
59 ProxyAutoLock acquire; 59 ProxyAutoLock acquire;
60 // Make a local copy of message_loop_ for this thread so we can interact 60 // Make a local copy of message_loop_ for this thread so we can interact
61 // with it even after the main thread releases it. 61 // with it even after the main thread releases it.
62 scoped_refptr<MessageLoopResource> message_loop(message_loop_); 62 scoped_refptr<MessageLoopResource> message_loop(message_loop_);
63 message_loop->AttachToCurrentThread(); 63 message_loop->AttachToCurrentThread();
64 // Note, run releases the lock to run events. 64 // Note, run releases the lock to run events.
65 message_loop->Run(); 65 base::RunLoop().Run();
66 message_loop->DetachFromThread(); 66 message_loop->DetachFromThread();
67 } 67 }
68 68
69 MessageLoopResource* message_loop() { return message_loop_.get(); } 69 MessageLoopResource* message_loop() { return message_loop_.get(); }
70 70
71 private: 71 private:
72 PP_Instance instance_; 72 PP_Instance instance_;
73 scoped_refptr<MessageLoopResource> message_loop_; 73 scoped_refptr<MessageLoopResource> message_loop_;
74 }; 74 };
75 75
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 resource->ReleaseRef(); 469 resource->ReleaseRef();
470 resource->CheckFinalState(); 470 resource->CheckFinalState();
471 { 471 {
472 ProxyAutoLock lock; 472 ProxyAutoLock lock;
473 resource = nullptr; 473 resource = nullptr;
474 } 474 }
475 } 475 }
476 476
477 } // namespace proxy 477 } // namespace proxy
478 } // namespace ppapi 478 } // namespace ppapi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698