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

Side by Side Diff: third_party/WebKit/Source/modules/mediasource/TrackDefault.cpp

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 "modules/mediasource/TrackDefault.h" 5 #include "modules/mediasource/TrackDefault.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "core/html/track/AudioTrack.h" 9 #include "core/html/track/AudioTrack.h"
10 #include "core/html/track/TextTrack.h" 10 #include "core/html/track/TextTrack.h"
11 #include "core/html/track/VideoTrack.h" 11 #include "core/html/track/VideoTrack.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 static const AtomicString& audioKeyword() 15 static const AtomicString& audioKeyword()
16 { 16 {
17 DEFINE_STATIC_LOCAL(const AtomicString, audio, ("audio", AtomicString::Const ructFromLiteral)); 17 DEFINE_STATIC_LOCAL(const AtomicString, audio, ("audio"));
18 return audio; 18 return audio;
19 } 19 }
20 20
21 static const AtomicString& videoKeyword() 21 static const AtomicString& videoKeyword()
22 { 22 {
23 DEFINE_STATIC_LOCAL(const AtomicString, video, ("video", AtomicString::Const ructFromLiteral)); 23 DEFINE_STATIC_LOCAL(const AtomicString, video, ("video"));
24 return video; 24 return video;
25 } 25 }
26 26
27 static const AtomicString& textKeyword() 27 static const AtomicString& textKeyword()
28 { 28 {
29 DEFINE_STATIC_LOCAL(const AtomicString, text, ("text", AtomicString::Constru ctFromLiteral)); 29 DEFINE_STATIC_LOCAL(const AtomicString, text, ("text"));
30 return text; 30 return text;
31 } 31 }
32 32
33 TrackDefault* TrackDefault::create(const AtomicString& type, const String& langu age, const String& label, const Vector<String>& kinds, const String& byteStreamT rackID, ExceptionState& exceptionState) 33 TrackDefault* TrackDefault::create(const AtomicString& type, const String& langu age, const String& label, const Vector<String>& kinds, const String& byteStreamT rackID, ExceptionState& exceptionState)
34 { 34 {
35 // Per 11 Nov 2014 Editor's Draft 35 // Per 11 Nov 2014 Editor's Draft
36 // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source. html#idl-def-TrackDefault 36 // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source. html#idl-def-TrackDefault
37 // with expectation that 37 // with expectation that
38 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27352 will be fixed soon: 38 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27352 will be fixed soon:
39 // When this method is invoked, the user agent must run the following steps: 39 // When this method is invoked, the user agent must run the following steps:
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 TrackDefault::TrackDefault(const AtomicString& type, const String& language, con st String& label, const Vector<String>& kinds, const String& byteStreamTrackID) 96 TrackDefault::TrackDefault(const AtomicString& type, const String& language, con st String& label, const Vector<String>& kinds, const String& byteStreamTrackID)
97 : m_type(type) 97 : m_type(type)
98 , m_byteStreamTrackID(byteStreamTrackID) 98 , m_byteStreamTrackID(byteStreamTrackID)
99 , m_language(language) 99 , m_language(language)
100 , m_label(label) 100 , m_label(label)
101 , m_kinds(kinds) 101 , m_kinds(kinds)
102 { 102 {
103 } 103 }
104 104
105 } // namespace blink 105 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698