summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_tests.cc
Commit message (Collapse)AuthorAgeFilesLines
* Switch to TimeDelta interfaces for process waiting functions in net and ipc.tedvessenes@gmail.com2012-07-111-4/+8
| | | | | | | | | | R=agl@chromium.org BUG=108171 Review URL: https://chromiumcodereview.appspot.com/10692155 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146124 0039d316-1c4b-4281-b951-d872f2087c98
* Remove Message::Sender and Channel::Listener typedefs.brettw@chromium.org2012-06-291-4/+4
| | | | | | | | | | | This patch fixes the remaining users to use the new names for these classes. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10698057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145005 0039d316-1c4b-4281-b951-d872f2087c98
* Make GlobalDescriptors::MaybeGet return -1 when the key is not found.jcivelli@chromium.org2012-06-271-2/+3
| | | | | | | | | | BUG=None TEST=Unit tests should still pass. Review URL: https://chromiumcodereview.appspot.com/10387218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144350 0039d316-1c4b-4281-b951-d872f2087c98
* Separate out IPC::Message::Sender and Channel::Listener into a separate class.brettw@chromium.org2012-06-111-5/+6
| | | | | | | | | | | | | I fixed the places that did IPC::Channel::Sender (I don't even know how this compiled, but I presume this means the "Sender" base class of the "Channel" which ends up being right). We can fix the other users of this later. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10541065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141534 0039d316-1c4b-4281-b951-d872f2087c98
* Disable IPCChannelTest.SendMessageInChannelConnected on Windows for being ↵danakj@chromium.org2012-05-241-1/+7
| | | | | | | | | | | | flakey. BUG=129595 TEST= TBR=jeremy@chromium.org Review URL: https://chromiumcodereview.appspot.com/10440023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138834 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor Pickle Read methods to use higher performance PickleIterator.jbates@chromium.org2012-03-071-1/+1
| | | | | | | | | | | | | | | | There was a lot of redundant error checking and initialization code in all Pickle Read methods because of the void** iterator type. This change replaces the void* iterator with PickleIterator, which encapsulates the read pointer so that less error checking and initialization code is needed for reading. PickleIterator has all the necessary data to do the actual reading. The advantage of having it provide Read methods (as opposed to leaving them solely in the Pickle interface) is that the callers do not need to pass around the const Pickle* once they have a PickleIterator. Followup CLs will refactor the call sites to remove const Pickle* arguments where they are now unnecessary. Then the Pickle::Read* methods can be removed entirely. The alternative approach would have been to change the Pickle::Read methods to non-const and remove the iterator parameter (making Read methods advance an internal read pointer). Unfortunately, the const Read with iterator design is entrenched throughout the chromium code, making this a much more complex change with the same performance outcome. BUG=13108 Review URL: https://chromiumcodereview.appspot.com/9447084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125447 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove base::environment_vector and ↵thestig@chromium.org2012-02-241-2/+3
| | | | | | | | | | | base::file_handle_mapping_vector to StudlyCaps. BUG=none TEST=none Review URL: http://codereview.chromium.org/9429039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123438 0039d316-1c4b-4281-b951-d872f2087c98
* Initialize IPC:ChannelHandle from existing HANDLEamit@chromium.org2012-01-241-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1] Add a ctor to IPC:ChannelHandle that takes a pipe HANDLE. 2] Corresponding change in Channel::ChannelImpl::CreatePipe to attach to the given pipe instead of creating a new one. Being able to hand over a pipe handle to IPC::Channel in this way has other advantages such as using anonymous pipes and safer connections between process with different level of privileges. Here's how it can be done: Server Process: - Create a server pipe, anonymous pipe is fine too. - Server creates a client handle of pipe using CreateFile. - Use DuplicateHandle to duplicate this handle for the client process. - pass over the handle value to the client process, say using comman line. Client process: - Simply receive the handle from the server and hand it over to IPC:Channel using IPC::ChannelHandle. Apart from being more flexible, this is more secure as it removes the 'connection window' while using names. BUG=none TEST=none Review URL: http://codereview.chromium.org/9150030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118786 0039d316-1c4b-4281-b951-d872f2087c98
* Convert use of int ms to TimeDelta in files owned by jeremy.tedvessenes@gmail.com2012-01-131-2/+2
| | | | | | | | | | | R=jeremy@chromium.org BUG=108171 TEST= Review URL: http://codereview.chromium.org/9148039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117557 0039d316-1c4b-4281-b951-d872f2087c98
* This patch caused Chrome to be unable to load any web pages on Chrome OS.satorux@chromium.org2011-08-231-2/+1
| | | | | | | | | | | | | BUG=chromium-os:19468 TEST=confirm chrome loads pages Revert "Fix IPC OnChannelConnected() to send correct PID on Linux/CrOS" This reverts commit 92321e01ba42f2d0e9508e921f8b440ac0b5319f. Review URL: http://codereview.chromium.org/7712022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97811 0039d316-1c4b-4281-b951-d872f2087c98
* Fix IPC OnChannelConnected() to send correct PID on Linux/CrOSjamescook@chromium.org2011-08-191-1/+2
| | | | | | | | | | | | | | | | | | | | Sandboxed renderers on Linux/CrOS are in a PID namespace, so they don't know their own global PID. Thus the PID sent in the IPC channel Hello message contains an unexpected value, which is used in the OnChannelConnected() callback into chrome. This causes problems like the Task Manager not showing any data for FPS, JavaScript memory and image cache memory. The task manager is attempting to use the PID/process handle from BrowserMessageFilter, which got it from IPC::Channel::Listener::OnChannelConnected(), and it doesn't match the global PID of each renderer. BUG=70179 TEST=manual, open a few tabs, then open task manager, right-click to turn on JavaScript memory and image memory. Verify there are non-zero values for FPS, JavaScript memory, image cache memory Review URL: http://codereview.chromium.org/7661004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97481 0039d316-1c4b-4281-b951-d872f2087c98
* Tag IPC::Channel::Listener implementations with OVERRIDEevan@chromium.org2011-08-161-4/+4
| | | | | | Review URL: http://codereview.chromium.org/7661031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97021 0039d316-1c4b-4281-b951-d872f2087c98
* Switch IPC::ChannelProxy to use MessageLoopProxy instead of MessageLoop. ↵jam@chromium.org2011-05-021-1/+1
| | | | | | | | This allows us to remove usage of the IOThread object, and generally makes IPC::ChannelProxy more robust for future uses. Review URL: http://codereview.chromium.org/6901146 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83741 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: fix a bunch of NULL vs. 0 issues spotted by gcc 4.5.craig.schlenter@chromium.org2011-01-131-3/+3
| | | | | | | | | | | | There are more gcc 4.5 issues to be solved so GYP_DEFINES=='werror=' is still required to build with 4.5 even with these changes. BUG=66652 TEST=compiles with gcc 4.5 and trybots Review URL: http://codereview.chromium.org/6186008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71325 0039d316-1c4b-4281-b951-d872f2087c98
* Move base/debug_on_start to base/debugger and rename it to be _win since itbrettw@chromium.org2011-01-011-1/+1
| | | | | | | | | | only does anything on Windows. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/5984007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70362 0039d316-1c4b-4281-b951-d872f2087c98
* Move base/thread.h to base/threading, fix up callers to use the new location.brettw@chromium.org2011-01-011-1/+1
| | | | | | | | TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6028009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70345 0039d316-1c4b-4281-b951-d872f2087c98
* Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ↵jam@chromium.org2010-12-241-5/+9
| | | | | | | | | whether a message was processed or not. TBR=brettw Review URL: http://codereview.chromium.org/5978003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70139 0039d316-1c4b-4281-b951-d872f2087c98
* Add a base class for objects that want to filter messages on the IO thread. ↵jam@chromium.org2010-12-021-1/+1
| | | | | | | | | I'll switch the filters to it in future separate changes. I've also taken out the special case for an initial filter from the IPC classes. The reason it existed was that there was a race condition of some messages not being filtered if a filter is added after construction but before launching the peer process. Taking it out allows us to add more than one filter and makes things a little cleaner. Review URL: http://codereview.chromium.org/5513001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68043 0039d316-1c4b-4281-b951-d872f2087c98
* ipc_channel: warn if someone forgets to check the result of Connect()evan@chromium.org2010-10-191-5/+5
| | | | | | | | I found a test that was doing this. Review URL: http://codereview.chromium.org/3759004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63083 0039d316-1c4b-4281-b951-d872f2087c98
* Move PerfTestSuite implementation into a .cc file and add it to the basebrettw@chromium.org2010-10-101-1/+1
| | | | | | | | | | namespace. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3695001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62095 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land part of r55416, minus actually moving the test_suite.h contents to a ↵brettw@chromium.org2010-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | .cc file. Cleanup in base. This moves the implementation (and a bunch of header file dependencies) from the multiprocess test and the test_suite headers to .cc files. Moves multiprocess_test to the test directory, and all of this stuff to the existing base_test_support project. I also used the base namespace. Previously other projects included this functionality just by #include because it was all inline, so I had to add dependencies on base_test_support in a few places. Moves and renames the command line switch this was using to base_switches. Move the base switch for process type to chrome switches. TEST=none BUG=none Review URL: http://codereview.chromium.org/3026055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56399 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 55400 - Cleanup in base. This moves the implementation (and a bunch ↵nsylvain@chromium.org2010-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | of header file dependencies) from the multiprocess test and the test_suite headers to .cc files. Moves multiprocess_test to the test directory, and all of this stuff to the existing base_test_support project. I also used the base namespace. Previously other projects included this functionality just by #include because it was all inline, so I had to add dependencies on base_test_support in a few places. Moves and renames the command line switch this was using to base_switches. Move the base switch for process type to chrome switches. TEST=none BUG=none Review URL: http://codereview.chromium.org/3026055 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/3035062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55416 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup in base. This moves the implementation (and a bunch of header filebrettw@chromium.org2010-08-091-1/+1
| | | | | | | | | | | | | | | | | | | dependencies) from the multiprocess test and the test_suite headers to .cc files. Moves multiprocess_test to the test directory, and all of this stuff to the existing base_test_support project. I also used the base namespace. Previously other projects included this functionality just by #include because it was all inline, so I had to add dependencies on base_test_support in a few places. Moves and renames the command line switch this was using to base_switches. Move the base switch for process type to chrome switches. TEST=none BUG=none Review URL: http://codereview.chromium.org/3026055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55400 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unneeded headers from base/ (part 5)thestig@chromium.org2010-08-071-1/+0
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3041049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55349 0039d316-1c4b-4281-b951-d872f2087c98
* Add an AppendSwitchASCII to CommandLine, and convert a test to it.evan@chromium.org2010-07-301-16/+11
| | | | | | | | | | | I'm removing all the AppendSwitchWithValue() users due to wstrings, and this is one caller. Since fixing this one caller requires touching many files, I thought I'd isolate this change from the other WithValue->ASCII conversions. Review URL: http://codereview.chromium.org/2878065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54257 0039d316-1c4b-4281-b951-d872f2087c98
* Random bits of header and whitespace cleanup.thestig@chromium.org2010-07-231-7/+4
| | | | | | | | BUG=none TEST=noe Review URL: http://codereview.chromium.org/3062003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53437 0039d316-1c4b-4281-b951-d872f2087c98
* Remove <iostream> where possible.erg@google.com2010-07-201-1/+0
| | | | | | | | | | | | | <iostream> creates a static initializer. Most people don't need <iostream> anyway--they really need <ostream> for operator<< overloads. <iostream> should *never* be included in a header file; <iosfwd> exists for that purpose. BUG=none TEST=none Review URL: http://codereview.chromium.org/3014015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53083 0039d316-1c4b-4281-b951-d872f2087c98
* This adds the first version of SyncSocket to base, along with a trivial ↵sehr@google.com2009-11-241-0/+9
| | | | | | | | | | unittest. SyncSocket provides a blocking send/receive that can be used for synchronization. Review URL: http://codereview.chromium.org/418004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32927 0039d316-1c4b-4281-b951-d872f2087c98
* Move more ICU-dependent stuff from base into base/i18n. Some test stuff alsobrettw@chromium.org2009-10-091-2/+2
| | | | | | | | | | | | depended on this, so to make the DEPS work out, I made a new base/test directory where I moved the testing-related files into a new directory base/test. TEST=none BUG=none Review URL: http://codereview.chromium.org/266038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28569 0039d316-1c4b-4281-b951-d872f2087c98
* IPC & LibEvent fixjeremy@chromium.org2009-09-231-0/+67
| | | | | | | | | | | * Allow IPC::Listeners to send a message on OnChannelConnected. * Fix a bug in MessagePumpLibevent::WatchFileDescriptor causing a read-after-free. BUG=22451 Review URL: http://codereview.chromium.org/209061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26946 0039d316-1c4b-4281-b951-d872f2087c98
* Recommit "Bring up Firefox Password Import Unittest on OS X."jeremy@chromium.org2009-08-211-1/+1
| | | | | | | | This recommits r23971 Review URL: http://codereview.chromium.org/174259 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24024 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Bring up Firefox Password Import Unittest on OS X."jeremy@chromium.org2009-08-211-1/+1
| | | | | | This reverts commit 63381b4554b1190c8a87583a5c5f403815e44e83. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23979 0039d316-1c4b-4281-b951-d872f2087c98
* Bring up Firefox Password Import Unittest on OS X.jeremy@chromium.org2009-08-211-1/+1
| | | | | | | | | | | | The NSSDecrptor class needs to be run in a child process on OS X, so we need to do some fancy footwork in the form of a bridge class. Also a few small fixes for surrounding code. BUG=18775 TEST=none Review URL: http://codereview.chromium.org/174206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23971 0039d316-1c4b-4281-b951-d872f2087c98
* Split the IPC code into ipc/agl@chromium.org2009-07-221-0/+476
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits the ipc code from the common project. The 'common' project pulls in all of webkit, the v8 bindings, skia, googleurl, and a number of other projects which makes it very difficult to deal with especially for external projects wanting just to use some of Chromium's infrastructure. This puts the ipc code into its top-level ipc/ directory with a dependency only on base. The common project depends on the new ipc/ipc.gyp:ipc target so that all projects currently pulling common in to get the IPC code still have it available. This mostly follows agl's pre-gyp attempt to do this which was r13062. Known issues: - Currently a number of projects depend on chrome/chrome.gyp:common in order to use the IPC infrastructure. Rather than fixing all of these dependencies I have made common depend on ipc/ipc.gyp:ipc and added "ipc" to the include_rules section of DEPS so that checkdeps.py doesn't complain. Over time projects that need IPC should depend on the IPC project themselves and dependencies on common removed, although I don't think many projects that need IPC will be able to get away without common currently. - ipc/ipc_message_macros.h still has #include "chrome/common/..." inside of a ipc/ should not refer to files in chrome/... now. I'm not sure how to resolve this since it's really an IDE bug - the named pipe name (windows+linux) and the logging event name (all) + env variable (posix) refer explicitly to 'Chrome' which somewhat hurts the illusion of ipc/ being an independent library. I think this should be examined in a subsequent, much smaller patch. - I've eliminated the IPC.SendMsgCount counter since it was implemented in a way to create a dependency from ipc/ to chrome/common/chrome_counters. This is the same approach that r13062 took. http://codereview.chromium.org/155905 (Patch from James Robinson) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21342 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Move IPC code to ipc/"agl@chromium.org2009-04-031-480/+0
| | | | | | | This reverts commit r13062 which, unsurprisingly, broke the build. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13063 0039d316-1c4b-4281-b951-d872f2087c98
* Move IPC code to ipc/agl@chromium.org2009-04-031-0/+480
(No review URL: Rietvelt couldn't cope) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13062 0039d316-1c4b-4281-b951-d872f2087c98