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

Side by Side Diff: ipc/ipc_channel_win.cc

Issue 1954543002: Remove handler from MessagePumpForIO::IOContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_observers
Patch Set: rebase Created 4 years, 7 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 #include "ipc/ipc_channel_win.h" 5 #include "ipc/ipc_channel_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "base/threading/thread_checker.h" 21 #include "base/threading/thread_checker.h"
22 #include "base/win/scoped_handle.h" 22 #include "base/win/scoped_handle.h"
23 #include "ipc/attachment_broker.h" 23 #include "ipc/attachment_broker.h"
24 #include "ipc/ipc_listener.h" 24 #include "ipc/ipc_listener.h"
25 #include "ipc/ipc_logging.h" 25 #include "ipc/ipc_logging.h"
26 #include "ipc/ipc_message_attachment_set.h" 26 #include "ipc/ipc_message_attachment_set.h"
27 #include "ipc/ipc_message_utils.h" 27 #include "ipc/ipc_message_utils.h"
28 28
29 namespace IPC { 29 namespace IPC {
30 30
31 ChannelWin::State::State(ChannelWin* channel) : is_pending(false) { 31 ChannelWin::State::State(ChannelWin* channel) : is_pending(false) {
Lei Zhang 2016/05/09 22:41:30 Do we still need the |channel| param?
fdoray 2016/05/10 16:33:17 Done.
32 memset(&context.overlapped, 0, sizeof(context.overlapped));
33 context.handler = channel;
34 } 32 }
35 33
36 ChannelWin::State::~State() { 34 ChannelWin::State::~State() {
37 static_assert(offsetof(ChannelWin::State, context) == 0, 35 static_assert(offsetof(ChannelWin::State, context) == 0,
38 "ChannelWin::State should have context as its first data" 36 "ChannelWin::State should have context as its first data"
39 "member."); 37 "member.");
40 } 38 }
41 39
42 ChannelWin::ChannelWin(const IPC::ChannelHandle& channel_handle, 40 ChannelWin::ChannelWin(const IPC::ChannelHandle& channel_handle,
43 Mode mode, 41 Mode mode,
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 int secret; 604 int secret;
607 do { // Guarantee we get a non-zero value. 605 do { // Guarantee we get a non-zero value.
608 secret = base::RandInt(0, std::numeric_limits<int>::max()); 606 secret = base::RandInt(0, std::numeric_limits<int>::max());
609 } while (secret == 0); 607 } while (secret == 0);
610 608
611 id.append(GenerateUniqueRandomChannelID()); 609 id.append(GenerateUniqueRandomChannelID());
612 return id.append(base::StringPrintf("\\%d", secret)); 610 return id.append(base::StringPrintf("\\%d", secret));
613 } 611 }
614 612
615 } // namespace IPC 613 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698