0
Commit Graph

31 Commits

Author SHA1 Message Date
Nasko Oskov
ee48dfb4fa Prepare to remove //content/ from unsafe_bufers_paths.txt
Suppress unsafe buffer usage on a file-by-file basis.  Out of
approximately 5850 .cc and .h files only roughly 160 files fail
compilation with the unsafe buffers warning.

Suppress only, by inserting boilerplate into affected files. Do not
re-write any code to work around the issues. Properly fixing each file
will be done in follow-up CLs.

//content/ is not removed from unsafe_bufers_paths.txt file and will be
also done as a follow-up, so it makes potential reverts simpler.

Bug: 342213636
Change-Id: I4a936e63dea95a78951f7bfae6d5487708ae3c0b
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5608913
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312393}
2024-06-08 05:13:06 +00:00
Tom Sepez
0156eb2359 Prepare for separating owning and non-owning net:IOBuffers.
Use IOBufferWithSize for the owning cases. Currently this is
the same as IOBuffer, but eventually IOBuffer will evolve to be
a non-owning class.

This cl applies the changes to /content.

This CL was uploaded by git cl split.

R=boliu@chromium.org, ricea@chromium.org

Bug: 1493389
Change-Id: Ia2b88a0df643d642a269e97a58bf9815b423d3c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4995818
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218331}
2023-11-01 18:34:01 +00:00
Avi Drissman
adac219925 Update header includes for /base/functional in /content
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I32ec425b9c0e52ec4b50047bf3290fecc5c905ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4148554
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091567}
2023-01-11 23:46:39 +00:00
Sean Maher
5b9af51fdd task posting v3: moving away from ThreadTaskRunnerHandle
To continue the migration away from TaskRunnerHandles, the codebase
was refactored using the following scripts:
shell script:
https://paste.googleplex.com/4673967729147904
python:
https://paste.googleplex.com/5824001174667264

This will do a few sed-like modifications, changing calls to methods of
ThreadTaskRunnerHandle to calls to methods of
SingleThreadTaskRunner::CurrentDefaultHandle, and swapping includes.

Bug: 1026641
AX-Relnotes: n/a.
Change-Id: Ia33b6dfebb15937481c619f5c838720ce7bb2676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4031817
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1074085}
2022-11-21 15:32:47 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
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
Gabriel Charette
a0e0846dbc Backport some tests in /content/browser to SingleThreadTaskEnvironment
These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of crbug.com/891670.

//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for
/content/browser.

This CL is a no-op if it passes CQ.

This CL was uploaded by git cl split.

R=boliu@chromium.org

Bug: 891670
Change-Id: I7950058b91b35637f160a179f66af7c3a8abff6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787208
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693696}
2019-09-05 13:48:23 +00:00
Gabriel Charette
c710874894 Reland "[TaskEnvironment] Complete migration with header rename"
This is a reland of 18947083c7

The move_source_file.py script's formatting rules incorrectly
formatted services/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
after all. But we also can't rely 100% on git cl format (crbug.com/997063)
so I ended up performing a git cl format && git add -up
(+interactive addition of missing blank line after foo.h when included
from top of foo.cc)

Also added
$ tools/git/move_source_file.py net/test/test_with_scoped_task_environment.h net/test/test_with_task_environment.h

Original change's description:
> [TaskEnvironment] Complete migration with header rename
>
> This is merely:
>
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
>
> and a few manual renames in DEPS files missed by the script
>
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
>
> TBR=dcheng@chromium.org
>
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I6179dd1329a4d30bf5c65450ea893537f31e6f85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767658
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689794}
2019-08-23 03:31:40 +00:00
Gabriel Charette
b69fcd4f6e Revert "[TaskEnvironment] Complete migration with header rename"
This reverts commit 18947083c7.

Reason for revert: broke Win

Original change's description:
> [TaskEnvironment] Complete migration with header rename
> 
> This is merely:
> 
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
> 
> and a few manual renames in DEPS files missed by the script
> 
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
> 
> TBR=dcheng@chromium.org
> 
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}

TBR=dcheng@chromium.org,gab@chromium.org

Change-Id: I9aa8ff558d1ff78cebe0c25e559c017578ad4f53
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 992483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767657
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689780}
2019-08-23 02:13:29 +00:00
Gabriel Charette
18947083c7 [TaskEnvironment] Complete migration with header rename
This is merely:

$ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
$ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
$ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
$ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
$ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc

and a few manual renames in DEPS files missed by the script

This CL uses --bypass-hooks to avoid having to git cl format because
many headers are being reordered by git cl format and it's too many to
figure out in a no-op CL which ones are okay with it.
windows.h for one should typically be first and another one of the
reorderings in PS3 even caused a compile failure:
https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689778}
2019-08-23 02:05:33 +00:00
Gabriel Charette
694c3c33ca [TaskEnvironment] Mass-migrate away from ScopedTaskEnvironment (1/2)
(well half of them because git cl upload wouldn't let me do
 them all at once...)

This is step  of the mass migration. Some of these will be
backported to SingleThreadTaskEnvironment in a later phase.

scoped_task_environment.h will also only move in a follow-up CL.

TBR=dcheng@chromium.org

Bug: 992483
Change-Id: I44bc376deee9b6c95bafac8d54165174d86a5001
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756247
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688086}
2019-08-19 14:53:05 +00:00
Alexander Timin
58ee05f6ab [content] Replace MessageLoop with ScopedTaskEnvironment in tests.
Replacing MessageLoop with ScopedTaskEnvironment will allow us to get
more accurate information about its lifetime and get rid of lazy
bindings.

R=jochen@chromium.org
CC=gab@chromium.org,alexclarke@chromium.org

BUG=892139,891670

Change-Id: I9ffc7fec4c34a87c205c4d65d6e0fb8c5e21b05e
Reviewed-on: https://chromium-review.googlesource.com/c/1261816
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Commit-Queue: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597073}
2018-10-05 11:44:33 +00:00
Victor Costan
63c8b3d4f7 Use base::MakeRefCounted instead of new to alloc net::IOBuffer instances.
This CL only handles the files in //content. The files in //net were
tackled in https://crrev.com/c/1188959. Parallel CLs will tackle other
directories.

net::IOBuffer is (thread-safe) ref-counted. Asides from improving the
ability to reason about instance ownership locally, creating instances
via base::MakeRefCounted makes it possible to use 1-based ref-counting
in the future (see base/memory/ref_counted.h).

This CL is mechanical, to avoid introducing any behavior changes. The
difficult cases will be tackled by follow-up CLs. The following
transformations were performed.

* new IOBufferType(args) => base::MakeRefCounted<IOBufferType>(args)
* new IOBufferType => base::MakeRefCounted<IOBufferType>()
* scoped_refptr x(base::MakeRefCounted<IOBufferType>(args)) =>
  scoped_refptr x = base::MakeRefCounted<IOBufferType>(args)
* scoped_refptr<IOBufferType>(base::MakeRefCounted<IOBufferType>(args)) =>

  base::MakeRefCounted<IOBufferType>(args)
* In comments: creates a new IOBufferType => creates an IOBufferType
  (so it wouldn't trigger future searches for "new BufferType")
* Instantiated static members in HttpResponseBodyDrainer,
  HttpNetworkTransaction, HttpProxyClientSocket, WritersTest,
  UDPSocketTest, TestDelegate, UDPSocketPerfTest
  (needed to fix linker errors)
* arraysize -> base::size (where needed to pass presubmit checks)
* git cl format

Change-Id: Ib3f9965fe92b84be3db88d0143a398079b812efd
Reviewed-on: https://chromium-review.googlesource.com/1200525
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588243}
2018-09-01 01:34:10 +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
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
gab
f64a25e32a Add missing IWYU message_loop.h includes.
This is a pre-req to removing the dependency from RunLoop->MessageLoop
as many files only include run_loop.h but instantiate a MessageLoop.

The following fix script was applied to each file in the codebase
(plus a few hand fixes for DEPS and for //base):

def Fix(file_path):
  content = refactor_lib.ReadFile(file_path)

  # Assume fwd-decls are correct in first pass.
  if 'class MessageLoop;' in content:
    return False
  if 'class MessageLoopForUI;' in content:
    return False
  if 'class MessageLoopForIO;' in content:
    return False

  # Using base:: prefix ensures we don't match fwd-decls and other things.
  # Will require a few fixups for missing includes in //base proper.
  # Complex prefix in regex attempts to skip comments.
  matches = re.compile(r'(\n *[^/\n][^/\n][^/\n]*base::MessageLoop(ForUI|ForIO)?\b[^*])', re.DOTALL).findall(content)

  if not matches:
    return False

  # Ignore unique pointers in headers in first pass...
  if os.path.splitext(file_path)[1] == '.h':
    found = False
    for match in matches:
      if not 'std::unique_ptr<base::MessageLoop' in match[0]:
        found = True
        break
    if not found:
      return False

  updated_content = refactor_lib.AddInclude(file_path, content, "base/message_loop/message_loop.h")

  if updated_content == content:
    return False

  # Write updated file
  refactor_lib.WriteFile(file_path, updated_content)

  return True

TBR=gab@chromium.org
BUG=703346
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2876013002
Cr-Commit-Position: refs/heads/master@{#471412}
2017-05-12 19:43:18 +00:00
fdoray
e716a9021e Remove calls to deprecated MessageLoop methods in content.
This CL makes the following replacements in
content:

Before               After
----------------------------------------------------------
 x.PostTask()          x.task_runner()->PostTask()
   PostDelayedTask()                    PostDelayedTask()
   ReleaseSoon()                        ReleaseSoon()
   DeleteSoon()                         DeleteSoon()
x->PostTask()         y->task_runner()->PostTask()
   PostDelayedTask()                    PostDelayedTask()
   ReleaseSoon()                        ReleaseSoon()
   DeleteSoon()                         DeleteSoon()

 x.Run()              RunLoop().Run()
 x.RunUntilIdle()     RunLoop().RunUntilIdle()

x->Run()              RunLoop().Run()
x->RunUntilIdle()     RunLoop().RunUntilIdle()
    If |y| isn't MessageLoopForUI::current() or
    MessageLoopForIO::current()

 y.message_loop()->task_runner()
                      y.task_runner()
y->message_loop()->task_runner()
                      y->task_runner()
----------------------------------------------------------

|x| is a base::MessageLoop(ForUI|ForIO) or a pointer to
a base::MessageLoop(ForUI|ForIO). |y| is a base::Thread
or a pointer to a base::Thread.

This CL was generated using the MessageLoopDeprecatedMethods
clang-tidy fix available on the associated bug. Only files
that compile on Mac are affected. Follow-up CLs will make
these replacements for other platforms.

This CL doesn't change code behavior.

BUG=616447
R=jam@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2082343002
Cr-Commit-Position: refs/heads/master@{#403787}
2016-07-05 16:08:03 +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
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
skyostil
95082a6a47 content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs
This patch was mostly autogenerated with
https://codereview.chromium.org/1010073002/.

BUG=465354
TBR=nick@chromium.org

Committed: https://crrev.com/422456f9d53f0bf936a64f21a1463fd0abd3df84
Cr-Commit-Position: refs/heads/master@{#333081}

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

Cr-Commit-Position: refs/heads/master@{#333112}
2015-06-05 19:53:37 +00:00
skyostil
d4104aab63 Revert "content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs"
This reverts commit 422456f9d5.

TBR=zea@chromium.org
BUG=465354
NOTRY=true
NOTREECHECKS=true

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

Cr-Commit-Position: refs/heads/master@{#333086}
2015-06-05 17:49:39 +00:00
skyostil
422456f9d5 content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs
This patch was mostly autogenerated with
https://codereview.chromium.org/1010073002/.

BUG=465354
TBR=nick@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#333081}
2015-06-05 17:24:40 +00:00
skyostil
74f13dc2b6 Revert "content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs"
This reverts commit 5d18b2493a.

Reason: Broke iOS build: http://build.chromium.org/p/chromium.mac/builders/iOS_Simulator_%28dbg%29/builds/27843

NOTRY=true
NOTREECHECKS=true
BUG=465354
TBR=sievers@chromium.org,nick@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#333047}
2015-06-05 15:26:51 +00:00
skyostil
5d18b2493a content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs
This patch was mostly autogenerated with
https://codereview.chromium.org/1010073002/.

BUG=465354
TBR=nick@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#333043}
2015-06-05 14:21:03 +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
avi@chromium.org
95f861e7fc Use a direct include of the message_loop header in content/, part 1.
BUG=260807
TEST=none
TBR=ben@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212206 0039d316-1c4b-4281-b951-d872f2087c98
2013-07-18 02:07:17 +00:00
xhwang@chromium.org
dd32b127ce content: Use base::MessageLoop.
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
2013-05-04 14:17:11 +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