0
Commit Graph

22 Commits

Author SHA1 Message Date
danakj
f416ce9d3b Convert content/browser/ Callbacks to {Once,Repeating}Callback
Use OnceCallback where possible because the callback is only used once
and RepeatingCallback and BindRepeating otherwise.

R=avi@chromium.org

Bug: 1007760
Change-Id: I3d02fded4b40cdc843ac89e057a34bdf3766b1bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962545
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723954}
2019-12-11 20:45:45 +00:00
Mark Pilgrim
ec8bce34e3 Migrate ByteStreamReader and ByteStreamWriter to BindRepeating
Bug: 714018
Change-Id: I0e1a9f6b8646b414664dbb7a7a7254f0135a166e
Reviewed-on: https://chromium-review.googlesource.com/1061814
Commit-Queue: Mark Pilgrim <pilgrim@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559628}
2018-05-17 18:55:23 +00:00
tzik
ccf160cafa Remove unneeded base::Passed on base::BindOnce parameter in //content
This CL applies //tools/clang/base_bind_rewriter to //chrome, that
removes unneeded base::Passed as a parameter of base::BindOnce.
This doesn't contain any behavior change.

For example, on base::BindOnce call around |Foo|, |ptr|, and |ptr2| below:
  void Foo(std::unique_ptr<int>);
  std::unique_ptr<int> ptr;
  std::unique_ptr<int>* ptr2 = &ptr;

If the parameter of base::Passed() is an rvalue-reference, it just
removes the base::Passed call.
  // Before
  base::BindOnce([](&Foo, base::Passed(std::move(ptr)));
  // After
  base::BindOnce([](&Foo, std::move(ptr));

If the parameter is a pointer and its address is taken there, the
rewriter replaces base::Passed and `&` with std::move().
  // Before
  base::BindOnce(&Foo, base::Passed(&ptr));
  // After
  base::BindOnce(&Foo, std::move(ptr));

If the parameter is other form of pointer, the rewriter replaces it
with std::move().
  // Before

  base::BindOnce(&Foo, base::Passed(ptr2));
  // After
  base::BindOnce(&Foo, std::move(*ptr));

Change-Id: I2f8c1cd7b46143da8e79d0b4e917ba4d585485f2
Reviewed-on: https://chromium-review.googlesource.com/926081
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537763}
2018-02-20 12:43:13 +00:00
Ivan Kotenkov
2c0d2bb3fe Convert 0 to nullptr in content using clang-tidy.
Bug: 778942
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Iee6be84c23149c745b3afd6e6158764f92ccd17f
Reviewed-on: https://chromium-review.googlesource.com/732305
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Ivan Kotenkov <kotenkov@yandex-team.ru>
Cr-Commit-Position: refs/heads/master@{#513138}
2017-11-01 15:41:28 +00:00
Brett Wilson
cc8623dc8e Replace std::deque and std::queue in //content.
These are replaced with the base versions base::circular_deque and base::queue.

Typedefs were replaced with using statements in changed code, and adjacent
typedefs were also converted.

RTCTimestamps struct in rtc_video_encoder.cc was made copyable and moveable
(it's just an int64 and an int32) to support being put in a circular_deque.
BrowsingDataRemoverImpl::RemovalTask was made move-only (from previously
not movable or copyable).

BUG=757232

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Ib83f929ae4c014ae0d3766a57e9cb56cba446e2b
Reviewed-on: https://chromium-review.googlesource.com/656066
Commit-Queue: Brett Wilson <brettw@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501169}
2017-09-12 03:28:10 +00:00
tzik
4fea24afdc Apply base_bind_rewriters to //content/browser/{a,b,c,d,f,g}*
This CL applies //tools/clang/base_bind_rewriters to //content/browser/{a,b,c,d,f,g}*
It rewrites base::Bind to base::BindOnce where the resulting base::Callback
is immediately converted to base::OnceCallback, which is considered safe
to use base::BindOnce.

E.g.:
  base::PostTask(FROM_HERE, base::Bind([]{}));
  base::OnceClosure cb = base::Bind([]{});
are converted to:
  base::PostTask(FROM_HERE, base::BindOnce([]{}));
  base::OnceClosure cb = base::BindOnce([]{});
Change-Id: I11ae9ac169c8e0ff9d9b95452fec22a8b7c91df7

NOPRESUBMIT=true

Change-Id: I11ae9ac169c8e0ff9d9b95452fec22a8b7c91df7
Reviewed-on: https://chromium-review.googlesource.com/628003
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496656}
2017-08-23 11:41:47 +00:00
peary2
229d9745b7 Rename TaskRunner::RunsTasksOnCurrentThread() in //content
renamed TaskRunner::RunsTasksOnCurrentThread() to
TaskRunner::RunsTasksInCurrentSequence() in //content

BUG=665062

Review-Url: https://codereview.chromium.org/2873333004
Cr-Commit-Position: refs/heads/master@{#471176}
2017-05-12 01:55:19 +00:00
meredithl
4fdd214c88 Make comments in byte_stream.cc gender neutral.
BUG=542537

Review-Url: https://codereview.chromium.org/2523393002
Cr-Commit-Position: refs/heads/master@{#434595}
2016-11-28 03:17:34 +00:00
dcheng
5971627d34 Convert //content/browser from scoped_ptr to std::unique_ptr
BUG=554298
R=avi@chromium.org

Review URL: https://codereview.chromium.org/1874893002

Cr-Commit-Position: refs/heads/master@{#386285}
2016-04-09 05:20:41 +00:00
dcheng
36b6aec9a5 Convert Pass()→std::move() in //content/browser
BUG=557422

Review URL: https://codereview.chromium.org/1545243002

Cr-Commit-Position: refs/heads/master@{#366894}
2015-12-26 06:17:30 +00:00
avi
b7348940d3 Switch to standard integer types in content/browser/.
BUG=138542
TBR=jam@chromium.org

Review URL: https://codereview.chromium.org/1549113002

Cr-Commit-Position: refs/heads/master@{#366868}
2015-12-25 20:58:00 +00:00
dcheng
c2282aa891 Standardize usage of virtual/override/final in content/browser/
This patch was automatically generated by applying clang fixit hints
generated by the plugin to the source tree.

BUG=417463
TBR=sky@chromium.org

Review URL: https://codereview.chromium.org/667943003

Cr-Commit-Position: refs/heads/master@{#300469}
2014-10-21 12:08:25 +00:00
mohan.reddy
7fc3ac7d5a Replace FINAL and OVERRIDE with their C++11 counterparts in content
This step is a giant search and replace for OVERRIDE and FINAL to
replace them with their lowercase versions.

BUG=417463

Review URL: https://codereview.chromium.org/637183002

Cr-Commit-Position: refs/heads/master@{#298804}
2014-10-09 05:24:24 +00:00
tyoshino@chromium.org
f9feef3e16 Explain the reason why we don't have thread check in destructor of ByteStreamReader/Writer.
They can be deleted before being used and it's safe to do so.

Review URL: https://codereview.chromium.org/22925003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257173 0039d316-1c4b-4281-b951-d872f2087c98
2014-03-14 19:14:42 +00:00
tyoshino@chromium.org
07516269ca Limit the total memory usage for Stream instances
Stream instances report their memory usage to StreamRegistry to get
approval. If rejected, they unregisters themselves.

writer_ and reader_ are cleared immediately when memory usage
violation happens. Added task runner DCHECKs to ByteStreamReaderImpl
and ByteStreamWriterImpl so that we can check we're not violating
thread restriction.

BUG=169957

Review URL: https://chromiumcodereview.appspot.com/22908008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218933 0039d316-1c4b-4281-b951-d872f2087c98
2013-08-22 07:43:24 +00:00
tyoshino@chromium.org
6a14c19a4f Clean up on byte_stream (mainly style and includes)
- Don't allocate ContentVector if input_contents_size_ is 0
- Remove unused weak_ptr.h and lock.h
- Add comments required by style guide
- Move includes not used in .h to .cc

BUG=

Review URL: https://chromiumcodereview.appspot.com/21839002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215958 0039d316-1c4b-4281-b951-d872f2087c98
2013-08-06 20:18:42 +00:00
tyoshino@chromium.org
8d0c23eeb7 Make ByteStream independent from DownloadInterruptReason
Change status type to int to make it portable to other component.

After this change, ByteStream could be moved under src/net/base/ or
src/base directory.

- Comment fix (MaybePostToPeer -> Write)

BUG=169957

Review URL: https://chromiumcodereview.appspot.com/18284005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215265 0039d316-1c4b-4281-b951-d872f2087c98
2013-08-02 11:02:30 +00:00
tyoshino@chromium.org
566357e5f9 Add Flush() method to ByteStream.
To be used by Stream implementation to push received data to
StreamURLRequestJob at arbitrary point.

BUG=169957

Review URL: https://chromiumcodereview.appspot.com/18098004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214545 0039d316-1c4b-4281-b951-d872f2087c98
2013-07-31 03:59:36 +00:00
dbeam@chromium.org
fb441961d6 Revert 198844 "Move sequenced_task_runner to base/task"
Reverting revisions that rely on r198820 so to unbreak the build.

> Move sequenced_task_runner to base/task
> 
> BUG=
> R=akalin@chromium.org
> 
> Review URL: https://codereview.chromium.org/14927008

TBR=brettw@chromium.org

Review URL: https://codereview.chromium.org/14985007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198848 0039d316-1c4b-4281-b951-d872f2087c98
2013-05-08 05:35:24 +00:00
brettw@chromium.org
002c726a0d Move sequenced_task_runner to base/task
BUG=
R=akalin@chromium.org

Review URL: https://codereview.chromium.org/14927008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198844 0039d316-1c4b-4281-b951-d872f2087c98
2013-05-08 04:14:58 +00:00
erg@chromium.org
59383c78c7 Cleanup: Remove unnecessary ".get()" from scoped_ptrs<>.
In r174057, ajwong@ added support for implicit testing to scoped_ptr<>. Removes
these in content/.

BUG=232084

Review URL: https://codereview.chromium.org/14081010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194608 0039d316-1c4b-4281-b951-d872f2087c98
2013-04-17 16:43:27 +00:00
zork@chromium.org
f8e92b5daa Move ByteStream to content/browser
BUG=180833


Review URL: https://chromiumcodereview.appspot.com/12440036

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189665 0039d316-1c4b-4281-b951-d872f2087c98
2013-03-21 18:35:46 +00:00