Commit 0ba26ac6 authored by bratell's avatar bratell Committed by Commit Bot

Avoid duplicate functions: one AddStringToDigestor is enough

There are two implementation of AddStringToDigestor. Beyond being
one more than needed, they also conflict in jumbo builds.

This patch merges the two AddStringToDigestor and removes the
conflicting files from the jumbo exclusion list.

Review-Url: https://codereview.chromium.org/2800133003
Cr-Commit-Position: refs/heads/master@{#485992}
parent 2610a45c
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/inspector/AddStringToDigestor.h"
#include "platform/wtf/text/WTFString.h"
#include "public/platform/WebCrypto.h"
namespace blink {
void AddStringToDigestor(WebCryptoDigestor* digestor, const String& string) {
const CString c_string = string.Utf8();
digestor->Consume(reinterpret_cast<const unsigned char*>(c_string.data()),
c_string.length());
}
} // namespace blink
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef AddStringToDigestor_h
#define AddStringToDigestor_h
namespace WTF {
class String;
}
namespace blink {
class WebCryptoDigestor;
void AddStringToDigestor(WebCryptoDigestor*, const WTF::String&);
} // namespace blink
#endif // AddStringToDigestor_h
...@@ -11,6 +11,8 @@ _inspector_protocol_dir = "//third_party/inspector_protocol" ...@@ -11,6 +11,8 @@ _inspector_protocol_dir = "//third_party/inspector_protocol"
blink_core_sources("inspector") { blink_core_sources("inspector") {
sources = [ sources = [
"AddStringToDigestor.cpp",
"AddStringToDigestor.h",
"ConsoleMessage.cpp", "ConsoleMessage.cpp",
"ConsoleMessage.h", "ConsoleMessage.h",
"ConsoleMessageStorage.cpp", "ConsoleMessageStorage.cpp",
...@@ -95,9 +97,6 @@ blink_core_sources("inspector") { ...@@ -95,9 +97,6 @@ blink_core_sources("inspector") {
] ]
jumbo_excluded_sources = [ jumbo_excluded_sources = [
# Collides with DOMPatchSupport.cpp (patch incoming)
"InspectorAnimationAgent.cpp",
# Collides with InspectorPageAgent.cpp and # Collides with InspectorPageAgent.cpp and
# NetworkResourcesData.cpp (patch incoming) # NetworkResourcesData.cpp (patch incoming)
"InspectorNetworkAgent.cpp", "InspectorNetworkAgent.cpp",
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "core/html/HTMLDocument.h" #include "core/html/HTMLDocument.h"
#include "core/html/HTMLHeadElement.h" #include "core/html/HTMLHeadElement.h"
#include "core/html/parser/HTMLDocumentParser.h" #include "core/html/parser/HTMLDocumentParser.h"
#include "core/inspector/AddStringToDigestor.h"
#include "core/inspector/DOMEditor.h" #include "core/inspector/DOMEditor.h"
#include "core/inspector/InspectorHistory.h" #include "core/inspector/InspectorHistory.h"
#include "core/xml/parser/XMLDocumentParser.h" #include "core/xml/parser/XMLDocumentParser.h"
...@@ -427,13 +428,6 @@ bool DOMPatchSupport::InnerPatchChildren( ...@@ -427,13 +428,6 @@ bool DOMPatchSupport::InnerPatchChildren(
return true; return true;
} }
static void AddStringToDigestor(WebCryptoDigestor* digestor,
const String& string) {
digestor->Consume(
reinterpret_cast<const unsigned char*>(string.Utf8().data()),
string.length());
}
DOMPatchSupport::Digest* DOMPatchSupport::CreateDigest( DOMPatchSupport::Digest* DOMPatchSupport::CreateDigest(
Node* node, Node* node,
UnusedNodesMap* unused_nodes_map) { UnusedNodesMap* unused_nodes_map) {
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "core/css/resolver/StyleResolver.h" #include "core/css/resolver/StyleResolver.h"
#include "core/dom/DOMNodeIds.h" #include "core/dom/DOMNodeIds.h"
#include "core/frame/LocalFrame.h" #include "core/frame/LocalFrame.h"
#include "core/inspector/AddStringToDigestor.h"
#include "core/inspector/InspectedFrames.h" #include "core/inspector/InspectedFrames.h"
#include "core/inspector/InspectorCSSAgent.h" #include "core/inspector/InspectorCSSAgent.h"
#include "core/inspector/InspectorStyleSheet.h" #include "core/inspector/InspectorStyleSheet.h"
...@@ -454,13 +455,6 @@ static CSSPropertyID g_transition_properties[] = { ...@@ -454,13 +455,6 @@ static CSSPropertyID g_transition_properties[] = {
CSSPropertyTransitionProperty, CSSPropertyTransitionTimingFunction, CSSPropertyTransitionProperty, CSSPropertyTransitionTimingFunction,
}; };
static void AddStringToDigestor(WebCryptoDigestor* digestor,
const String& string) {
digestor->Consume(
reinterpret_cast<const unsigned char*>(string.Ascii().data()),
string.length());
}
String InspectorAnimationAgent::CreateCSSId(blink::Animation& animation) { String InspectorAnimationAgent::CreateCSSId(blink::Animation& animation) {
String type = String type =
id_to_animation_type_.at(String::Number(animation.SequenceNumber())); id_to_animation_type_.at(String::Number(animation.SequenceNumber()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment