summaryrefslogtreecommitdiffstats
path: root/content/browser/storage_partition_impl_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup storage_partition_impl_unittest.cc.ajwong@chromium.org2013-12-281-224/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | Removes: - unnecessary casts - unnecessary conversions to pointers - unnecessary wrapper over RunLoop. It also removes stack-based creation of the StoragePartition and temp directories. This was fragile and unnecessary. The TestBrowserContext itself already created a default one. The stack-based version was actually coopting contexts that were created in the default partition to create a partial stub. This unfortunately also avoided most of the initialization code and checks in the StoragePartitionImpl::Create() function leading to more fragility. Now, each test case only has one default StoragePartition which is correctly tied to the containing BrowserContext. The contexts in this partition are also no longer shared by the stubs. TBR=boliu BUG=none Review URL: https://codereview.chromium.org/101423007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242675 0039d316-1c4b-4281-b951-d872f2087c98
* Move Touch to base namespace, remove SetLastModifiedTime.brettw@chromium.org2013-12-041-6/+10
| | | | | | | | | | | | | | This implements callers of SetLastModifiedTime in terms of base::Touch. SetLastModifiedTime was just a shorthand for touch that confusingly set both the last modified and last access times, and was only used by 7 files. It seems better to just have the callers call Touch directly. BUG= R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/100453006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238803 0039d316-1c4b-4281-b951-d872f2087c98
* Move directory creation functions to base namespace.brettw@chromium.org2013-12-031-1/+1
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/100573002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238446 0039d316-1c4b-4281-b951-d872f2087c98
* StoragePartition unit test: Check for correct scheme in mask matchinglazyboy@chromium.org2013-11-081-9/+2
| | | | | | | | | | | | | | | | | for tests that uses unproteced web mock data. Mistakenly left commented out in my original CL http://crrev.com/37843003. Also remove some more commented code in storage_partition_impl_unittest.cc BUG=315884 Test=None, Unit test fixing CL. TBR=jam Review URL: https://codereview.chromium.org/65223002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233868 0039d316-1c4b-4281-b951-d872f2087c98
* BrowsingDataRemover, (re)use StoragePartition deletion code.lazyboy@chromium.org2013-11-061-7/+859
| | | | | | | | | | | This CL removes code duplication around storage partition related data removal code from BrowsingDataRemover and re-uses StoragePartition::ClearData* method. BUG=180118 Test= Review URL: https://codereview.chromium.org/37843003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233365 0039d316-1c4b-4281-b951-d872f2087c98
* Stub out initial NavigationController browser implementationalecflett@chromium.org2013-09-211-1/+1
| | | | | | | | | | | This is the initial cut for the browser-side NavigationControllerDispatcherHost, and all the various related support plumbing to hook up two initial messages. BUG= 285976 Review URL: https://chromiumcodereview.appspot.com/23615009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224585 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 219709 "Remove the Extensions URLRequestContext."earthdok@chromium.org2013-08-271-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverted due to crashes under memory tools. BUG=280138 > Remove the Extensions URLRequestContext. > > Though chrome-extension: scheme URLs support cookies, they do not share > a namespace with http: and https:. In particular, chrome-extension://a and > http://a should not have the same set of cookies. > > To enforce this, previously the code created a completely separate > URLRequestContext for servicing chrome-extension: schemes. However, > the code really only used this object as a method for conveying the > correct cookie jar from Profile creation to a few spots where cookies > were accessed; the rest of the URLRequestContext functionality was unused. > > This CL removes the Extensions URLRequestContext code and replaces it > with APIs that directly expose the needed net::CookieStore. > > Lastly, CookieMonster::EnableFileScheme() is removed and > CookieMonster::Delegate is renamed CookieMonsterDelegate. > > EnableFileScheme is an inherently racy API because > CookieMonsters are creatable on all threads and this > function sets an unprotected global flag. CookieMonsterDelegate > is preferable to the nested interface because it can now be > forward declared. > > TBRing darin and sky to cover the rest of the mechanical unittest changes. > > TBR=darin,sky > BUG=158386,159193,57884 > > Review URL: https://chromiumcodereview.appspot.com/12546016 TBR=ajwong@chromium.org Review URL: https://codereview.chromium.org/23551005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219787 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the Extensions URLRequestContext.ajwong@chromium.org2013-08-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Though chrome-extension: scheme URLs support cookies, they do not share a namespace with http: and https:. In particular, chrome-extension://a and http://a should not have the same set of cookies. To enforce this, previously the code created a completely separate URLRequestContext for servicing chrome-extension: schemes. However, the code really only used this object as a method for conveying the correct cookie jar from Profile creation to a few spots where cookies were accessed; the rest of the URLRequestContext functionality was unused. This CL removes the Extensions URLRequestContext code and replaces it with APIs that directly expose the needed net::CookieStore. Lastly, CookieMonster::EnableFileScheme() is removed and CookieMonster::Delegate is renamed CookieMonsterDelegate. EnableFileScheme is an inherently racy API because CookieMonsters are creatable on all threads and this function sets an unprotected global flag. CookieMonsterDelegate is preferable to the nested interface because it can now be forward declared. TBRing darin and sky to cover the rest of the mechanical unittest changes. TBR=darin,sky BUG=158386,159193,57884 Review URL: https://chromiumcodereview.appspot.com/12546016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219709 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a SqlLite backend to WebRTCIdentityStore.jiayl@chromium.org2013-08-081-8/+2
| | | | | | | | | | | | | | | | | WebRTCIdentityStore maintains a list of inflight requests. If a new request is identical (i.e. same origin, identity_name, common_name) to a inflight request, the new one is joined into the existing one, so that it will not make duplicated requests to the backend or generate dupicated identities. If the backend does not find an existing identity, WebRTCIdentityStore generates a new one and adds it to the backend. The backend borrows most of the design from SQLiteServerBoundCertStore::Backend. It loads the database into memory on the first find request. Add or delete database operations are batched to commit every 30 seconds or every 512 operations. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=216264 Review URL: https://chromiumcodereview.appspot.com/21453002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216448 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 216264 "Adds a SqlLite backend to WebRTCIdentityStore."jyasskin@chromium.org2013-08-071-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to fix a memory leak: http://build.chromium.org/p/chromium.memory.fyi/builders/Linux%20Heapcheck/builds/28768/steps/heapcheck%20test%3A%20content/logs/stdio Leak of 160 bytes in 1 objects allocated from: @ 7f1611ba10e0 content::WebRTCIdentityStore::RequestIdentity @ a51510 content::WebRTCIdentityStoreTest_CancelRequest_Test::TestBody Leak of 71 bytes in 1 objects allocated from: @ 7f160f01ca89 std::basic_string::_Rep::_S_create @ 7f161c6a5cac GURL::GURL @ a514de content::WebRTCIdentityStoreTest_CancelRequest_Test::TestBody > Adds a SqlLite backend to WebRTCIdentityStore. > WebRTCIdentityStore maintains a list of inflight requests. If a new request is identical (i.e. same origin, identity_name, common_name) to a inflight request, the new one is joined into the existing one, so that it will not make duplicated requests to the backend or generate dupicated identities. > > If the backend does not find an existing identity, WebRTCIdentityStore generates a new one and adds it to the backend. > > The backend borrows most of the design from SQLiteServerBoundCertStore::Backend. It loads the database into memory on the first find request. Add or delete database operations are batched to commit every 30 seconds or every 512 operations. > > > BUG= > > Review URL: https://chromiumcodereview.appspot.com/21453002 R=jiayl@chromium.org Review URL: https://codereview.chromium.org/22264011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216282 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a SqlLite backend to WebRTCIdentityStore.jiayl@chromium.org2013-08-071-8/+2
| | | | | | | | | | | | | | | WebRTCIdentityStore maintains a list of inflight requests. If a new request is identical (i.e. same origin, identity_name, common_name) to a inflight request, the new one is joined into the existing one, so that it will not make duplicated requests to the backend or generate dupicated identities. If the backend does not find an existing identity, WebRTCIdentityStore generates a new one and adds it to the backend. The backend borrows most of the design from SQLiteServerBoundCertStore::Backend. It loads the database into memory on the first find request. Add or delete database operations are batched to commit every 30 seconds or every 512 operations. BUG= Review URL: https://chromiumcodereview.appspot.com/21453002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216264 0039d316-1c4b-4281-b951-d872f2087c98
* Rename enum in StoragePartition according to style guide.lazyboy@chromium.org2013-08-021-1/+1
| | | | | | | | | | | | Enums should have ALL_CAPS with enum name as prefix, according to style guide. BUG=None Test=Rename only change. Review URL: https://chromiumcodereview.appspot.com/21646002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215344 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for selectively deleting different bits of StoragePartition ↵lazyboy@chromium.org2013-07-311-2/+4
| | | | | | | | | | | | | | | | | related data. Reland r213582 after fixing memory leak (via LeakSanitizer). This CL makes the deletion work similar to BrowsingDataRemover in chrome/. This CL is a result of the discussion in crrev.com/16188005 BUG=174763,180118,264188 Test=built: libwebviewchromium, manually tested with browser plugin guest's storage partition, checked clearing cookies and local storage data. Ran unit_tests target with LeakSanitizer/"detect_leaks=1" Review URL: https://chromiumcodereview.appspot.com/20543002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214585 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 213582 "Add support for selectively deleting different bi..."earthdok@chromium.org2013-07-251-4/+2
| | | | | | | | | | | | | | | | | | | | r213582 introduced assorted leaks in unit_tests. See http://crbug.com/264188 > Add support for selectively deleting different bits of StoragePartition related data. > This CL makes the deletion work similar to BrowsingDataRemover in chrome/. > > This CL is a result of the discussion in crrev.com/16188005 > > BUG=180118 > Test=built: libwebviewchromium, manually tested with browser plugin guest's storage partition, checked clearing cookies and local storage data. > > Review URL: https://chromiumcodereview.appspot.com/17701002 TBR=lazyboy@chromium.org Review URL: https://codereview.chromium.org/20223003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213632 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for selectively deleting different bits of StoragePartition ↵lazyboy@chromium.org2013-07-251-2/+4
| | | | | | | | | | | | | | | related data. This CL makes the deletion work similar to BrowsingDataRemover in chrome/. This CL is a result of the discussion in crrev.com/16188005 BUG=180118 Test=built: libwebviewchromium, manually tested with browser plugin guest's storage partition, checked clearing cookies and local storage data. Review URL: https://chromiumcodereview.appspot.com/17701002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213582 0039d316-1c4b-4281-b951-d872f2087c98
* Generates the DTLS identity in browser process and returns it to the ↵jiayl@chromium.org2013-07-011-3/+9
| | | | | | | | | | | | | | | | | renderer process. This is the first part of implementing a persistent identity store for WebRTC in Chrome. It implements the IPC messages to request and return the DTLS identity and the identity generation in browser process. A persistent store based on SQLite DB will be implemented later. DTLSIdentityService: used in the renderer process to request a DTLS identity. It sends an IPC to the browser process and receives the reply containing the identity in a callback. DTLSIdentityServiceHost: listens for the IPC message from DTLSIdentityService and passes the request to DTLSIdentityStore. DTLSIdentityStore: created per RenerProcessHost. For now it always generates a new identity on a worker thread for each request, without any caching or persistent storage. BUG=https://code.google.com/p/webrtc/issues/detail?id=1864 Review URL: https://chromiumcodereview.appspot.com/15969025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209499 0039d316-1c4b-4281-b951-d872f2087c98
* Add TestBrowserThreadBundle into RenderViewHostTestHarness. Kill some ↵ajwong@chromium.org2013-06-061-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | unnecessary real threads. This CL creates a new class, TestBrowserThreadBundle, that creates a TestBrowserThread for the most commonly needed BrowserThreads. It also adds this thread bundle into RenderViewHostTestHarness because most tests that use this harness need these threads in order to run. To support TestBrowserThreadBundle, BrowserThreadImpl's test construction was also modified to understand a NULL message_loop. Aside from introducing the new class, this CL also removes: (1) unnecessary constructors in test (2) DISALLOW_COPY_AND_ASSIGNS in test fixtures* (3) now redundant TestBrowserThreads from tests (4) bad access-level changes for SetUp() and TearDown() (5) using declarations that root off the global scope (6) uses of MessageLoop's RunUntilIdle() and Quit() (7) as many real threads as possible There are also a changes to MediaCaptureDevicesDispatcher and OneClickSigninHelper that allow unittests to cut dependencies on IO thread activity. DesktopNotificationServiceTest (and a couple of others) were also made single threaded because the synchronization logic required for a non-flaky test meant the parallelism only really exercised the extra code in the test that forced the serialization. * DISALLOW_COPY_AND_ASSIGN does not serve much purpose in GTest fixture types. However, using it removes the compile-provided default constructor which forces the fixture writer to provide an empty default constructor. Since GTest recommends the default constructor as the preferred method to do setup for a test (as opposed to the SetUp() method), it's confusing to have bunch of classes with both SetUp() and a default constructor. It's simpler and uses less code to just remove the DISALLOW_COPY_AND_ASSIGN. An alternative would be to use the default constructor for initialization, but this is not possible because of our test harnesses are inheritance based which means it is impossible for a derived fixture to perform initialization before the harness if we use the GTest preferred default constructor initialization pattern. TBR=avi,battre,ben,benwells,brettw,dbeam,dimich,joi,joth,mad,marja,markusheintz,noelallen,phajdan,rdsmith,satorux,scherkus,sky,stevenjb,stuartmorgan,timsteele BUG=159193 Review URL: https://chromiumcodereview.appspot.com/14197014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204603 0039d316-1c4b-4281-b951-d872f2087c98
* content: Use base::MessageLoop.xhwang@chromium.org2013-05-041-2/+2
| | | | | | | | | BUG=236029 R=avi@chromium.org Review URL: https://chromiumcodereview.appspot.com/14335017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198316 0039d316-1c4b-4281-b951-d872f2087c98
* content: Remove use of ALLOW_THIS_IN_INITIALIZER_LIST.scherkus@chromium.org2013-04-301-3/+2
| | | | | | | | | | | It's no longer providing value as the MSVC warning is disabled during compilation. Refer to bug for details. BUG=234765 R=jam@chromium.org Review URL: https://codereview.chromium.org/14386012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197206 0039d316-1c4b-4281-b951-d872f2087c98
* Add the ability to clear the shader disk cache.dsinclair@chromium.org2013-04-051-0/+125
| | | | | | | | | | | | | When the browser cache for a given profile is cleared we will now clear out any shaders stored in the shader disk cache for that profile. BUG=176289 Review URL: https://chromiumcodereview.appspot.com/12500009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192511 0039d316-1c4b-4281-b951-d872f2087c98
* Fix on-disk structure for persistent storage in webview tags.ajwong@chromium.org2012-11-131-58/+0
| | | | | | | | | BUG=159464 Review URL: https://chromiumcodereview.appspot.com/11366140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167334 0039d316-1c4b-4281-b951-d872f2087c98
* Webview tag creation should be using storage partitions.nasko@chromium.org2012-11-081-0/+58
BUG=145500,149726 Review URL: https://chromiumcodereview.appspot.com/11234032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166639 0039d316-1c4b-4281-b951-d872f2087c98