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

Side by Side Diff: chromecast/shell/browser/cast_content_browser_client.cc

Issue 620673003: Chromecast: adds crash handling for Android build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style nits Created 6 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 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 "chromecast/shell/browser/cast_content_browser_client.h" 5 #include "chromecast/shell/browser/cast_content_browser_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chromecast/common/cast_paths.h" 10 #include "chromecast/common/cast_paths.h"
11 #include "chromecast/common/global_descriptors.h" 11 #include "chromecast/common/global_descriptors.h"
12 #include "chromecast/shell/browser/cast_browser_context.h" 12 #include "chromecast/shell/browser/cast_browser_context.h"
13 #include "chromecast/shell/browser/cast_browser_main_parts.h" 13 #include "chromecast/shell/browser/cast_browser_main_parts.h"
14 #include "chromecast/shell/browser/cast_browser_process.h" 14 #include "chromecast/shell/browser/cast_browser_process.h"
15 #include "chromecast/shell/browser/devtools/cast_dev_tools_delegate.h" 15 #include "chromecast/shell/browser/devtools/cast_dev_tools_delegate.h"
16 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h" 16 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h"
17 #include "chromecast/shell/browser/url_request_context_factory.h" 17 #include "chromecast/shell/browser/url_request_context_factory.h"
18 #include "components/crash/app/breakpad_linux.h"
18 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
19 #include "content/public/browser/certificate_request_result_type.h" 20 #include "content/public/browser/certificate_request_result_type.h"
20 #include "content/public/browser/file_descriptor_info.h" 21 #include "content/public/browser/file_descriptor_info.h"
21 #include "content/public/browser/render_process_host.h" 22 #include "content/public/browser/render_process_host.h"
22 #include "content/public/common/content_descriptors.h" 23 #include "content/public/common/content_descriptors.h"
23 #include "content/public/common/content_switches.h" 24 #include "content/public/common/content_switches.h"
24 #include "content/public/common/url_constants.h" 25 #include "content/public/common/url_constants.h"
25 #include "content/public/common/web_preferences.h" 26 #include "content/public/common/web_preferences.h"
26 27
28 #if defined(OS_ANDROID)
29 #include "components/crash/browser/crash_dump_manager_android.h"
30 #endif // defined(OS_ANDROID)
31
27 namespace chromecast { 32 namespace chromecast {
28 namespace shell { 33 namespace shell {
29 34
30 CastContentBrowserClient::CastContentBrowserClient() 35 CastContentBrowserClient::CastContentBrowserClient()
31 : url_request_context_factory_(new URLRequestContextFactory()) { 36 : url_request_context_factory_(new URLRequestContextFactory()) {
32 } 37 }
33 38
34 CastContentBrowserClient::~CastContentBrowserClient() { 39 CastContentBrowserClient::~CastContentBrowserClient() {
35 content::BrowserThread::DeleteSoon( 40 content::BrowserThread::DeleteSoon(
36 content::BrowserThread::IO, 41 content::BrowserThread::IO,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 base::FilePath pak_file; 172 base::FilePath pak_file;
168 CHECK(PathService::Get(FILE_CAST_PAK, &pak_file)); 173 CHECK(PathService::Get(FILE_CAST_PAK, &pak_file));
169 base::File pak_with_flags(pak_file, flags); 174 base::File pak_with_flags(pak_file, flags);
170 if (!pak_with_flags.IsValid()) { 175 if (!pak_with_flags.IsValid()) {
171 NOTREACHED() << "Failed to open file when creating renderer process: " 176 NOTREACHED() << "Failed to open file when creating renderer process: "
172 << "cast_shell.pak"; 177 << "cast_shell.pak";
173 } 178 }
174 mappings->push_back(content::FileDescriptorInfo( 179 mappings->push_back(content::FileDescriptorInfo(
175 kAndroidPakDescriptor, 180 kAndroidPakDescriptor,
176 base::FileDescriptor(base::File(pak_file, flags)))); 181 base::FileDescriptor(base::File(pak_file, flags))));
182
183 if (breakpad::IsCrashReporterEnabled()) {
184 base::File minidump_file(
185 breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
186 child_process_id));
187 if (!minidump_file.IsValid()) {
188 LOG(ERROR) << "Failed to create file for minidump, crash reporting will "
189 << "be disabled for this process.";
190 } else {
191 mappings->push_back(content::FileDescriptorInfo(
192 kAndroidMinidumpDescriptor,
193 base::FileDescriptor(base::File(pak_file, flags))));
194 }
195 }
177 #endif // defined(OS_ANDROID) 196 #endif // defined(OS_ANDROID)
178 } 197 }
179 198
180 } // namespace shell 199 } // namespace shell
181 } // namespace chromecast 200 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698