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

Side by Side Diff: content/public/browser/render_process_host.h

Issue 2387113004: Better bad message reporting from IO thread (Closed)
Patch Set: cleanup Created 4 years, 2 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 CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 struct RendererClosedDetails { 58 struct RendererClosedDetails {
59 RendererClosedDetails(base::TerminationStatus status, 59 RendererClosedDetails(base::TerminationStatus status,
60 int exit_code) { 60 int exit_code) {
61 this->status = status; 61 this->status = status;
62 this->exit_code = exit_code; 62 this->exit_code = exit_code;
63 } 63 }
64 base::TerminationStatus status; 64 base::TerminationStatus status;
65 int exit_code; 65 int exit_code;
66 }; 66 };
67 67
68 // Crash reporting mode for ShutdownForBadMessage.
69 enum class CrashReportMode {
70 NO_CRASH_DUMP,
71 GENERATE_CRASH_DUMP,
72 };
73
68 // General functions --------------------------------------------------------- 74 // General functions ---------------------------------------------------------
69 75
70 ~RenderProcessHost() override {} 76 ~RenderProcessHost() override {}
71 77
72 // Initialize the new renderer process, returning true on success. This must 78 // Initialize the new renderer process, returning true on success. This must
73 // be called once before the object can be used, but can be called after 79 // be called once before the object can be used, but can be called after
74 // that with no effect. Therefore, if the caller isn't sure about whether 80 // that with no effect. Therefore, if the caller isn't sure about whether
75 // the process has been created, it should just call Init(). 81 // the process has been created, it should just call Init().
76 virtual bool Init() = 0; 82 virtual bool Init() = 0;
77 83
(...skipping 10 matching lines...) Expand all
88 // Add and remove observers for lifecycle events. The order in which 94 // Add and remove observers for lifecycle events. The order in which
89 // notifications are sent to observers is undefined. Observers must be sure to 95 // notifications are sent to observers is undefined. Observers must be sure to
90 // remove the observer before they go away. 96 // remove the observer before they go away.
91 virtual void AddObserver(RenderProcessHostObserver* observer) = 0; 97 virtual void AddObserver(RenderProcessHostObserver* observer) = 0;
92 virtual void RemoveObserver(RenderProcessHostObserver* observer) = 0; 98 virtual void RemoveObserver(RenderProcessHostObserver* observer) = 0;
93 99
94 // Called when a received message cannot be decoded. Terminates the renderer. 100 // Called when a received message cannot be decoded. Terminates the renderer.
95 // Most callers should not call this directly, but instead should call 101 // Most callers should not call this directly, but instead should call
96 // bad_message::BadMessageReceived() or an equivalent method outside of the 102 // bad_message::BadMessageReceived() or an equivalent method outside of the
97 // content module. 103 // content module.
98 virtual void ShutdownForBadMessage() = 0; 104 //
105 // If |crash_report_mode| is GENERATE_CRASH_DUMP, then a browser crash dump
106 // will be reported as well.
107 virtual void ShutdownForBadMessage(CrashReportMode crash_report_mode) = 0;
99 108
100 // Track the count of visible widgets. Called by listeners to register and 109 // Track the count of visible widgets. Called by listeners to register and
101 // unregister visibility. 110 // unregister visibility.
102 virtual void WidgetRestored() = 0; 111 virtual void WidgetRestored() = 0;
103 virtual void WidgetHidden() = 0; 112 virtual void WidgetHidden() = 0;
104 virtual int VisibleWidgetCount() const = 0; 113 virtual int VisibleWidgetCount() const = 0;
105 114
106 // Called when the audio state changes for this render process host. 115 // Called when the audio state changes for this render process host.
107 virtual void AudioStateChanged() = 0; 116 virtual void AudioStateChanged() = 0;
108 117
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 static void SetMaxRendererProcessCount(size_t count); 374 static void SetMaxRendererProcessCount(size_t count);
366 375
367 // Returns the current maximum number of renderer process hosts kept by the 376 // Returns the current maximum number of renderer process hosts kept by the
368 // content module. 377 // content module.
369 static size_t GetMaxRendererProcessCount(); 378 static size_t GetMaxRendererProcessCount();
370 }; 379 };
371 380
372 } // namespace content. 381 } // namespace content.
373 382
374 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ 383 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698