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

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

Issue 2374253007: Report unpermitted interface requests as bad messages (Closed)
Patch Set: . 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 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/browser/cast_content_browser_client.h" 5 #include "chromecast/browser/cast_content_browser_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/base_switches.h" 12 #include "base/base_switches.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/files/scoped_file.h" 14 #include "base/files/scoped_file.h"
15 #include "base/i18n/rtl.h" 15 #include "base/i18n/rtl.h"
16 #include "base/json/json_reader.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/memory/ptr_util.h" 18 #include "base/memory/ptr_util.h"
18 #include "base/path_service.h" 19 #include "base/path_service.h"
19 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
21 #include "base/threading/thread_task_runner_handle.h" 22 #include "base/threading/thread_task_runner_handle.h"
22 #include "build/build_config.h" 23 #include "build/build_config.h"
23 #include "chromecast/base/cast_constants.h" 24 #include "chromecast/base/cast_constants.h"
24 #include "chromecast/base/cast_paths.h" 25 #include "chromecast/base/cast_paths.h"
25 #include "chromecast/base/chromecast_switches.h" 26 #include "chromecast/base/chromecast_switches.h"
26 #include "chromecast/browser/cast_browser_context.h" 27 #include "chromecast/browser/cast_browser_context.h"
27 #include "chromecast/browser/cast_browser_main_parts.h" 28 #include "chromecast/browser/cast_browser_main_parts.h"
28 #include "chromecast/browser/cast_browser_process.h" 29 #include "chromecast/browser/cast_browser_process.h"
29 #include "chromecast/browser/cast_network_delegate.h" 30 #include "chromecast/browser/cast_network_delegate.h"
30 #include "chromecast/browser/cast_quota_permission_context.h" 31 #include "chromecast/browser/cast_quota_permission_context.h"
31 #include "chromecast/browser/cast_resource_dispatcher_host_delegate.h" 32 #include "chromecast/browser/cast_resource_dispatcher_host_delegate.h"
32 #include "chromecast/browser/devtools/cast_devtools_delegate.h" 33 #include "chromecast/browser/devtools/cast_devtools_delegate.h"
34 #include "chromecast/browser/grit/cast_browser_resources.h"
33 #include "chromecast/browser/media/media_caps_impl.h" 35 #include "chromecast/browser/media/media_caps_impl.h"
34 #include "chromecast/browser/service/cast_service_simple.h" 36 #include "chromecast/browser/service/cast_service_simple.h"
35 #include "chromecast/browser/url_request_context_factory.h" 37 #include "chromecast/browser/url_request_context_factory.h"
36 #include "chromecast/common/global_descriptors.h" 38 #include "chromecast/common/global_descriptors.h"
37 #include "chromecast/media/audio/cast_audio_manager.h" 39 #include "chromecast/media/audio/cast_audio_manager.h"
38 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" 40 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h"
39 #include "chromecast/public/media/media_pipeline_backend.h" 41 #include "chromecast/public/media/media_pipeline_backend.h"
40 #include "components/crash/content/app/breakpad_linux.h" 42 #include "components/crash/content/app/breakpad_linux.h"
41 #include "components/crash/content/browser/crash_handler_host_linux.h" 43 #include "components/crash/content/browser/crash_handler_host_linux.h"
42 #include "components/network_hints/browser/network_hints_message_filter.h" 44 #include "components/network_hints/browser/network_hints_message_filter.h"
43 #include "content/public/browser/browser_thread.h" 45 #include "content/public/browser/browser_thread.h"
44 #include "content/public/browser/certificate_request_result_type.h" 46 #include "content/public/browser/certificate_request_result_type.h"
45 #include "content/public/browser/client_certificate_delegate.h" 47 #include "content/public/browser/client_certificate_delegate.h"
46 #include "content/public/browser/render_process_host.h" 48 #include "content/public/browser/render_process_host.h"
47 #include "content/public/browser/resource_dispatcher_host.h" 49 #include "content/public/browser/resource_dispatcher_host.h"
48 #include "content/public/browser/web_contents.h" 50 #include "content/public/browser/web_contents.h"
49 #include "content/public/common/content_descriptors.h" 51 #include "content/public/common/content_descriptors.h"
50 #include "content/public/common/content_switches.h" 52 #include "content/public/common/content_switches.h"
53 #include "content/public/common/service_names.h"
51 #include "content/public/common/url_constants.h" 54 #include "content/public/common/url_constants.h"
52 #include "content/public/common/web_preferences.h" 55 #include "content/public/common/web_preferences.h"
53 #include "net/ssl/ssl_cert_request_info.h" 56 #include "net/ssl/ssl_cert_request_info.h"
54 #include "net/url_request/url_request_context_getter.h" 57 #include "net/url_request/url_request_context_getter.h"
55 #include "services/shell/public/cpp/interface_registry.h" 58 #include "services/shell/public/cpp/interface_registry.h"
59 #include "ui/base/resource/resource_bundle.h"
56 #include "ui/display/display.h" 60 #include "ui/display/display.h"
57 #include "ui/display/screen.h" 61 #include "ui/display/screen.h"
58 #include "ui/gl/gl_switches.h" 62 #include "ui/gl/gl_switches.h"
59 63
60 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 64 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
61 #include "chromecast/browser/media/cast_mojo_media_client.h" 65 #include "chromecast/browser/media/cast_mojo_media_client.h"
62 #include "media/mojo/services/mojo_media_application.h" // nogncheck 66 #include "media/mojo/services/mojo_media_application.h" // nogncheck
63 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS 67 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS
64 68
65 #if defined(OS_ANDROID) 69 #if defined(OS_ANDROID)
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 StaticMojoApplicationMap* apps) { 428 StaticMojoApplicationMap* apps) {
425 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 429 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
426 content::MojoApplicationInfo app_info; 430 content::MojoApplicationInfo app_info;
427 app_info.application_factory = 431 app_info.application_factory =
428 base::Bind(&CreateMojoMediaApplication, base::Unretained(this)); 432 base::Bind(&CreateMojoMediaApplication, base::Unretained(this));
429 app_info.application_task_runner = GetMediaTaskRunner(); 433 app_info.application_task_runner = GetMediaTaskRunner();
430 apps->insert(std::make_pair("mojo:media", app_info)); 434 apps->insert(std::make_pair("mojo:media", app_info));
431 #endif 435 #endif
432 } 436 }
433 437
438 std::unique_ptr<base::Value>
439 CastContentBrowserClient::GetServiceManifestOverlay(
440 const std::string& service_name) {
441 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
442 if (service_name != content::kBrowserMojoApplicationName)
443 return nullptr;
444 base::StringPiece manifest_contents =
445 rb.GetRawDataResourceForScale(IDR_CAST_CONTENT_BROWSER_MANIFEST_OVERLAY,
446 ui::ScaleFactor::SCALE_FACTOR_NONE);
447 return base::JSONReader::Read(manifest_contents);
448 }
449
434 #if defined(OS_ANDROID) 450 #if defined(OS_ANDROID)
435 451
436 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 452 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
437 const base::CommandLine& command_line, 453 const base::CommandLine& command_line,
438 int child_process_id, 454 int child_process_id,
439 content::FileDescriptorInfo* mappings, 455 content::FileDescriptorInfo* mappings,
440 std::map<int, base::MemoryMappedFile::Region>* regions) { 456 std::map<int, base::MemoryMappedFile::Region>* regions) {
441 mappings->Share( 457 mappings->Share(
442 kAndroidPakDescriptor, 458 kAndroidPakDescriptor,
443 base::GlobalDescriptors::GetInstance()->Get(kAndroidPakDescriptor)); 459 base::GlobalDescriptors::GetInstance()->Get(kAndroidPakDescriptor));
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 process_type, dumps_path, false /* upload */); 549 process_type, dumps_path, false /* upload */);
534 // StartUploaderThread() even though upload is diferred. 550 // StartUploaderThread() even though upload is diferred.
535 // Breakpad-related memory is freed in the uploader thread. 551 // Breakpad-related memory is freed in the uploader thread.
536 crash_handler->StartUploaderThread(); 552 crash_handler->StartUploaderThread();
537 return crash_handler; 553 return crash_handler;
538 } 554 }
539 #endif // !defined(OS_ANDROID) 555 #endif // !defined(OS_ANDROID)
540 556
541 } // namespace shell 557 } // namespace shell
542 } // namespace chromecast 558 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/cast_content_browser_client.h ('k') | chromecast/browser/cast_content_browser_manifest_overlay.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698