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

Side by Side Diff: Source/core/timing/Performance.cpp

Issue 108683002: Use xmlAtom / starAtom when possible instead of string literals (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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
« no previous file with comments | « Source/core/svg/SVGLangSpace.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 AtomicallyInitializedStatic(AtomicString&, timingAllowOrigin = *new AtomicSt ring("timing-allow-origin")); 164 AtomicallyInitializedStatic(AtomicString&, timingAllowOrigin = *new AtomicSt ring("timing-allow-origin"));
165 165
166 RefPtr<SecurityOrigin> resourceOrigin = SecurityOrigin::create(response.url( )); 166 RefPtr<SecurityOrigin> resourceOrigin = SecurityOrigin::create(response.url( ));
167 if (resourceOrigin->isSameSchemeHostPort(requestingDocument->securityOrigin( ))) 167 if (resourceOrigin->isSameSchemeHostPort(requestingDocument->securityOrigin( )))
168 return true; 168 return true;
169 169
170 const AtomicString& timingAllowOriginString = response.httpHeaderField(timin gAllowOrigin); 170 const AtomicString& timingAllowOriginString = response.httpHeaderField(timin gAllowOrigin);
171 if (timingAllowOriginString.isEmpty() || equalIgnoringCase(timingAllowOrigin String, "null")) 171 if (timingAllowOriginString.isEmpty() || equalIgnoringCase(timingAllowOrigin String, "null"))
172 return false; 172 return false;
173 173
174 if (timingAllowOriginString == "*") 174 if (timingAllowOriginString == starAtom)
175 return true; 175 return true;
176 176
177 const String& securityOrigin = requestingDocument->securityOrigin()->toStrin g(); 177 const String& securityOrigin = requestingDocument->securityOrigin()->toStrin g();
178 Vector<String> timingAllowOrigins; 178 Vector<String> timingAllowOrigins;
179 timingAllowOriginString.string().split(" ", timingAllowOrigins); 179 timingAllowOriginString.string().split(" ", timingAllowOrigins);
180 for (size_t i = 0; i < timingAllowOrigins.size(); ++i) { 180 for (size_t i = 0; i < timingAllowOrigins.size(); ++i) {
181 if (timingAllowOrigins[i] == securityOrigin) 181 if (timingAllowOrigins[i] == securityOrigin)
182 return true; 182 return true;
183 } 183 }
184 184
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 m_userTiming = UserTiming::create(this); 271 m_userTiming = UserTiming::create(this);
272 m_userTiming->clearMeasures(measureName); 272 m_userTiming->clearMeasures(measureName);
273 } 273 }
274 274
275 double Performance::now() const 275 double Performance::now() const
276 { 276 {
277 return 1000.0 * (monotonicallyIncreasingTime() - m_referenceTime); 277 return 1000.0 * (monotonicallyIncreasingTime() - m_referenceTime);
278 } 278 }
279 279
280 } // namespace WebCore 280 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/svg/SVGLangSpace.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698