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

Side by Side Diff: content/public/test/mock_render_process_host.cc

Issue 740813004: Use StopChildProcess instead of base::KillProcess to kill a renderer process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typos Created 6 years 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 "content/public/test/mock_render_process_host.h" 5 #include "content/public/test/mock_render_process_host.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/process/process_handle.h" 9 #include "base/process/process_handle.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 void MockRenderProcessHost::AddWord(const base::string16& word) { 107 void MockRenderProcessHost::AddWord(const base::string16& word) {
108 } 108 }
109 109
110 bool MockRenderProcessHost::FastShutdownIfPossible() { 110 bool MockRenderProcessHost::FastShutdownIfPossible() {
111 // We aren't actually going to do anything, but set |fast_shutdown_started_| 111 // We aren't actually going to do anything, but set |fast_shutdown_started_|
112 // to true so that tests know we've been called. 112 // to true so that tests know we've been called.
113 fast_shutdown_started_ = true; 113 fast_shutdown_started_ = true;
114 return true; 114 return true;
115 } 115 }
116 116
117 bool MockRenderProcessHost::FastShutdown(int exit_code, bool wait) {
118 return true;
119 }
120
117 bool MockRenderProcessHost::FastShutdownStarted() const { 121 bool MockRenderProcessHost::FastShutdownStarted() const {
118 return fast_shutdown_started_; 122 return fast_shutdown_started_;
119 } 123 }
120 124
121 void MockRenderProcessHost::DumpHandles() { 125 void MockRenderProcessHost::DumpHandles() {
122 } 126 }
123 127
124 base::ProcessHandle MockRenderProcessHost::GetHandle() const { 128 base::ProcessHandle MockRenderProcessHost::GetHandle() const {
125 // Return the current-process handle for the IPC::GetFileHandleForProcess 129 // Return the current-process handle for the IPC::GetFileHandleForProcess
126 // function. 130 // function.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); 297 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin();
294 it != processes_.end(); ++it) { 298 it != processes_.end(); ++it) {
295 if (*it == host) { 299 if (*it == host) {
296 processes_.weak_erase(it); 300 processes_.weak_erase(it);
297 break; 301 break;
298 } 302 }
299 } 303 }
300 } 304 }
301 305
302 } // content 306 } // content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698