summaryrefslogtreecommitdiffstats
path: root/base/tuple.h
Commit message (Collapse)AuthorAgeFilesLines
* base: eliminate TupleTraits and TupleTypesmdempsky2016-03-071-37/+0
| | | | | | | | | | | | | The only remaining use of these were base::TupleTypes<T>::ValueTuple, which just maps Tuple<Ts...> to Tuple<remove_reference_t<Ts>...>. However, all of the uses were for reference-free tuples, making it a noop. BUG=554987 Review URL: https://codereview.chromium.org/1768153002 Cr-Commit-Position: refs/heads/master@{#379667}
* Remove UnwrapTraitstzik2016-02-161-4/+3
| | | | | | | | | | | Remove UnwrapTraits::ForwardType, which is no longer used, and extract UnwrapTraits::Unwrap to be non member function. BUG=554299 Review URL: https://codereview.chromium.org/1698223002 Cr-Commit-Position: refs/heads/master@{#375576}
* Support smart pointers in base::DispatchToMethodtzik2016-02-161-4/+4
| | | | | | | | | | | * Make base::DispatchToMethod to accept smart pointers as the this pointer * Remove base::internal::UnwrapTraits from //storage code BUG=554299 Review URL: https://codereview.chromium.org/1696093002 Cr-Commit-Position: refs/heads/master@{#375516}
* Replace base::Tuple implementation with std::tupletzik2016-02-111-52/+3
| | | | | | | | | | | * Remove base::Tuple and make base::Tuple as an alias of std::tuple. * Expand the alias where it's used in a class template specialization to avoid MSVC2013 internal compiler error. BUG=554987 Review URL: https://codereview.chromium.org/1673563002 Cr-Commit-Position: refs/heads/master@{#374878}
* Switch to standard integer types in base/.avi2015-12-261-0/+3
| | | | | | | | | | BUG=138542 TBR=mark@chromium.org NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1538743002 Cr-Commit-Position: refs/heads/master@{#366910}
* Remove unused Tuple dispatch functionsmdempsky2015-12-181-33/+0
| | | | | | Review URL: https://codereview.chromium.org/1535643002 Cr-Commit-Position: refs/heads/master@{#365951}
* Mark base::Tuple as finaltzik2015-11-181-2/+2
| | | | | | | | | | | | Extending tuple confuses the compiler when we replace base::Tuple with std::tuple. This CL removes a base::Tuple extension and forbids it. BUG=554987 Review URL: https://codereview.chromium.org/1462443002 Cr-Commit-Position: refs/heads/master@{#360404}
* Move Tuple to base namespace.brettw2015-05-291-3/+7
| | | | | | | | | | | | | | Namespace change only, no functionality change. The only non-search-and-replace change is in generate_gmock_mutant.py which changes some line wrapping logic for the generated gmock_mutant header. NOPRESUBMIT=true (No presubmit due to long lines in the generated gmock_mutant.h header). R=sky Review URL: https://codereview.chromium.org/1159553007 Cr-Commit-Position: refs/heads/master@{#332058}
* Cleanup: Fix base header include guards.tfarina2015-05-131-3/+3
| | | | | | | | | | | | | | | | 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}
* Extend variadic template hack for /analyze.brucedawson2015-04-201-0/+6
| | | | | | | | | | | | | | | | | | | | A recent Chrome change broke the /analyze builder by using a larger Tuple than had been allowed for in the previous VC++ bug workaround. This change unblocks the /analyze builder and will not affect /analyze builds. The /analyze error is: e:\b\build\slave\chromium_windows_analyze\build\src\base\tuple.h(99) : error C2027: use of undefined type 'MakeIndexSequenceImpl<0xc>' e:\b\build\slave\chromium_windows_analyze\build\src\device\usb\usb_device_handle_impl.cc(608) and came from https://codereview.chromium.org/980023002 R=thakis@chromium.org BUG=427616 Review URL: https://codereview.chromium.org/1095543003 Cr-Commit-Position: refs/heads/master@{#325877}
* Avoid a /analyze internal compiler error with MakeIndexSequencebrucedawson2015-01-211-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | The recently added MakeIndexSequence templates cause a VC++ internal compiler error when building with /analyze. This happens on dozens of source files so disabling /analyze for those files is impractical. This change conditionally replaces the template recursion with a straightforward implementation for values from zero to five. This is sufficient to build Chrome at the moment. The code which VC++ doesn't like was introduced in change: https://codereview.chromium.org/693693005 It's an ugly fix, but justified by the desire to allow running /analyze. The /analyze version of the code will never be run. A VC++ bug has been filed: https://connect.microsoft.com/VisualStudio/feedback/details/1053626 BUG=427616 Review URL: https://codereview.chromium.org/803183004 Cr-Commit-Position: refs/heads/master@{#312469}
* Revert of Revert "Update legacy Tuple-using code." (patchset #1 id:1 of ↵avi2014-12-231-65/+0
| | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/826573002/) Reason for revert: The tests should have failed with this. Undoing the revert. Original issue's description: > Revert "Update legacy Tuple-using code." > > This reverts commit 12f4b98357b9dedc93cb546aac0aece2c8d9e850 > > BUG=440675, 444827 > > Committed: https://chromium.googlesource.com/chromium/src/+/85748694f2a119a057088f77f70b97f11607473c TBR= NOTREECHECKS=true NOTRY=true BUG=440675, 444827 Review URL: https://codereview.chromium.org/794073003 Cr-Commit-Position: refs/heads/master@{#309586}
* Revert "Update legacy Tuple-using code."Avi Drissman2014-12-231-0/+65
| | | | | | | | | | This reverts commit 12f4b98357b9dedc93cb546aac0aece2c8d9e850 BUG=440675, 444827 Review URL: https://codereview.chromium.org/826573002 Cr-Commit-Position: refs/heads/master@{#309583}
* Update legacy Tuple-using code.Avi Drissman2014-12-221-65/+0
| | | | | | | | | | | BUG=440675 TEST=no change R=mdempsky@chromium.org, thakis@chromium.org TBR=ben@chromium.org Review URL: https://codereview.chromium.org/821453003 Cr-Commit-Position: refs/heads/master@{#309441}
* tuple: leave fields uninitialized in default constructorsmdempsky2014-12-151-2/+2
| | | | | | | | | | | | | | Using "x()" in TupleLeaf's default constructor causes primitive types (e.g., integers and pointers) to be zero initialized, whereas previously Tuple left them indeterminate. Arguably zero-initializing is better, but the change was inadvertant and results in a measurable code size increase, so this CL reverts it (at least for now). BUG=440806 Review URL: https://codereview.chromium.org/791883003 Cr-Commit-Position: refs/heads/master@{#308455}
* tuple: further generalize/simplify Tuple implementationmdempsky2014-12-101-285/+75
| | | | | | | | | | | | | | | | | Instead of specially implementing Tuple for 0 to 8 arguments, use a more traditional implementation by having Tuple<A, B, ...> inherit from TupleLeaf<0, A>, TupleLeaf<1, B>, etc. This allows Tuple to be used with an arbitrary number of arguments. To remain backwards compatible with code that accesses "t.a", "t.b", etc., we specialize TupleLeaf for the first 8 elements to store their values in appropriately named member variables. These accessors work even for Tuples with more than 8 elements, but the 9th element and beyond are only supported with get<N>(). Review URL: https://codereview.chromium.org/792763002 Cr-Commit-Position: refs/heads/master@{#307681}
* tuple: update to make use of C++11mdempsky2014-12-101-1036/+300
| | | | | | | | | | | | | | | | | | | This CL adds a generic variadic Tuple class that generalizes Tuple1, Tuple2, etc. It also adds the C++11-style get<N>(tuple) method for accessing tuple members. As a demonstration, the DispatchToFunction() and DispatchToMethod() functions have been updated to make use of these and became substantially shorter. However, to remain compatible with existing code that accesses Tuple fields by name, the Tuple class is actually implemented via multiple specializations that match the TupleN classes that used to exist. Once all access to foo.a, bar->b, ... have been updated to get<0>(foo), get<1>(*bar), ... then we can simplify Tuple further and eventually replace it with std::tuple. Review URL: https://codereview.chromium.org/693693005 Cr-Commit-Position: refs/heads/master@{#307629}
* Have DispatchToMethod use base::internal::UnwrapTraits when dispatchingrsleevi@chromium.org2013-06-271-60/+300
| | | | | | | | | | | | | | | | When dispatching, have base::DispatchToMethod/DispatchToFunction use the base::internal::UnwrapTraits<> to properly unwrap the base::Tuple's wrapped argument. This ensures that methods that expect a "T*" can be properly dispatched when the tuple contains a scoped_refptr<T> without relying on implicit conversions. BUG=110610 Review URL: https://chromiumcodereview.appspot.com/17911007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208903 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the rest of #pragma once in one big CL.ajwong@chromium.org2012-07-111-1/+0
| | | | | | | | | For context see this thread: https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-dev/RMcVNGjB4II TBR=thakis,pkasting,jam git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146163 0039d316-1c4b-4281-b951-d872f2087c98
* Remove chromeos specific debug code from tuple.hoshima@chromium.org2011-09-281-5/+1
| | | | | | | | | | | | This should have been removed as a part of 71680, but seems like I overlooked it. BUG=7327 TEST=none Review URL: http://codereview.chromium.org/8037050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103063 0039d316-1c4b-4281-b951-d872f2087c98
* Intergration of the client-side phishing detection.noelutz@google.com2011-02-171-0/+7
| | | | | | | | | | | | | | | If the client-side phishing detection classifies a page as phishing it will send back a ping to Google to verify whether or not the page is really phishing. If the server also classifies the site as phishing we may show a phishing interstitial if it is enabled. BUG= TEST= Review URL: http://codereview.chromium.org/6014003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75299 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Adding CHECKs to troubleshoot the crash issue ..."oshima@google.com2011-01-181-7/+0
| | | | | | | | | | | | | Revert "Adding CHECKs to troubleshoot the crash issue intuple.h/browser_render_process_host.cc (see bug description)" This reverts commit 29801f4598cf1a605c6e1a7b0295e0ac29f27b59. BUG=chromium-os:7327 TEST=none Review URL: http://codereview.chromium.org/6323003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71680 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate 'if defiend(CHECK) to avoid having to different binaries for the ↵oshima@chromium.org2010-12-021-1/+5
| | | | | | | | | | | | | | | same template function. There is a new crash report but not caught by the CHECKS. (http://crash/reportdetail?reportid=accf4c24431527ce#crashing_thread) This could be because this ifdef generates two different objects of this template function and linker may be picking bad one. BUG=chromium-os:7327 TEST=none Review URL: http://codereview.chromium.org/5405003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67913 0039d316-1c4b-4281-b951-d872f2087c98
* Adding CHECKs to troubleshoot the crash issue ↵oshima@chromium.org2010-11-101-0/+7
| | | | | | | | | | | | | intuple.h/browser_render_process_host.cc (see bug description) This is chromeos only and will be removed once I correct data. BUG=chromium-os:7327 TEST=none Review URL: http://codereview.chromium.org/4752003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65729 0039d316-1c4b-4281-b951-d872f2087c98
* Reapplies all the IPC system work (reverts the revert r56272).erg@google.com2010-08-171-108/+156
| | | | | | | | | | | That patch wasn't what caused the regression in the page cycler. BUG=51411,52103 TEST=still compiles Review URL: http://codereview.chromium.org/3106018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56390 0039d316-1c4b-4281-b951-d872f2087c98
* Completely revert all my IPC work to see if this was what regressed the page ↵erg@google.com2010-08-171-156/+108
| | | | | | | | | | | cycler. BUG=51411,52103 TEST=page cycler Review URL: http://codereview.chromium.org/3170020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56272 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Reapplies r55259, the first new IPC definition patch.erg@google.com2010-08-101-108/+156
| | | | | | | | | | | | | This moves MessageWithTuple::Read() back into the main ipc_message_utils.h header from the private ipc_messsage_utils_impl.h header. In release mode, this was causing link failures. BUG=51411 TEST=none Review URL: http://codereview.chromium.org/3069034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55587 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 55259 - FBTF: New IPC definitions, only applied to async ROUTED and ↵pinkerton@google.com2010-08-091-156/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONTROL messages. The slowest cc files in chrome include render_messages.h and other IPC message definitions. Including one of these files will bring in half of chrome because in the IPC system previously required full class definitions due to implementation details. The new system allows forward declarations and places the implementations of functions that need the full class definitions (ctor/dtor()/Log() and superclass ctor/Read() methods) into a separate xxx_messages.cc file using a parallel set of macros to ipc_message_macros.h. This has the added benefit of moving most of the template instantiation junk into a small number of files. Pros: - Will speed up compiling by a lot once everything is forward declared. - Already, intermediary .o/.a files are smaller. Cons: - Adds a 4th pass to the messages system, this time in a different header. BUG=51411 TEST=none Review URL: http://codereview.chromium.org/2873090 TBR=erg@google.com Review URL: http://codereview.chromium.org/3080040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55406 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: New IPC definitions, only applied to async ROUTED and CONTROL messages.erg@google.com2010-08-061-108/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The slowest cc files in chrome include render_messages.h and other IPC message definitions. Including one of these files will bring in half of chrome because in the IPC system previously required full class definitions due to implementation details. The new system allows forward declarations and places the implementations of functions that need the full class definitions (ctor/dtor()/Log() and superclass ctor/Read() methods) into a separate xxx_messages.cc file using a parallel set of macros to ipc_message_macros.h. This has the added benefit of moving most of the template instantiation junk into a small number of files. Pros: - Will speed up compiling by a lot once everything is forward declared. - Already, intermediary .o/.a files are smaller. Cons: - Adds a 4th pass to the messages system, this time in a different header. BUG=51411 TEST=none Review URL: http://codereview.chromium.org/2873090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55259 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-261-0/+1
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Download code cleanup:phajdan.jr@chromium.org2010-07-201-0/+90
| | | | | | | | | | | | | | | | | | - choose better names for some helper methods - move code to less random places This change also adds bigger tuples support, up to Tuple8 in base/tuple.h. The plan is to stop using such big number of parameters, but for now it's not trivial. This change also fixes some UI tests, not sure why it is so. TEST=unit_tests, browser_tests, ui_tests BUG=48913 Review URL: http://codereview.chromium.org/2805091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53053 0039d316-1c4b-4281-b951-d872f2087c98
* Style cleanup in preparation for auto-linting base/.erg@google.com2010-01-261-6/+5
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/552004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37164 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent an extra copy of data types that get passed into IPC messages whenmpcomplete@google.com2009-05-201-0/+29
| | | | | | | | | | sending them. This makes it so that types sendable via IPC no longer need copy constructors. BUG=12296 Review URL: http://codereview.chromium.org/112042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16497 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-101-1/+0
| | | | | | | | | Normalize end of file newlines in base/. All files end in a single newline. Review URL: http://codereview.chromium.org/42011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11329 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-4/+12
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Adds the ability for save dialogs to take a default extension.sky@google.com2008-11-121-0/+65
| | | | | | | | | BUG=4287 TEST=see bug Review URL: http://codereview.chromium.org/10621 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5304 0039d316-1c4b-4281-b951-d872f2087c98
* Patch by Thatcher Ulrich <tulrich@google.com>.ojan@google.com2008-10-091-2/+121
| | | | | | | | | | | | | | | Implement "iframe shim" behavior for windowed plugins. In FF and IE on windows, iframes are implemented as native HWNDs. This has the side effect that iframes display on top of windowed plugins. This side effect has long been known as a workaround for allowing HTML elements to appear above plugin content. BUG=1788 Review URL: http://codereview.chromium.org/7032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3137 0039d316-1c4b-4281-b951-d872f2087c98
* Add example usages and tests to scoped_ptr.h and tuple.h.deanm@google.com2008-08-251-0/+24
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1305 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* A small fixup to a comment that was over 80 cols.deanm@google.com2008-08-211-3/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1149 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+687
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98