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

Side by Side Diff: third_party/WebKit/Source/core/editing/serializers/Serialization.cpp

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved.
5 * Copyright (C) 2011 Igalia S.L. 5 * Copyright (C) 2011 Igalia S.L.
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // range.markupString() 254 // range.markupString()
255 template <typename Strategy> 255 template <typename Strategy>
256 String CreateMarkupAlgorithm<Strategy>::createMarkup( 256 String CreateMarkupAlgorithm<Strategy>::createMarkup(
257 const PositionTemplate<Strategy>& startPosition, 257 const PositionTemplate<Strategy>& startPosition,
258 const PositionTemplate<Strategy>& endPosition, 258 const PositionTemplate<Strategy>& endPosition,
259 EAnnotateForInterchange shouldAnnotate, 259 EAnnotateForInterchange shouldAnnotate,
260 ConvertBlocksToInlines convertBlocksToInlines, 260 ConvertBlocksToInlines convertBlocksToInlines,
261 EAbsoluteURLs shouldResolveURLs, 261 EAbsoluteURLs shouldResolveURLs,
262 Node* constrainingAncestor) { 262 Node* constrainingAncestor) {
263 if (startPosition.isNull() || endPosition.isNull()) 263 if (startPosition.isNull() || endPosition.isNull())
264 return emptyString(); 264 return emptyString;
265 265
266 RELEASE_ASSERT(startPosition.compareTo(endPosition) <= 0); 266 RELEASE_ASSERT(startPosition.compareTo(endPosition) <= 0);
267 267
268 bool collapsed = startPosition == endPosition; 268 bool collapsed = startPosition == endPosition;
269 if (collapsed) 269 if (collapsed)
270 return emptyString(); 270 return emptyString;
271 Node* commonAncestor = 271 Node* commonAncestor =
272 Strategy::commonAncestor(*startPosition.computeContainerNode(), 272 Strategy::commonAncestor(*startPosition.computeContainerNode(),
273 *endPosition.computeContainerNode()); 273 *endPosition.computeContainerNode());
274 if (!commonAncestor) 274 if (!commonAncestor)
275 return emptyString(); 275 return emptyString;
276 276
277 Document* document = startPosition.document(); 277 Document* document = startPosition.document();
278 278
279 DCHECK(!document->needsLayoutTreeUpdate()); 279 DCHECK(!document->needsLayoutTreeUpdate());
280 DocumentLifecycle::DisallowTransitionScope disallowTransition( 280 DocumentLifecycle::DisallowTransitionScope disallowTransition(
281 document->lifecycle()); 281 document->lifecycle());
282 282
283 HTMLElement* specialCommonAncestor = highestAncestorToWrapMarkup<Strategy>( 283 HTMLElement* specialCommonAncestor = highestAncestorToWrapMarkup<Strategy>(
284 startPosition, endPosition, shouldAnnotate, constrainingAncestor); 284 startPosition, endPosition, shouldAnnotate, constrainingAncestor);
285 StyledMarkupSerializer<Strategy> serializer( 285 StyledMarkupSerializer<Strategy> serializer(
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 textNode->appendData(textNext->data()); 775 textNode->appendData(textNext->data());
776 if (textNext->parentNode()) // Might have been removed by mutation event. 776 if (textNext->parentNode()) // Might have been removed by mutation event.
777 textNext->remove(exceptionState); 777 textNext->remove(exceptionState);
778 } 778 }
779 779
780 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>; 780 template class CORE_TEMPLATE_EXPORT CreateMarkupAlgorithm<EditingStrategy>;
781 template class CORE_TEMPLATE_EXPORT 781 template class CORE_TEMPLATE_EXPORT
782 CreateMarkupAlgorithm<EditingInFlatTreeStrategy>; 782 CreateMarkupAlgorithm<EditingInFlatTreeStrategy>;
783 783
784 } // namespace blink 784 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698