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

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: address lei's comments 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
« no previous file with comments | « chromecast/shell/browser/cast_browser_process.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/files/scoped_file.h" 8 #include "base/files/scoped_file.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "chromecast/common/cast_paths.h" 11 #include "chromecast/common/cast_paths.h"
12 #include "chromecast/common/global_descriptors.h" 12 #include "chromecast/common/global_descriptors.h"
13 #include "chromecast/shell/browser/cast_browser_context.h" 13 #include "chromecast/shell/browser/cast_browser_context.h"
14 #include "chromecast/shell/browser/cast_browser_main_parts.h" 14 #include "chromecast/shell/browser/cast_browser_main_parts.h"
15 #include "chromecast/shell/browser/cast_browser_process.h" 15 #include "chromecast/shell/browser/cast_browser_process.h"
16 #include "chromecast/shell/browser/cast_network_delegate.h" 16 #include "chromecast/shell/browser/cast_network_delegate.h"
17 #include "chromecast/shell/browser/devtools/cast_dev_tools_delegate.h" 17 #include "chromecast/shell/browser/devtools/cast_dev_tools_delegate.h"
18 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h" 18 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h"
19 #include "chromecast/shell/browser/url_request_context_factory.h" 19 #include "chromecast/shell/browser/url_request_context_factory.h"
20 #include "components/crash/app/breakpad_linux.h"
20 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
21 #include "content/public/browser/certificate_request_result_type.h" 22 #include "content/public/browser/certificate_request_result_type.h"
22 #include "content/public/browser/render_process_host.h" 23 #include "content/public/browser/render_process_host.h"
23 #include "content/public/common/content_descriptors.h" 24 #include "content/public/common/content_descriptors.h"
24 #include "content/public/common/content_switches.h" 25 #include "content/public/common/content_switches.h"
25 #include "content/public/common/url_constants.h" 26 #include "content/public/common/url_constants.h"
26 #include "content/public/common/web_preferences.h" 27 #include "content/public/common/web_preferences.h"
27 #include "net/ssl/ssl_cert_request_info.h" 28 #include "net/ssl/ssl_cert_request_info.h"
28 29
29 #if defined(OS_ANDROID) 30 #if defined(OS_ANDROID)
30 #include "chromecast/shell/browser/android/external_video_surface_container_impl .h" 31 #include "chromecast/shell/browser/android/external_video_surface_container_impl .h"
31 #endif // defined(OS_ANDROID) 32 #endif // defined(OS_ANDROID)
32 33
34 #if defined(OS_ANDROID)
35 #include "components/crash/browser/crash_dump_manager_android.h"
36 #endif // defined(OS_ANDROID)
37
33 namespace chromecast { 38 namespace chromecast {
34 namespace shell { 39 namespace shell {
35 40
36 CastContentBrowserClient::CastContentBrowserClient() 41 CastContentBrowserClient::CastContentBrowserClient()
37 : url_request_context_factory_(new URLRequestContextFactory()) { 42 : url_request_context_factory_(new URLRequestContextFactory()) {
38 } 43 }
39 44
40 CastContentBrowserClient::~CastContentBrowserClient() { 45 CastContentBrowserClient::~CastContentBrowserClient() {
41 content::BrowserThread::DeleteSoon( 46 content::BrowserThread::DeleteSoon(
42 content::BrowserThread::IO, 47 content::BrowserThread::IO,
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 base::FilePath pak_file; 226 base::FilePath pak_file;
222 CHECK(PathService::Get(FILE_CAST_PAK, &pak_file)); 227 CHECK(PathService::Get(FILE_CAST_PAK, &pak_file));
223 base::File pak_with_flags(pak_file, flags); 228 base::File pak_with_flags(pak_file, flags);
224 if (!pak_with_flags.IsValid()) { 229 if (!pak_with_flags.IsValid()) {
225 NOTREACHED() << "Failed to open file when creating renderer process: " 230 NOTREACHED() << "Failed to open file when creating renderer process: "
226 << "cast_shell.pak"; 231 << "cast_shell.pak";
227 } 232 }
228 mappings->Transfer( 233 mappings->Transfer(
229 kAndroidPakDescriptor, 234 kAndroidPakDescriptor,
230 base::ScopedFD(pak_with_flags.TakePlatformFile())); 235 base::ScopedFD(pak_with_flags.TakePlatformFile()));
236
237 if (breakpad::IsCrashReporterEnabled()) {
238 base::File minidump_file(
239 breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
240 child_process_id));
241 if (!minidump_file.IsValid()) {
242 LOG(ERROR) << "Failed to create file for minidump, crash reporting will "
243 << "be disabled for this process.";
244 } else {
245 mappings->Transfer(kAndroidMinidumpDescriptor,
246 base::ScopedFD(minidump_file.TakePlatformFile()));
247 }
248 }
231 #endif // defined(OS_ANDROID) 249 #endif // defined(OS_ANDROID)
232 } 250 }
233 251
234 #if defined(OS_ANDROID) && defined(VIDEO_HOLE) 252 #if defined(OS_ANDROID) && defined(VIDEO_HOLE)
235 content::ExternalVideoSurfaceContainer* 253 content::ExternalVideoSurfaceContainer*
236 CastContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( 254 CastContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(
237 content::WebContents* web_contents) { 255 content::WebContents* web_contents) {
238 return new ExternalVideoSurfaceContainerImpl(web_contents); 256 return new ExternalVideoSurfaceContainerImpl(web_contents);
239 } 257 }
240 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE) 258 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE)
241 259
242 260
243 } // namespace shell 261 } // namespace shell
244 } // namespace chromecast 262 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/shell/browser/cast_browser_process.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698