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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorHelpers.cpp

Issue 2800213002: Avoid duplicate functions/code in core/inspector.
Patch Set: A third way Created 3 years, 5 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "core/inspector/AddStringToDigestor.h" 5 #include "core/inspector/InspectorHelpers.h"
6 6
7 #include "core/inspector/IdentifiersFactory.h"
7 #include "platform/wtf/text/WTFString.h" 8 #include "platform/wtf/text/WTFString.h"
8 #include "public/platform/WebCrypto.h" 9 #include "public/platform/WebCrypto.h"
9 10
10 namespace blink { 11 namespace blink {
11 12
12 void AddStringToDigestor(WebCryptoDigestor* digestor, const String& string) { 13 void AddStringToDigestor(WebCryptoDigestor* digestor, const String& string) {
13 const CString c_string = string.Utf8(); 14 const CString c_string = string.Utf8();
pfeldman 2017/07/21 18:10:59 Could you just inline this?
Daniel Bratell 2017/07/23 20:14:12 If "string.Utf8()" is moved to be inside the funct
pfeldman 2017/07/25 00:14:43 I wanted to inline these two lines into both call
14 digestor->Consume(reinterpret_cast<const unsigned char*>(c_string.data()), 15 digestor->Consume(reinterpret_cast<const unsigned char*>(c_string.data()),
15 c_string.length()); 16 c_string.length());
16 } 17 }
17 18
19 KURL UrlWithoutFragment(const KURL& url) {
20 KURL result = url;
pfeldman 2017/07/21 18:10:59 ditto
Daniel Bratell 2017/07/23 20:14:12 Inline result? There is a non-const destructive fu
pfeldman 2017/07/25 00:14:43 Inline entire method: KURL nofragment = url; nofr
21 result.RemoveFragmentIdentifier();
22 return result;
23 }
24
18 } // namespace blink 25 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698