OLD | NEW |
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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 ANNOTATE_SCOPED_MEMORY_LEAK; | 496 ANNOTATE_SCOPED_MEMORY_LEAK; |
497 breakpad::CrashHandlerHostLinux* crash_handler = | 497 breakpad::CrashHandlerHostLinux* crash_handler = |
498 new breakpad::CrashHandlerHostLinux( | 498 new breakpad::CrashHandlerHostLinux( |
499 process_type, dumps_path, getenv(env_vars::kHeadless) == NULL); | 499 process_type, dumps_path, getenv(env_vars::kHeadless) == NULL); |
500 crash_handler->StartUploaderThread(); | 500 crash_handler->StartUploaderThread(); |
501 return crash_handler; | 501 return crash_handler; |
502 } | 502 } |
503 } | 503 } |
504 | 504 |
505 int GetCrashSignalFD(const CommandLine& command_line) { | 505 int GetCrashSignalFD(const CommandLine& command_line) { |
506 if (command_line.HasSwitch(switches::kExtensionProcess)) { | 506 if (command_line.HasSwitch(extensions::switches::kExtensionProcess)) { |
507 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; | 507 static breakpad::CrashHandlerHostLinux* crash_handler = NULL; |
508 if (!crash_handler) | 508 if (!crash_handler) |
509 crash_handler = CreateCrashHandlerHost("extension"); | 509 crash_handler = CreateCrashHandlerHost("extension"); |
510 return crash_handler->GetDeathSignalSocket(); | 510 return crash_handler->GetDeathSignalSocket(); |
511 } | 511 } |
512 | 512 |
513 std::string process_type = | 513 std::string process_type = |
514 command_line.GetSwitchValueASCII(switches::kProcessType); | 514 command_line.GetSwitchValueASCII(switches::kProcessType); |
515 | 515 |
516 if (process_type == switches::kRendererProcess) { | 516 if (process_type == switches::kRendererProcess) { |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 content::RenderProcessHost* process = | 1452 content::RenderProcessHost* process = |
1453 content::RenderProcessHost::FromID(child_process_id); | 1453 content::RenderProcessHost::FromID(child_process_id); |
1454 if (process) { | 1454 if (process) { |
1455 Profile* profile = Profile::FromBrowserContext( | 1455 Profile* profile = Profile::FromBrowserContext( |
1456 process->GetBrowserContext()); | 1456 process->GetBrowserContext()); |
1457 ExtensionService* extension_service = | 1457 ExtensionService* extension_service = |
1458 extensions::ExtensionSystem::Get(profile)->extension_service(); | 1458 extensions::ExtensionSystem::Get(profile)->extension_service(); |
1459 if (extension_service) { | 1459 if (extension_service) { |
1460 extensions::ProcessMap* process_map = extension_service->process_map(); | 1460 extensions::ProcessMap* process_map = extension_service->process_map(); |
1461 if (process_map && process_map->Contains(process->GetID())) | 1461 if (process_map && process_map->Contains(process->GetID())) |
1462 command_line->AppendSwitch(switches::kExtensionProcess); | 1462 command_line->AppendSwitch(extensions::switches::kExtensionProcess); |
1463 } | 1463 } |
1464 | 1464 |
1465 PrefService* prefs = profile->GetPrefs(); | 1465 PrefService* prefs = profile->GetPrefs(); |
1466 // Currently this pref is only registered if applied via a policy. | 1466 // Currently this pref is only registered if applied via a policy. |
1467 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && | 1467 if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && |
1468 prefs->GetBoolean(prefs::kDisable3DAPIs)) { | 1468 prefs->GetBoolean(prefs::kDisable3DAPIs)) { |
1469 // Turn this policy into a command line switch. | 1469 // Turn this policy into a command line switch. |
1470 command_line->AppendSwitch(switches::kDisable3DAPIs); | 1470 command_line->AppendSwitch(switches::kDisable3DAPIs); |
1471 } | 1471 } |
1472 | 1472 |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2655 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on | 2655 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on |
2656 // Chromium builds as well. | 2656 // Chromium builds as well. |
2657 return channel <= chrome::VersionInfo::CHANNEL_DEV; | 2657 return channel <= chrome::VersionInfo::CHANNEL_DEV; |
2658 #else | 2658 #else |
2659 return false; | 2659 return false; |
2660 #endif | 2660 #endif |
2661 } | 2661 } |
2662 | 2662 |
2663 | 2663 |
2664 } // namespace chrome | 2664 } // namespace chrome |
OLD | NEW |