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

Side by Side Diff: base/message_loop/message_pump_glib.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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 BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_ 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_
6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_ 6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_
7 7
8 #include <memory>
9
8 #include "base/base_export.h" 10 #include "base/base_export.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop/message_pump.h" 12 #include "base/message_loop/message_pump.h"
12 #include "base/observer_list.h" 13 #include "base/observer_list.h"
13 #include "base/time/time.h" 14 #include "base/time/time.h"
14 15
15 typedef struct _GMainContext GMainContext; 16 typedef struct _GMainContext GMainContext;
16 typedef struct _GPollFD GPollFD; 17 typedef struct _GPollFD GPollFD;
17 typedef struct _GSource GSource; 18 typedef struct _GSource GSource;
18 19
19 namespace base { 20 namespace base {
20 21
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // the message pump is destroyed. 63 // the message pump is destroyed.
63 GSource* work_source_; 64 GSource* work_source_;
64 65
65 // We use a wakeup pipe to make sure we'll get out of the glib polling phase 66 // We use a wakeup pipe to make sure we'll get out of the glib polling phase
66 // when another thread has scheduled us to do some work. There is a glib 67 // when another thread has scheduled us to do some work. There is a glib
67 // mechanism g_main_context_wakeup, but this won't guarantee that our event's 68 // mechanism g_main_context_wakeup, but this won't guarantee that our event's
68 // Dispatch() will be called. 69 // Dispatch() will be called.
69 int wakeup_pipe_read_; 70 int wakeup_pipe_read_;
70 int wakeup_pipe_write_; 71 int wakeup_pipe_write_;
71 // Use a scoped_ptr to avoid needing the definition of GPollFD in the header. 72 // Use a scoped_ptr to avoid needing the definition of GPollFD in the header.
72 scoped_ptr<GPollFD> wakeup_gpollfd_; 73 std::unique_ptr<GPollFD> wakeup_gpollfd_;
73 74
74 DISALLOW_COPY_AND_ASSIGN(MessagePumpGlib); 75 DISALLOW_COPY_AND_ASSIGN(MessagePumpGlib);
75 }; 76 };
76 77
77 } // namespace base 78 } // namespace base
78 79
79 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_ 80 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_GLIB_H_
OLDNEW
« no previous file with comments | « base/message_loop/message_loop_unittest.cc ('k') | base/message_loop/message_pump_io_ios_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698