Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Side by Side Diff: extensions/browser/api/cast_channel/logger.cc

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/api/cast_channel/logger.h" 5 #include "extensions/browser/api/cast_channel/logger.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/time/tick_clock.h" 8 #include "base/time/tick_clock.h"
9 #include "extensions/browser/api/cast_channel/cast_auth_util.h" 9 #include "extensions/browser/api/cast_channel/cast_auth_util.h"
10 #include "extensions/browser/api/cast_channel/logger_util.h" 10 #include "extensions/browser/api/cast_channel/logger_util.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 case AuthResult::ERROR_NSS_SIGNED_BLOBS_MISMATCH: 53 case AuthResult::ERROR_NSS_SIGNED_BLOBS_MISMATCH:
54 return proto::CHALLENGE_REPLY_ERROR_NSS_SIGNED_BLOBS_MISMATCH; 54 return proto::CHALLENGE_REPLY_ERROR_NSS_SIGNED_BLOBS_MISMATCH;
55 default: 55 default:
56 NOTREACHED(); 56 NOTREACHED();
57 return proto::CHALLENGE_REPLY_ERROR_NONE; 57 return proto::CHALLENGE_REPLY_ERROR_NONE;
58 } 58 }
59 } 59 }
60 60
61 scoped_ptr<char[]> Compress(const std::string& input, size_t* length) { 61 scoped_ptr<char[]> Compress(const std::string& input, size_t* length) {
62 *length = 0; 62 *length = 0;
63 z_stream stream = {0}; 63 z_stream stream = {nullptr};
64 int result = deflateInit2(&stream, 64 int result = deflateInit2(&stream,
65 Z_DEFAULT_COMPRESSION, 65 Z_DEFAULT_COMPRESSION,
66 Z_DEFLATED, 66 Z_DEFLATED,
67 // 16 is added to produce a gzip header + trailer. 67 // 16 is added to produce a gzip header + trailer.
68 MAX_WBITS + 16, 68 MAX_WBITS + 16,
69 8, // memLevel = 8 is default. 69 8, // memLevel = 8 is default.
70 Z_DEFAULT_STRATEGY); 70 Z_DEFAULT_STRATEGY);
71 DCHECK_EQ(Z_OK, result); 71 DCHECK_EQ(Z_OK, result);
72 72
73 size_t out_size = deflateBound(&stream, input.size()); 73 size_t out_size = deflateBound(&stream, input.size());
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 if (it != aggregated_socket_events_.end()) { 351 if (it != aggregated_socket_events_.end()) {
352 return it->second->last_errors; 352 return it->second->last_errors;
353 } else { 353 } else {
354 return LastErrors(); 354 return LastErrors();
355 } 355 }
356 } 356 }
357 357
358 } // namespace cast_channel 358 } // namespace cast_channel
359 } // namespace api 359 } // namespace api
360 } // namespace extensions 360 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698