summaryrefslogtreecommitdiffstats
path: root/base/win
Commit message (Collapse)AuthorAgeFilesLines
* Remove base/win/metro.{cc|h} and some associated codescottmg2016-01-123-249/+0
| | | | | | | | | | | | | | | | | | | | The goal was to start by removing base/win/metro.{cc|h}, but this ended up touching a number of places. So, also removed are: chrome/browser/metro_utils/ chrome/browser/ui/apps/apps_metro_handler_win.{cc|h} chrome/browser/ui/metro_pin_tab_helper_win.{cc|h} chrome/browser/ui/views/frame/browser_frame_ashwin.{cc|h} In order for the CL to not get even larger, there are some added TODOs pointing at the associated bug where calls to the above were removed, but the surrounding code is not yet simplified. BUG=558054 Review URL: https://codereview.chromium.org/1581473002 Cr-Commit-Position: refs/heads/master@{#368971}
* Refactor the IsKeyboardPresentOnSlate function.ananta2016-01-082-40/+63
| | | | | | | | | | | | | | | | | | | Currently this function shares the same logic as the IsTabletDevice function. One of the big differences was the IsTabletDevice function allows calls from Windows XP. Changed that to Windows 8+ and changed the IsKeyboardPresentOnSlate function to call IsTabletDevice. The IsTabletDevice function now takes in a reason argument which is updated with the reason info as to why the device was deemed to be a tablet or not. We now use the PowerDeterminePlatformRoleEx API to determine the platform role. As per msdn this function returns better results on Windows 8+. Next step would be to see if this function reliably works for tablets and slate mode. If yes then we can possibly flip the switch kDisableUsbKeyboardDetect to kEnableUsbKeyboardDetect which would ensure that the OSK pops up by default. BUG=497381 TBR=sky Review URL: https://codereview.chromium.org/1535643006 Cr-Commit-Position: refs/heads/master@{#368241}
* OnHandleBeingClosed should never CHECK when verifier is disabled.wfh2016-01-061-0/+3
| | | | | | | | | | | | This fixes the case where handle verifier is disabled after it's already started tracking scoped handles, and the CloseHandle hook is present. This changes behavior of OnHandleBeingClosed to match all other functions in the verifier. BUG=539505,571304 Review URL: https://codereview.chromium.org/1547853002 Cr-Commit-Position: refs/heads/master@{#367865}
* Remove warning pragmas in pe_image.ccwfh2015-12-244-38/+56
| | | | | | | | | | PEImage::GetProcAddress now returns consistent -1 on both 32-bit and 64-bit. Added a test to verify. BUG=167707,554200 Review URL: https://codereview.chromium.org/1370843003 Cr-Commit-Position: refs/heads/master@{#366836}
* Switch to standard integer types in base/win/.avi2015-12-2443-58/+104
| | | | | | | | | BUG=138542 TBR=cpu@chromium.org Review URL: https://codereview.chromium.org/1550493002 Cr-Commit-Position: refs/heads/master@{#366802}
* These caused failures on debug win7 bots that need further investigation.wfh2015-12-212-43/+5
| | | | | | | | | | | | | | | Reverting all the CLs, taking a step back, try again next year. This reverts commit 7969a476e9d9c755811ee49a2de51421360790e8. This reverts commit fdd35a81b4c360208bc0d6d7a2f61f5e8ad652db. BUG=571304,570912,481095 TBR=cpu@chromium.org Review URL: https://codereview.chromium.org/1545473002 Cr-Commit-Position: refs/heads/master@{#366445}
* Eliminate HICON leaks caused by creating icons from bitmap image.anpol2015-12-181-47/+15
| | | | | | | | | | | | | Every icon handle created by CreateHICONFromSkBitmap() should become immediately owned by its creator. We use base::win::ScopedHICON to control the icon's lifetime. R=sky@chromium.org BUG= Review URL: https://codereview.chromium.org/1406403007 Cr-Commit-Position: refs/heads/master@{#366055}
* Move handle hooks into base/win and add tests.wfh2015-12-162-5/+43
| | | | | | | | | | | | | | Also enable handle verifier on base_unittests for both 32-bit and 64-bit. This is a prerequisite for adding more test coverage. The only intended behavior change for Chrome in this CL is that if handle hooks cannot be installed then handle verifier is disabled. A future CL intends to enable handle verifier more widely in Chrome and across tests. BUG=480639, 459544 Review URL: https://codereview.chromium.org/1502523004 Cr-Commit-Position: refs/heads/master@{#365601}
* Fixing remaining VC++ 2015 64-bit build breaksbrucedawson2015-12-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VC++ 2015 64-bit builds trigger many new warnings about possibly unintended truncation bugs. Some of the bugs have a very low signal-to- noise ratio and this change suppresses them (4311 and 4312). Others seem to find some real bugs so I am leaving them enabled for now (4302 and 4334), fixing the bugs, and adjusting the code to suppress the other warnings. The changes in shell_web_contents_view_delegate_win.cc, ipc_perftest_support.cc, test_root_certs_win.cc, TracedLayoutObject.* and TraceEvent.h appear to fix real truncation bugs. Typical warnings are: ipc\ipc_perftest_support.cc(351): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) net\cert\test_root_certs_win.cc(103): warning C4302: 'reinterpret_cast': truncation from 'LPCSTR' to 'uint32_t' The main pattern is that VC++ 2015 is suspicious of code that converts a 64-bit pointer to a 32-bit integer. If the code converts from a pointer to a 64-bit integer, and then to a 32-bit integer, separating the type change from the truncation, then it assumes that the truncation is intentional. This seems like a reasonable heuristic. The warnings in the generated code were suppressed because they aren't bugs and because fixing gperf.exe (untouched since 2004) does not seem worthwhile. The warnings from gperf generated code look like: out\release_x64\gen\blink\core\csspropertynames.cpp(2914): warning C4302: 'type cast': truncation from 'char (*)[28]' to 'long' out\release_x64\gen\blink\core\cssvaluekeywords.cpp(3409): warning C4302: 'type cast': truncation from 'char (*)[4]' to 'long' Note that Windows HANDLE types are a wrapper around a pointer, but due to WOW64 (32-bit process on 64-bit Windows) compatibility they are always 32-bit values that can safely be truncated, then sign-extended back. Unfortunately Microsoft does not supply a safe-truncation macro. https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203%28v=vs.85%29.aspx Also a few uncommented warning-disables in common.gypi were commented. Setting NOTRY=true because the change is hitting timeouts. See crbug.com/567377 and comment #119 for details. NOTRY=true BUG=440500 Review URL: https://codereview.chromium.org/1422773008 Cr-Commit-Position: refs/heads/master@{#364264}
* clang/win: Let some chromium_code targets build with -Wextra.thakis2015-12-1011-86/+87
| | | | | | | | | | | | | | | | | | | To make warning flags between Windows and non-Windows clang consistent, I'd like to build chromium_code targets with -Wextra enabled. This fixes -Wextra warnings in about 14k of 31k build steps. Most of the warnings were about signed/unsigned mismatches; some were about "const"s that had no effect. (This CL does not contain the change to actually turn on -Wextra, only cleanups.) BUG=567877 TBR=content/common/sandbox Review URL: https://codereview.chromium.org/1507413003 Cr-Commit-Position: refs/heads/master@{#364232}
* Remove kuint32max.avi2015-12-041-2/+5
| | | | | | | | BUG=138542, 488550 Review URL: https://codereview.chromium.org/1492403002 Cr-Commit-Position: refs/heads/master@{#363309}
* Remove old C++03 move emulation code.dcheng2015-12-011-9/+7
| | | | | | | | | | | Chrome allows the use of C++11 features now, so just use rvalue references directly. BUG=543901 Review URL: https://codereview.chromium.org/1407443002 Cr-Commit-Position: refs/heads/master@{#362394}
* Switch to static_assert in base/.avi2015-11-245-8/+11
| | | | | | | | BUG=442514 Review URL: https://codereview.chromium.org/1467003002 Cr-Commit-Position: refs/heads/master@{#361337}
* Make vector_as_array use std::vector::data and switch a few directories.davidben2015-11-192-4/+3
| | | | | | | | | | | Get //base and //crypto. This revealed an IWYU problem in //components/policy, so go and convert that too. BUG=556678 Review URL: https://codereview.chromium.org/1441543002 Cr-Commit-Position: refs/heads/master@{#360639}
* Do not use FAILED macro when checking return value for Registry APIs.wfh2015-11-081-2/+2
| | | | | | | | BUG=552819 Review URL: https://codereview.chromium.org/1426673011 Cr-Commit-Position: refs/heads/master@{#358543}
* Unify logic for "does chrome support metro on this Windows version".gab2015-11-022-0/+9
| | | | | | | | | | | | | Figured we'd want to unify places we have logic for this after http://crrev.com/356988. Also clarified check for |relaunch_mode| in upgrade_util_win based on the CL it was introduced in (http://crrev.com/292464). BUG=548965 Review URL: https://codereview.chromium.org/1427123002 Cr-Commit-Position: refs/heads/master@{#357363}
* Add scottmg and jschuh as base/win ownersjschuh2015-10-271-0/+2
| | | | | | Review URL: https://codereview.chromium.org/1418423006 Cr-Commit-Position: refs/heads/master@{#356387}
* Set modifier flags for Caps, OS, Scroll and Num Lock on X11 and Windows.dtapuska2015-10-202-31/+0
| | | | | | | | | | Adjust the bit translation functions to ensure the values are set correctly on the WebInputEvent. Add support for querying the values from the native OS on Windows. Collapse duplicated code in the Windows event builder to query active key states. BUG=265458 Review URL: https://codereview.chromium.org/1372253005 Cr-Commit-Position: refs/heads/master@{#355170}
* Reverted how taskbar pinning works.pmonette2015-10-162-140/+22
| | | | | | | | | | | | | | | | The change was causing Chrome to chrash when pinning shortcuts because because of third-party shell extensions (See bug). Also removed the unused start menu pinning in Windows 10. Previous CLs: Changing pin to taskbar crrev.com/1193363003 Adding pin to start menu crrev.com/1242763002 BUG=540710 Review URL: https://codereview.chromium.org/1402003002 Cr-Commit-Position: refs/heads/master@{#354621}
* Adding error handlers to setup.exe.pmonette2015-10-162-0/+81
| | | | | | | | | | | | | The handlers make setup crash cleanly when we run out of memory, on heap corruption and on invalid parameters in the CRT. Moved 2 functions from startup_helper_win to base target. Renamed startup_helper_win to sandbox_helper_win now that it contains only a function related to the sandbox. BUG=530624 Review URL: https://codereview.chromium.org/1387963006 Cr-Commit-Position: refs/heads/master@{#354591}
* Disable ETW EnableDisable testbrucedawson2015-10-071-1/+2
| | | | | | | | | | | Despite multiple fixes this test is still flaky. Disabling. TBR=danakj@chromium.org BUG=525297,534184 Review URL: https://codereview.chromium.org/1385123002 Cr-Commit-Position: refs/heads/master@{#352875}
* win: Remove uses of UNREFERENCED_PARAMETER.thakis2015-10-063-62/+42
| | | | | | | | | | | | | | | | | We don't build with warnings on unused parameters enabled, and almost none of the code in src/ annotates unused parameters. Since the Windows system header definition of UNREFERENCED_PARAMETERs is implemented in a way that clang's Wunused-value warns on, just remove the few uses of that macro. While here, also fix most `git cl lint` complaints about the files I touched. No intended behavior change. BUG=505318 Review URL: https://codereview.chromium.org/1374483003 Cr-Commit-Position: refs/heads/master@{#352479}
* Remove all Windows Window Scoped Trackers and Associated Instrumentationrobliao2015-09-291-1/+0
| | | | | | | | | | | | The jank dashboard shows that there is nothing actionable remaining to do here. The sampling profiler should be able to supersede any manual tracking should we need to investigate future jank. BUG=440919 Review URL: https://codereview.chromium.org/1370993003 Cr-Commit-Position: refs/heads/master@{#351254}
* Extend base::win::ObjectWatcher to watch an event multiple times.jam2015-09-294-47/+118
| | | | | | | | | | This is split off from https://codereview.chromium.org/1350023003/. During performance testing, it was found that it was 5x faster to watch an auto-reset event once instead of a manual-reset event every time it fired. BUG=478251 Review URL: https://codereview.chromium.org/1366093006 Cr-Commit-Position: refs/heads/master@{#351240}
* Don't wait for ETW controller.Stop() on Windows 7brucedawson2015-09-252-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows 7 the ControlTrace() function with EVENT_TRACE_CONTROL_STOP, called by EtwTraceController::Stop, does not call the callback function. This means that calling WaitForCallback() will hang on Windows 7, and enable_level() and enable_flags() will never return zero. This was hidden initially because there was no WaitForCallback after the Register call so that the test usually passed on Windows 8, but had a race condition. On Windows 7 the test usually didn't run due to E_ACCESSDENIED due to the user not being in the Performance Log Users group which is why it didn't fail there. The test is now hanging sometimes on Windows 7. Since this change should fix the test it also reenables it. This change also avoids stopping tracing in the EtwTraceController destructor if tracing is not running, to avoid confusing failures. R=danakj@chromium.org BUG=525297 Review URL: https://codereview.chromium.org/1358763003 Cr-Commit-Position: refs/heads/master@{#350878}
* Base: Remove myself from ownersrvargas2015-09-241-1/+0
| | | | | | | | | TBR=thestig@chromium.org BUG= Review URL: https://codereview.chromium.org/1371513003 Cr-Commit-Position: refs/heads/master@{#350695}
* Disable EtwTraceControllerTest.EnableDisable againbrucedawson2015-09-211-1/+1
| | | | | | | | | | | | Spelling counts. DISABLE_ doesn't work as well as DISABLED_. Tested correctly this time to make sure it is actually disabled. R=danakj@chromium.org BUG=525297,534184 Review URL: https://codereview.chromium.org/1357733007 Cr-Commit-Position: refs/heads/master@{#349958}
* Switch from std::move to Pass()brucedawson2015-09-191-1/+1
| | | | | | | | | | | | dcheng pointed out that the test uses std::move in contravention of our C++ 11 style guidelines. Removed. R=rvargas@chromium.org BUG=528394 Review URL: https://codereview.chromium.org/1352433004 Cr-Commit-Position: refs/heads/master@{#349824}
* Disable EtwTraceControllerTest.EnableDisablebrucedawson2015-09-191-1/+2
| | | | | | | | | | | | This test is hanging on some Windows 7 machines and the fix is not obvious. Disabling while I investigate. R=danakj@chromium.org BUG=525297 Review URL: https://codereview.chromium.org/1358583004 Cr-Commit-Position: refs/heads/master@{#349818}
* Revert of Check for CloseHandle failures even when not debugging (patchset ↵brucedawson2015-09-181-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #4 id:60001 of https://codereview.chromium.org/1350493002/ ) Reason for revert: The SharedMemory checks are causing CHECK crashes in the printing system. See bug 533310. Reverting to allow time for an investigation of that underlying problem. Original issue's description: > Check for CloseHandle failures even when not debugging > > Bug 524267 was a handle closing failure that only showed up when running > renderer processes under a debugger at startup, so it was not discovered > for a while. > > Similarly, bug 520305 is a long-standing base_unittests bug that only > shows up under a debugger. > > This change fixes 520305 and checks for many handle closing failures > always so that subsequent bugs of this type will be detected > immediately. > > Most of the CloseHandle calls in base are now checked. > > This replaces the uncommitted https://codereview.chromium.org/1343873002/ > > R=grt@chromium.org,rvargas@chromium.org,dalecurtis@chromium.org > BUG=524267,520305 > > Committed: https://crrev.com/9ae49a753d07f5a9266a63a89e7336d774f3fe37 > Cr-Commit-Position: refs/heads/master@{#349333} TBR=dalecurtis@chromium.org,grt@chromium.org,rvargas@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=524267,520305 Review URL: https://codereview.chromium.org/1356743003 Cr-Commit-Position: refs/heads/master@{#349716}
* Remove HANDLE_FLAG_PROTECT_FROM_CLOSE flag from Tracked/ScopedHandle.rvargas2015-09-171-15/+0
| | | | | | | | | | | | | | | | This reverts most of https://crrev.com/c928d34ee861fd4102c352d9e79e1a4959a47209 (refs/heads/master@{#329516}). There is a strong suspicion that this flag is causing a lot of extra crashes. In any case, the change caused the handle verifier to be enabled for all channels, which was not really intended (not desired). BUG=475872 TBR=grt@chromium.org Review URL: https://codereview.chromium.org/1355703002 Cr-Commit-Position: refs/heads/master@{#349531}
* Fix possibly flakiness of EtwTraceControllerTest.EnableDisablewangxianzhu2015-09-171-0/+3
| | | | | | | | | | | | | | | | | | | The last provider.WaitForCallback() returns immediately because the callback event of the previous controller.EnableProvider() has not been consumed. If controller.Stop() is asynchronous, the last two EXPECT_EQs will fail. Add a provider.WaitForCallback() call before controller.Stop() to consume the previous callback event. Found this because https://codereview.chromium.org/1345223004/ mysteriously caused failure of the test. BUG=525297 Review URL: https://codereview.chromium.org/1353893003 Cr-Commit-Position: refs/heads/master@{#349523}
* Check for CloseHandle failures even when not debuggingbrucedawson2015-09-171-20/+14
| | | | | | | | | | | | | | | | | | | | | | | | Bug 524267 was a handle closing failure that only showed up when running renderer processes under a debugger at startup, so it was not discovered for a while. Similarly, bug 520305 is a long-standing base_unittests bug that only shows up under a debugger. This change fixes 520305 and checks for many handle closing failures always so that subsequent bugs of this type will be detected immediately. Most of the CloseHandle calls in base are now checked. This replaces the uncommitted https://codereview.chromium.org/1343873002/ R=grt@chromium.org,rvargas@chromium.org,dalecurtis@chromium.org BUG=524267,520305 Review URL: https://codereview.chromium.org/1350493002 Cr-Commit-Position: refs/heads/master@{#349333}
* Added common check for USER32 and GDI32 API availability.forshaw2015-09-162-0/+51
| | | | | | | | | | | | | | | | This CL adds a check function to base to allow code to check if the USER32 and GDI32 API calls are available. Windows 8 and above allow an application to disable these API calls for security reasons and fallback when calling the API isn't consistent (such as returning error codes instead of handles). This can lead to undefined behaviour if code calls into these APIs while they are disabled. This check can be used to guard calls to these APIs and fallback if appropriate. BUG=523278 Review URL: https://codereview.chromium.org/1351513002 Cr-Commit-Position: refs/heads/master@{#349237}
* Get GenericScopedHandle::Set to preserve LastError codebrucedawson2015-09-112-1/+40
| | | | | | | | | | | | | | | | | | Code like this is elegant and clean and common in Chrome: event_.Set(CreateEvent(NULL, FALSE, FALSE, wname.c_str())); if (event_.Get() && GetLastError() != ERROR_ALREADY_EXISTS) { However it will behave incorrectly if event_.Set() zeroes out the Windows LastError code, which VC++ 2015 frequently does. This change avoids that. R=rvargas@chromium.org BUG=528394,529981,440500 Review URL: https://codereview.chromium.org/1320673016 Cr-Commit-Position: refs/heads/master@{#348324}
* Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.gab2015-07-272-8/+49
| | | | | | | | | BUG=503682 TBR=thakis@chromium.org (for method rename having side-effects in chrome/browser/ui and base/). Review URL: https://codereview.chromium.org/1242763002 Cr-Commit-Position: refs/heads/master@{#340493}
* win: Fix unqualified lookups into dependent base classes.thakis2015-07-141-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++ differentiates between dependent and non-dependent lookups. Dependent lookups depend on a template parameter and are resolved at end-of-translation unit, when templates are instantiated. Non-dependent ("normal") lookups are done immediately. If a class has a template superclass and tries to access a member from the parent, then if this is written "ptr_", it looks like a non-dependent lookup to the compiler, but since the superclass is a template and not instantiated yet, the lookup wouldn't find anything. (This is a bit handwavy.) Hence, the standard requires to make it clear to the compiler that ptr_ is a dependent lookup. This can be done by prefixing it with "T::" or something similar that's obviously dependent on the template parameter, or with "this->" (this implicitly depends on T). cl.exe doesn't implement this rule, so clang-cl also looks the other way and tries to make things work, but it's not strictly standards-conformant. This CL fixes that. No intended behavior change. See http://eli.thegreenplace.net/2012/02/06/dependent-name-lookup-for-c-templates for more details. Fixes several warnings that look like ..\..\sandbox\win\src\service_resolver_unittest.cc(46,5) : warning(clang): use of undeclared identifier 'target_'; unqualified lookup into dependent bases of class template 'ResolverThunkTest' is a Microsoft extension [-Wmicrosoft] target_ = fake_target_; ^ this-> BUG=504657 Review URL: https://codereview.chromium.org/1237533002 Cr-Commit-Position: refs/heads/master@{#338616}
* Check Windows version before attempting to detect OSKjschuh2015-07-121-0/+5
| | | | | | | | | | | Fixes a crash on delay load failure for older Windows versions. BUG=507490,491516 TBR=grt Review URL: https://codereview.chromium.org/1229103003 Cr-Commit-Position: refs/heads/master@{#338457}
* clang/win: Fix warnings to prepare for building without -Wno-reorder.sammc2015-07-021-2/+2
| | | | | | | | | | | | | This changes constructor initializer list ordering to match field declaration ordering, except for gtest and breakpad, where the warning is disabled. BUG=505304 NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1210013007 Cr-Commit-Position: refs/heads/master@{#337152}
* Fix some clang warnings with -Wmissing-braces in base.dcheng2015-07-023-5/+7
| | | | | | | | | | | | | | | | Clang warns if there are missing braces around a subobject initializer. The most common idiom that triggers this is: STRUCT s = {0}; if the first field of STRUCT is itself a struct. This can be more simply written as: STRUCT s = {}; which also prevents the warning from firing. BUG=505297 Review URL: https://codereview.chromium.org/1218243002 Cr-Commit-Position: refs/heads/master@{#337139}
* Fix use of ShellDispatch.NameSpace -- may succeed but fail.grt2015-06-301-4/+4
| | | | | | | | | | | It returns S_FALSE (which isn't a failure) when the Folder can't be created. Handle this by checking for the absence of the folder. BUG=498383 Review URL: https://codereview.chromium.org/1217003002 Cr-Commit-Position: refs/heads/master@{#336775}
* clang/win: Build without -Wno-null-dereference.sammc2015-06-301-1/+1
| | | | | | | | BUG=505300 Review URL: https://codereview.chromium.org/1216903002 Cr-Commit-Position: refs/heads/master@{#336717}
* Add USB keyboard detection reporting and disable flagjschuh2015-06-232-19/+66
| | | | | | | | | | | | | Some users are having keyboards falsely detected, so this CL provides them a workaround flag and lists the detection data in chrome://system for debugging purposes BUG=491516 NOTRY=TRUE Review URL: https://codereview.chromium.org/1191303003 Cr-Commit-Position: refs/heads/master@{#335662}
* Pin shortcuts via shell verbs rather than ShellExecuteEx.grt2015-06-232-10/+95
| | | | | | | | | | BUG=498383 TEST=Chrome's icon is pinned to the taskbar upon install on Win7, 8, 8.1, and 10. TBR=sky@chromium.org Review URL: https://codereview.chromium.org/1193363003 Cr-Commit-Position: refs/heads/master@{#335630}
* Write new Starts/EndsWith and convert FilePath functions to StringPiece.brettw2015-06-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | When I moved StartsWith and EndsWith to the base namespace it became apparent that the bool parameter was frequently a source of confusion, and that the second argument is almost always a constant that we then convert to a string. This adds new versions of StartsWith/EndsWith that takes an enum for case sensitivity and string pieces for the string inputs. The existing functions used a locale-dependent case insensitive comparison that is marked with an old bug number that such comparisons are probably wrong. With this change, I moved the case insensitive comparisons to ASCII ones. Only callers in base are updated. The rest of the calls go through a compatibility layer. The compatibility layer keeps the local-dependent compares for the 16-bit string comparisons to avoid breaking things subtly. There are relatively few calls to the 16-bit version, and most use constants for the prefix/suffix (which wouldn't be affected by the locale), so there should be few callers to audit in a later pass to go to pure ASCII comparisons. The 8-bit versions now always use the ASCII case-insensitive comparisons. This should be the only change in this patch that can affect the behavior of the program. Code doing locale-dependent 8-bit tolower() calls (what the old code ended up doing) is almost certainly wrong. UTF-8 strings will be mangled. The only 8-bit non-UTF-8 strings we have are typically Posix file paths and Posix file paths are case-sensitive. I'm not very concerned about regressions from this change. Use StringPiece in FilePath for input arguments. This wasn't done before because we had no StringPiece16 until more recently. Constants are frequently passed as input to some of the functions, especially Append, so this will save some string allocations. Unfortunately, this is more likely to affect unit tests that the real browser. This is combined with the StartsWith/EndsWith changes because I started changing FilePath when updating its use of StartsWith. The FilePath changes should have no observable effect on the product. BUG=24917 Review URL: https://codereview.chromium.org/1182453004 Cr-Commit-Position: refs/heads/master@{#334555}
* Move StartsWith[ASCII] to base namespace.brettw2015-06-121-29/+27
| | | | | | | | | NOPRESUBMIT=true (no presubmit due to removing base:: from a ScopedAllowIO) Review URL: https://codereview.chromium.org/1172183002 Cr-Commit-Position: refs/heads/master@{#334108}
* Remove Unactionable or Low Jank USER32 Instrumentationrobliao2015-06-021-4/+0
| | | | | | | | | | USER32 calls generally do not have an SLA on returning promptly. They do however, generally need to be called on the thread that created the hwnd. There's not much we can do with these calls. BUG=470226 Review URL: https://codereview.chromium.org/1163863003 Cr-Commit-Position: refs/heads/master@{#332322}
* Avoid basename conflict from memory_pressure_monitor.ccscottmg2015-05-213-696/+0
| | | | | | | | | | | | | | | | | | This is a mechanical rename from subdirs into memory/ with _platform suffixes instead. This avoids having duplicate basenames. It would probably be better to have only memory/memory_pressure_monitor.h and then _win.cc, _mac.cc, _chromeos.cc implementations, but that's a more invasive change because of the slightly different interfaces/members. TBR=jam@chromium.org, oshima@chromium.org R=thakis@chromium.org, chrisha@chromium.org BUG=490824, gyp:384,472772 Review URL: https://codereview.chromium.org/1149223002 Cr-Commit-Position: refs/heads/master@{#331006}
* Cleanup: Fix base header include guards.tfarina2015-05-132-4/+4
| | | | | | | | | | | | | | | | The header include guards should match the file path from root. These entries were found using a modified version of Eric's fix-include-guards.py script found attached in https://code.google.com/p/chromium/issues/detail?id=435361#c7. BUG=435361 TEST=base_unittests R=danakj@chromium.org Review URL: https://codereview.chromium.org/1137323003 Cr-Commit-Position: refs/heads/master@{#329731}
* Add HANDLE_FLAG_PROTECT_FROM_CLOSE flag to Tracked/ScopedHandle.shrikant2015-05-121-0/+15
| | | | | | | | | | | | | | | Idea here is to try and protect our scoped handles so that any third party close/accidental close could be some what restricted. Besides adding flag following changes are in this CL. 1. While launching test process (Python executable), we pass it a pipe handle which we add it to ScopedHandle before passing, this marked handle as protected, now when we let python process inherit that handle, python process cannot close it and throws exception. We now duplicate handle without protection and then pass it onto python process and let host process continue with protected scoped handle. 2. Other change is related to disabling of active verifier dynamically. If ActiveVerifier gets invoked before disabling it (because someone used scoped handle before instruction pointer reached to UseHooks/InstallCloseHandleHooks) then it protects handle from closing. If now we disable ActiveVerifier when scoped handle goes out of scope, it tries to stop tracking handle, but in this case as active verifier got disabled later, that particular handle remains protected. Now we don't disable active verifier dynamically, but just decide on setting up of CloseHandleHook based on certain parameters. BUG=475872 R=cpu@chromium.org,rvargas@chromium.org Review URL: https://codereview.chromium.org/1113063004 Cr-Commit-Position: refs/heads/master@{#329516}