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

Side by Side Diff: mojo/edk/embedder/embedder.cc

Issue 2043713004: Mojo: Add NotifyBadMessage API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/edk/embedder/embedder.h" 5 #include "mojo/edk/embedder/embedder.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 26 matching lines...) Expand all
37 Core* GetCore() { return g_core; } 37 Core* GetCore() { return g_core; }
38 38
39 } // namespace internal 39 } // namespace internal
40 40
41 void SetMaxMessageSize(size_t bytes) { 41 void SetMaxMessageSize(size_t bytes) {
42 } 42 }
43 43
44 void ChildProcessLaunched(base::ProcessHandle child_process, 44 void ChildProcessLaunched(base::ProcessHandle child_process,
45 ScopedPlatformHandle server_pipe, 45 ScopedPlatformHandle server_pipe,
46 const std::string& child_token) { 46 const std::string& child_token) {
47 ChildProcessLaunched(
48 child_process, std::move(server_pipe), child_token, base::Closure());
49 }
50
51 void ChildProcessLaunched(base::ProcessHandle child_process,
52 ScopedPlatformHandle server_pipe,
53 const std::string& child_token,
54 const base::Closure& bad_message_callback) {
47 CHECK(internal::g_core); 55 CHECK(internal::g_core);
48 internal::g_core->AddChild(child_process, std::move(server_pipe), 56 internal::g_core->AddChild(child_process, std::move(server_pipe),
49 child_token); 57 child_token, bad_message_callback);
50 } 58 }
51 59
52 void ChildProcessLaunchFailed(const std::string& child_token) { 60 void ChildProcessLaunchFailed(const std::string& child_token) {
53 CHECK(internal::g_core); 61 CHECK(internal::g_core);
54 internal::g_core->ChildLaunchFailed(child_token); 62 internal::g_core->ChildLaunchFailed(child_token);
55 } 63 }
56 64
57 void SetParentPipeHandle(ScopedPlatformHandle pipe) { 65 void SetParentPipeHandle(ScopedPlatformHandle pipe) {
58 CHECK(internal::g_core); 66 CHECK(internal::g_core);
59 internal::g_core->InitChild(std::move(pipe)); 67 internal::g_core->InitChild(std::move(pipe));
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // Not secure. For NaCl only! 162 // Not secure. For NaCl only!
155 base::RandBytes(random_bytes, 16); 163 base::RandBytes(random_bytes, 16);
156 #else 164 #else
157 crypto::RandBytes(random_bytes, 16); 165 crypto::RandBytes(random_bytes, 16);
158 #endif 166 #endif
159 return base::HexEncode(random_bytes, 16); 167 return base::HexEncode(random_bytes, 16);
160 } 168 }
161 169
162 } // namespace edk 170 } // namespace edk
163 } // namespace mojo 171 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698