Created:
4 years, 5 months ago by skau
Modified:
4 years, 4 months ago
CC:
chromium-reviews, adlr
Base URL:
https://chromium.googlesource.com/chromium/src.git@ippRead
Target Ref:
refs/pending/heads/master
Visibility:
Public.
|
Description
Print directly to CUPS using the IPP APIs
Implements printing to CUPS with paper size, color, and duplexing
configurable.
Existing bug where the printer does not initialize the first time it is
selected.
BUG= 607668
TEST=Enable --enable-native-cups. Print a webpage to a desired CUPS
printer.
Committed: https://crrev.com/b793195a8a91fa9a17eaf4af0fa21fed4da4d9cc
Cr-Commit-Position: refs/heads/master@{#408179}
Total comments: 10
Total comments: 17
Total comments: 20
Total comments: 16
Created: 4 years, 4 months ago
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+527 lines, -19 lines) |
Patch |
 |
M |
chrome/browser/printing/pdf_to_emf_converter.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
3 chunks |
+7 lines, -0 lines |
0 comments
|
Download
|
 |
M |
printing/BUILD.gn
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
3 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
 |
M |
printing/backend/cups_deleters.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
printing/backend/cups_deleters.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
printing/backend/cups_ipp_util.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
M |
printing/backend/cups_ipp_util.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
1 chunk |
+5 lines, -2 lines |
0 comments
|
Download
|
 |
M |
printing/metafile.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
|
2 chunks |
+6 lines, -2 lines |
0 comments
|
Download
|
 |
M |
printing/printed_document.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
A |
printing/printed_document_chromeos.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
1 chunk |
+47 lines, -0 lines |
0 comments
|
Download
|
 |
M |
printing/printed_document_linux.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
printing/printing.gyp
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
3 chunks |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
A + |
printing/printing_context_chromeos.h
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
|
3 chunks |
+23 lines, -8 lines |
0 comments
|
Download
|
 |
A |
printing/printing_context_chromeos.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
1 chunk |
+401 lines, -0 lines |
0 comments
|
Download
|
 |
M |
printing/printing_context_no_system_dialog.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+6 lines, -2 lines |
0 comments
|
Download
|
Messages
Total messages: 37 (24 generated)
Expand Messages
|
Collapse Messages
|
Show Generated Messages
|
Hide Generated Messages
|
skau
|
|
4 years, 5 months ago
(2016-07-08 00:53:52 UTC)
#1
|
|
skau
|
|
The last CL to implement printing to CUPS on Chrome OS. Please review at your ...
|
|
4 years, 5 months ago
(2016-07-08 00:53:53 UTC)
#2
|
The last CL to implement printing to CUPS on Chrome OS.
Please review at your earliest convenience.
Thanks!
|
Lei Zhang
|
|
https://codereview.chromium.org/2117713002/diff/40001/printing/metafile.h File printing/metafile.h (right): https://codereview.chromium.org/2117713002/diff/40001/printing/metafile.h#newcode95 printing/metafile.h:95: virtual bool GetDataAsVector(std::vector<char>* buffer) const = 0; Put this ...
|
|
4 years, 5 months ago
(2016-07-08 01:35:26 UTC)
#3
|
|
skau
|
|
I've responded to the comments and fixed most of them. I've left a comment regarding ...
|
|
4 years, 5 months ago
(2016-07-09 00:28:33 UTC)
#4
|
|
Lei Zhang
|
|
Still got red trybots. https://codereview.chromium.org/2117713002/diff/40001/printing/printed_document.cc File printing/printed_document.cc (right): https://codereview.chromium.org/2117713002/diff/40001/printing/printed_document.cc#newcode267 printing/printed_document.cc:267: // This function is not ...
|
|
4 years, 5 months ago
(2016-07-13 01:43:06 UTC)
#5
|
|
skau
|
|
4 years, 5 months ago
(2016-07-14 21:26:23 UTC)
#6
|
|
commit-bot: I haz the power
|
|
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2117713002/100001
|
|
4 years, 5 months ago
(2016-07-14 21:27:25 UTC)
#7
|
|
skau
|
|
4 years, 5 months ago
(2016-07-14 21:33:37 UTC)
#8
|
|
skau
|
|
4 years, 5 months ago
(2016-07-14 21:48:59 UTC)
#9
|
|
commit-bot: I haz the power
|
|
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2117713002/120001
|
|
4 years, 5 months ago
(2016-07-14 21:49:54 UTC)
#10
|
|
commit-bot: I haz the power
|
|
4 years, 5 months ago
(2016-07-14 22:07:06 UTC)
#11
|
|
commit-bot: I haz the power
|
|
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_compile_dbg_ng/builds/231208)
|
|
4 years, 5 months ago
(2016-07-14 22:07:07 UTC)
#12
|
|
skau
|
|
4 years, 5 months ago
(2016-07-14 23:42:46 UTC)
#13
|
|
commit-bot: I haz the power
|
|
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2117713002/160001
|
|
4 years, 5 months ago
(2016-07-14 23:43:06 UTC)
#14
|
|
skau
|
|
Thanks for the review. I'm pretty sure I fixed all the trybots, I'll keep an ...
|
|
4 years, 5 months ago
(2016-07-14 23:47:13 UTC)
#15
|
Thanks for the review. I'm pretty sure I fixed all the trybots, I'll keep an
eye on it.
https://codereview.chromium.org/2117713002/diff/40001/printing/printed_docume...
File printing/printed_document.cc (right):
https://codereview.chromium.org/2117713002/diff/40001/printing/printed_docume...
printing/printed_document.cc:267: // This function is not used on aura
linux/chromeos or android.
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> On 2016/07/09 00:28:33, skau wrote:
> > On 2016/07/08 01:35:26, Lei Zhang wrote:
> > > Comment is out of date.
> >
> > Are there aura tests to verify that I haven't broken something?
>
> If you put a NOTREACHED() in the body, we can see if anyone actually reaches
it.
Done.
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
File printing/printing_context_chromeos.cc (right):
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
printing/printing_context_chromeos.cc:148: return base::WrapUnique(new
PrintingContextChromeos(delegate));
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> base::MakeUnique
Done.
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
printing/printing_context_chromeos.cc:178: LOG(WARNING) << "No printer
selected";
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> BTW, consider only logging the serious stuff.
>
https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md...
I've switched some to debug logging and removed this specific statement. I left
a few though as they indicate an unexpected condition but don't warrant a crash.
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
printing/printing_context_chromeos.cc:241: // TODO(skau): Convert to DCHECK when
https://crbug.com/613779 is resolved
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> Should this also mention line 182 above?
They're linked now.
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
printing/printing_context_chromeos.cc:271: if (printer == nullptr) {
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> More nullptr comparisons
Done.
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
printing/printing_context_chromeos.cc:271: if (printer == nullptr) {
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> More nullptr comparisons
Done.
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
printing/printing_context_chromeos.cc:330: return CANCEL;
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> Consider putting a new line after, just like line 239 or line 346.
Done.
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
printing/printing_context_chromeos.cc:389: printer_.reset(nullptr);
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> Just reset()
Done.
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
File printing/printing_context_chromeos.h (right):
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
printing/printing_context_chromeos.h:8: #include <cups/cups.h>
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> not needed here?
Done.
https://codereview.chromium.org/2117713002/diff/80001/printing/printing_conte...
printing/printing_context_chromeos.h:43: Result StreamData(char* buffer, int
len);
On 2016/07/13 01:43:05, Lei Zhang (Slow Thursday) wrote:
> Can this take a vector?
Yes
|
commit-bot: I haz the power
|
|
4 years, 5 months ago
(2016-07-14 23:59:42 UTC)
#16
|
|
commit-bot: I haz the power
|
|
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_compile_dbg_ng/builds/231292) linux_chromium_chromeos_rel_ng on ...
|
|
4 years, 5 months ago
(2016-07-14 23:59:43 UTC)
#17
|
|
skau
|
|
4 years, 5 months ago
(2016-07-15 00:58:16 UTC)
#18
|
|
commit-bot: I haz the power
|
|
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2117713002/200001
|
|
4 years, 5 months ago
(2016-07-15 00:58:52 UTC)
#19
|
|
skau
|
|
4 years, 5 months ago
(2016-07-15 00:59:11 UTC)
#20
|
|
commit-bot: I haz the power
|
|
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2117713002/200001
|
|
4 years, 5 months ago
(2016-07-15 00:59:29 UTC)
#21
|
|
commit-bot: I haz the power
|
|
4 years, 5 months ago
(2016-07-15 02:11:11 UTC)
#22
|
|
commit-bot: I haz the power
|
|
Dry run: This issue passed the CQ dry run.
|
|
4 years, 5 months ago
(2016-07-15 02:11:13 UTC)
#23
|
Dry run: This issue passed the CQ dry run.
|
Lei Zhang
|
|
https://codereview.chromium.org/2117713002/diff/200001/printing/metafile.h File printing/metafile.h (right): https://codereview.chromium.org/2117713002/diff/200001/printing/metafile.h#newcode167 printing/metafile.h:167: bool GetDataAsVector(std::vector<char>* buffer) const; This feels a bit weird. ...
|
|
4 years, 5 months ago
(2016-07-20 01:26:57 UTC)
#24
|
|
skau
|
|
I addressed the comments and unified the constants. PTAL. https://codereview.chromium.org/2117713002/diff/200001/printing/metafile.h File printing/metafile.h (right): https://codereview.chromium.org/2117713002/diff/200001/printing/metafile.h#newcode167 printing/metafile.h:167: ...
|
|
4 years, 5 months ago
(2016-07-22 23:36:14 UTC)
#25
|
I addressed the comments and unified the constants. PTAL.
https://codereview.chromium.org/2117713002/diff/200001/printing/metafile.h
File printing/metafile.h (right):
https://codereview.chromium.org/2117713002/diff/200001/printing/metafile.h#ne...
printing/metafile.h:167: bool GetDataAsVector(std::vector<char>* buffer) const;
On 2016/07/20 01:26:56, Lei Zhang wrote:
> This feels a bit weird. Why don't we just remove the OS_CHROME ifdefs? I think
> that's cleaner, even it it adds an extra method that does not get used on
other
> platforms.
It happens that there's a Windows implementation of MetafilePlayer. But I'll go
implement it there.
https://codereview.chromium.org/2117713002/diff/200001/printing/printing.gyp
File printing/printing.gyp (right):
https://codereview.chromium.org/2117713002/diff/200001/printing/printing.gyp#...
printing/printing.gyp:208: 'printed_document_chromeos.cc',
On 2016/07/20 01:26:56, Lei Zhang wrote:
> Should the changes here match printing/BUILD.gn? If this CL drags on a bit
> longer, all the .gyp files might get deleted. :)
I'm counting the days...
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
File printing/printing_context_chromeos.cc (right):
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
printing/printing_context_chromeos.cc:78: char* CopyStringToChar(const
base::StringPiece value, char** dst) {
On 2016/07/20 01:26:56, Lei Zhang wrote:
> Do you need |dst| here?
Not really. Removed.
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
printing/printing_context_chromeos.cc:79: int value_len = value.size() + 1;
On 2016/07/20 01:26:56, Lei Zhang wrote:
> Type should be size_t, or just drop this variable altogether and use
> value.size() or value.size() + 1 below as needed. Instead of having value_len
-
> 1.
Done.
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
printing/printing_context_chromeos.cc:80: *dst = new char[value_len];
On 2016/07/20 01:26:57, Lei Zhang wrote:
> Who deletes these strings?
It is currently leaking memory. But I'll fix it so cups_option_t objects have
deleters.
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
printing/printing_context_chromeos.cc:81: value.copy(*dst, value_len);
On 2016/07/20 01:26:56, Lei Zhang wrote:
> Is this copying 1 extra byte than necessary?
It is. I think strlcpy is cleaner so I'm changing it. Is there a standard way
to do this? It seems like there should be...
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
printing/printing_context_chromeos.cc:142: if
(PrintBackend::GetNativeCupsEnabled()) {
On 2016/07/20 01:26:56, Lei Zhang wrote:
> No need for braces -> compact down to 3 lines.
Done.
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
File printing/printing_context_chromeos.h (right):
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
printing/printing_context_chromeos.h:15: #include
"printing/backend/print_backend.h"
On 2016/07/20 01:26:57, Lei Zhang wrote:
> is this needed here?
Done.
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
printing/printing_context_chromeos.h:41: Result StreamData(const
std::vector<char>& buffer);
On 2016/07/20 01:26:57, Lei Zhang wrote:
> Don't squeeze this into the middle of a list of overrides.
Done.
|
Lei Zhang
|
|
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_context_chromeos.cc File printing/printing_context_chromeos.cc (right): https://codereview.chromium.org/2117713002/diff/200001/printing/printing_context_chromeos.cc#newcode81 printing/printing_context_chromeos.cc:81: value.copy(*dst, value_len); On 2016/07/22 23:36:14, skau wrote: > On ...
|
|
4 years, 5 months ago
(2016-07-25 21:06:04 UTC)
#26
|
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
File printing/printing_context_chromeos.cc (right):
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
printing/printing_context_chromeos.cc:81: value.copy(*dst, value_len);
On 2016/07/22 23:36:14, skau wrote:
> On 2016/07/20 01:26:56, Lei Zhang wrote:
> > Is this copying 1 extra byte than necessary?
>
> It is. I think strlcpy is cleaner so I'm changing it. Is there a standard
way
> to do this? It seems like there should be...
How about using base::StringPiece::copy() ?
char* dst = new char[value.size() + 1];
value.copy(dst, value.size());
dst[value.size()] = '\0';
return dst;
https://codereview.chromium.org/2117713002/diff/220001/chrome/browser/printin...
File chrome/browser/printing/pdf_to_emf_converter.cc (right):
https://codereview.chromium.org/2117713002/diff/220001/chrome/browser/printin...
chrome/browser/printing/pdf_to_emf_converter.cc:263: bool
LazyEmf::GetDataAsVector(std::vector<char>* buffer) const {
Thanks for implemeting this... but will this ever get called? i.e. Should this
just be NOTREACHED(); return false;?
https://codereview.chromium.org/2117713002/diff/220001/printing/backend/cups_...
File printing/backend/cups_ipp_util.h (right):
https://codereview.chromium.org/2117713002/diff/220001/printing/backend/cups_...
printing/backend/cups_ipp_util.h:17: extern const char kIppCollate[]; // RFC
3381
No need for comments here.
https://codereview.chromium.org/2117713002/diff/220001/printing/printed_docum...
File printing/printed_document_chromeos.cc (right):
https://codereview.chromium.org/2117713002/diff/220001/printing/printed_docum...
printing/printed_document_chromeos.cc:13: #endif // USE_CUPS
So some of the printing code does not set the best example. This should be //
defined(USE_CUPS). i.e. #if $FOO should be mirrored by // $FOO.
Though in this particular case, I'd say don't even bother because:
1) there's no nesting
2) the #if is very close, so it's already obvious what this #endif pairs with.
Line 26 below should have the comment because nesting.
Line 44 below should have the comment because it's a bit far away from the #if.
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
File printing/printing_context_chromeos.cc (right):
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.cc:34: using CupsOption =
std::unique_ptr<cups_option_t, OptionDeleter>;
Can you name this ScopedCupsOption, so it's more obvious that this is a smart
pointer?
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.cc:74: // is null terminated and will need to
be deleted.
The more common phrase here would be "the caller owns the returned string."
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.cc:75: char* ToCString(const
base::StringPiece value) {
TOCString() -> more like, DuplicateString() ?
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.cc:85: option->name = ToCString(name);
It's probably not obvious to readers that CupsOption is going delete the
name/value here. Even reading the cupsFreeOptions() documentation is not
completely obvious and I had to peek at the cupsFreeOptions() source code to see
what it does. So a comment here to say (Scoped)CupsOption will delete the
strings is helpful.
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
File printing/printing_context_chromeos.h (right):
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.h:53: // id for ongoing print job. -1 if no
job is active.
printing_context_chromeos.cc checks for 0, what is 0?
|
skau
|
|
4 years, 4 months ago
(2016-07-27 00:16:03 UTC)
#27
|
|
commit-bot: I haz the power
|
|
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2117713002/260001
|
|
4 years, 4 months ago
(2016-07-27 00:16:23 UTC)
#28
|
|
skau
|
|
Comments addressed. PTAL. https://codereview.chromium.org/2117713002/diff/200001/printing/printing_context_chromeos.cc File printing/printing_context_chromeos.cc (right): https://codereview.chromium.org/2117713002/diff/200001/printing/printing_context_chromeos.cc#newcode81 printing/printing_context_chromeos.cc:81: value.copy(*dst, value_len); On 2016/07/25 21:06:03, Lei ...
|
|
4 years, 4 months ago
(2016-07-27 00:16:47 UTC)
#29
|
Comments addressed. PTAL.
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
File printing/printing_context_chromeos.cc (right):
https://codereview.chromium.org/2117713002/diff/200001/printing/printing_cont...
printing/printing_context_chromeos.cc:81: value.copy(*dst, value_len);
On 2016/07/25 21:06:03, Lei Zhang wrote:
> On 2016/07/22 23:36:14, skau wrote:
> > On 2016/07/20 01:26:56, Lei Zhang wrote:
> > > Is this copying 1 extra byte than necessary?
> >
> > It is. I think strlcpy is cleaner so I'm changing it. Is there a standard
> way
> > to do this? It seems like there should be...
>
> How about using base::StringPiece::copy() ?
>
> char* dst = new char[value.size() + 1];
> value.copy(dst, value.size());
> dst[value.size()] = '\0';
> return dst;
Done.
https://codereview.chromium.org/2117713002/diff/220001/chrome/browser/printin...
File chrome/browser/printing/pdf_to_emf_converter.cc (right):
https://codereview.chromium.org/2117713002/diff/220001/chrome/browser/printin...
chrome/browser/printing/pdf_to_emf_converter.cc:263: bool
LazyEmf::GetDataAsVector(std::vector<char>* buffer) const {
On 2016/07/25 21:06:04, Lei Zhang wrote:
> Thanks for implemeting this... but will this ever get called? i.e. Should this
> just be NOTREACHED(); return false;?
It's not currently called. NOTREACHED() probably works better since it's not
anticipated to be used.
https://codereview.chromium.org/2117713002/diff/220001/printing/backend/cups_...
File printing/backend/cups_ipp_util.h (right):
https://codereview.chromium.org/2117713002/diff/220001/printing/backend/cups_...
printing/backend/cups_ipp_util.h:17: extern const char kIppCollate[]; // RFC
3381
On 2016/07/25 21:06:04, Lei Zhang wrote:
> No need for comments here.
Done.
https://codereview.chromium.org/2117713002/diff/220001/printing/printed_docum...
File printing/printed_document_chromeos.cc (right):
https://codereview.chromium.org/2117713002/diff/220001/printing/printed_docum...
printing/printed_document_chromeos.cc:13: #endif // USE_CUPS
On 2016/07/25 21:06:04, Lei Zhang wrote:
> So some of the printing code does not set the best example. This should be //
> defined(USE_CUPS). i.e. #if $FOO should be mirrored by // $FOO.
>
> Though in this particular case, I'd say don't even bother because:
> 1) there's no nesting
> 2) the #if is very close, so it's already obvious what this #endif pairs with.
>
> Line 26 below should have the comment because nesting.
> Line 44 below should have the comment because it's a bit far away from the
#if.
Done.
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
File printing/printing_context_chromeos.cc (right):
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.cc:34: using CupsOption =
std::unique_ptr<cups_option_t, OptionDeleter>;
On 2016/07/25 21:06:04, Lei Zhang wrote:
> Can you name this ScopedCupsOption, so it's more obvious that this is a smart
> pointer?
Done.
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.cc:74: // is null terminated and will need to
be deleted.
On 2016/07/25 21:06:04, Lei Zhang wrote:
> The more common phrase here would be "the caller owns the returned string."
Done.
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.cc:75: char* ToCString(const
base::StringPiece value) {
On 2016/07/25 21:06:04, Lei Zhang wrote:
> TOCString() -> more like, DuplicateString() ?
Done.
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.cc:85: option->name = ToCString(name);
On 2016/07/25 21:06:04, Lei Zhang wrote:
> It's probably not obvious to readers that CupsOption is going delete the
> name/value here. Even reading the cupsFreeOptions() documentation is not
> completely obvious and I had to peek at the cupsFreeOptions() source code to
see
> what it does. So a comment here to say (Scoped)CupsOption will delete the
> strings is helpful.
Done.
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
File printing/printing_context_chromeos.h (right):
https://codereview.chromium.org/2117713002/diff/220001/printing/printing_cont...
printing/printing_context_chromeos.h:53: // id for ongoing print job. -1 if no
job is active.
On 2016/07/25 21:06:04, Lei Zhang wrote:
> printing_context_chromeos.cc checks for 0, what is 0?
If the createDestJob fails, job_id is set to 0. I'll just use 0 for everything
since they shouldn't need differentiation and I appear to have forgotten anyway.
|
commit-bot: I haz the power
|
|
4 years, 4 months ago
(2016-07-27 01:06:50 UTC)
#30
|
|
commit-bot: I haz the power
|
|
Dry run: This issue passed the CQ dry run.
|
|
4 years, 4 months ago
(2016-07-27 01:06:51 UTC)
#31
|
Dry run: This issue passed the CQ dry run.
|
Lei Zhang
|
|
4 years, 4 months ago
(2016-07-27 02:02:29 UTC)
#32
|
|
skau
|
|
4 years, 4 months ago
(2016-07-27 17:57:20 UTC)
#33
|
|
commit-bot: I haz the power
|
|
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2117713002/260001
|
|
4 years, 4 months ago
(2016-07-27 17:57:45 UTC)
#34
|
|
commit-bot: I haz the power
|
|
Committed patchset #14 (id:260001)
|
|
4 years, 4 months ago
(2016-07-27 18:05:07 UTC)
#35
|
Message was sent while issue was closed.
Committed patchset #14 (id:260001)
|
commit-bot: I haz the power
|
|
Description was changed from ========== Print directly to CUPS using the IPP APIs Implements printing ...
|
|
4 years, 4 months ago
(2016-07-27 18:07:15 UTC)
#36
|
Message was sent while issue was closed.
Description was changed from
==========
Print directly to CUPS using the IPP APIs
Implements printing to CUPS with paper size, color, and duplexing
configurable.
Existing bug where the printer does not initialize the first time it is
selected.
BUG=607668
TEST=Enable --enable-native-cups. Print a webpage to a desired CUPS
printer.
==========
to
==========
Print directly to CUPS using the IPP APIs
Implements printing to CUPS with paper size, color, and duplexing
configurable.
Existing bug where the printer does not initialize the first time it is
selected.
BUG=607668
TEST=Enable --enable-native-cups. Print a webpage to a desired CUPS
printer.
Committed: https://crrev.com/b793195a8a91fa9a17eaf4af0fa21fed4da4d9cc
Cr-Commit-Position: refs/heads/master@{#408179}
==========
|
commit-bot: I haz the power
|
|
Patchset 14 (id:??) landed as https://crrev.com/b793195a8a91fa9a17eaf4af0fa21fed4da4d9cc Cr-Commit-Position: refs/heads/master@{#408179}
|
|
4 years, 4 months ago
(2016-07-27 18:07:16 UTC)
#37
|
Expand Messages
|
Collapse Messages
|
Show Generated Messages
|
Hide Generated Messages
|