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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 2814793005: Mark the network bubble task as MayBlock to prevent it from crashing the browser. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | chrome/browser/ui/network_profile_bubble.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 17 matching lines...) Expand all
28 #include "base/path_service.h" 28 #include "base/path_service.h"
29 #include "base/profiler/scoped_tracker.h" 29 #include "base/profiler/scoped_tracker.h"
30 #include "base/profiler/stack_sampling_profiler.h" 30 #include "base/profiler/stack_sampling_profiler.h"
31 #include "base/run_loop.h" 31 #include "base/run_loop.h"
32 #include "base/strings/string16.h" 32 #include "base/strings/string16.h"
33 #include "base/strings/string_number_conversions.h" 33 #include "base/strings/string_number_conversions.h"
34 #include "base/strings/string_piece.h" 34 #include "base/strings/string_piece.h"
35 #include "base/strings/sys_string_conversions.h" 35 #include "base/strings/sys_string_conversions.h"
36 #include "base/strings/utf_string_conversions.h" 36 #include "base/strings/utf_string_conversions.h"
37 #include "base/sys_info.h" 37 #include "base/sys_info.h"
38 #include "base/task_scheduler/post_task.h"
38 #include "base/threading/platform_thread.h" 39 #include "base/threading/platform_thread.h"
39 #include "base/time/default_tick_clock.h" 40 #include "base/time/default_tick_clock.h"
40 #include "base/time/time.h" 41 #include "base/time/time.h"
41 #include "base/trace_event/trace_event.h" 42 #include "base/trace_event/trace_event.h"
42 #include "base/values.h" 43 #include "base/values.h"
43 #include "build/build_config.h" 44 #include "build/build_config.h"
44 #include "cc/base/switches.h" 45 #include "cc/base/switches.h"
45 #include "chrome/browser/about_flags.h" 46 #include "chrome/browser/about_flags.h"
46 #include "chrome/browser/after_startup_task_utils.h" 47 #include "chrome/browser/after_startup_task_utils.h"
47 #include "chrome/browser/browser_process.h" 48 #include "chrome/browser/browser_process.h"
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 // Registers Chrome with the Windows Restart Manager, which will restore the 1700 // Registers Chrome with the Windows Restart Manager, which will restore the
1700 // Chrome session when the computer is restarted after a system update. 1701 // Chrome session when the computer is restarted after a system update.
1701 // This could be run as late as WM_QUERYENDSESSION for system update reboots, 1702 // This could be run as late as WM_QUERYENDSESSION for system update reboots,
1702 // but should run on startup if extended to handle crashes/hangs/patches. 1703 // but should run on startup if extended to handle crashes/hangs/patches.
1703 // Also, better to run once here than once for each HWND's WM_QUERYENDSESSION. 1704 // Also, better to run once here than once for each HWND's WM_QUERYENDSESSION.
1704 ChromeBrowserMainPartsWin::RegisterApplicationRestart(parsed_command_line()); 1705 ChromeBrowserMainPartsWin::RegisterApplicationRestart(parsed_command_line());
1705 1706
1706 // Verify that the profile is not on a network share and if so prepare to show 1707 // Verify that the profile is not on a network share and if so prepare to show
1707 // notification to the user. 1708 // notification to the user.
1708 if (NetworkProfileBubble::ShouldCheckNetworkProfile(profile_)) { 1709 if (NetworkProfileBubble::ShouldCheckNetworkProfile(profile_)) {
1709 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 1710 base::PostTaskWithTraits(
1711 FROM_HERE, base::TaskTraits().MayBlock(),
1710 base::Bind(&NetworkProfileBubble::CheckNetworkProfile, 1712 base::Bind(&NetworkProfileBubble::CheckNetworkProfile,
1711 profile_->GetPath())); 1713 profile_->GetPath()));
1712 } 1714 }
1713 #endif // defined(OS_WIN) 1715 #endif // defined(OS_WIN)
1714 1716
1715 #if BUILDFLAG(ENABLE_RLZ) && !defined(OS_CHROMEOS) 1717 #if BUILDFLAG(ENABLE_RLZ) && !defined(OS_CHROMEOS)
1716 // Init the RLZ library. This just binds the dll and schedules a task on the 1718 // Init the RLZ library. This just binds the dll and schedules a task on the
1717 // file thread to be run sometime later. If this is the first run we record 1719 // file thread to be run sometime later. If this is the first run we record
1718 // the installation event. 1720 // the installation event.
1719 int ping_delay = 1721 int ping_delay =
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2079 chromeos::CrosSettings::Shutdown(); 2081 chromeos::CrosSettings::Shutdown();
2080 #endif // defined(OS_CHROMEOS) 2082 #endif // defined(OS_CHROMEOS)
2081 #endif // defined(OS_ANDROID) 2083 #endif // defined(OS_ANDROID)
2082 } 2084 }
2083 2085
2084 // Public members: 2086 // Public members:
2085 2087
2086 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2088 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2087 chrome_extra_parts_.push_back(parts); 2089 chrome_extra_parts_.push_back(parts);
2088 } 2090 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/network_profile_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698