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

Side by Side Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 102103002: Have HashMap<KeyType, AtomicString>::get() return a const reference (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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 } 891 }
892 892
893 Frame* InspectorPageAgent::assertFrame(ErrorString* errorString, const String& f rameId) 893 Frame* InspectorPageAgent::assertFrame(ErrorString* errorString, const String& f rameId)
894 { 894 {
895 Frame* frame = frameForId(frameId); 895 Frame* frame = frameForId(frameId);
896 if (!frame) 896 if (!frame)
897 *errorString = "No frame for given id found"; 897 *errorString = "No frame for given id found";
898 return frame; 898 return frame;
899 } 899 }
900 900
901 String InspectorPageAgent::resourceSourceMapURL(const String& url) 901 const AtomicString& InspectorPageAgent::resourceSourceMapURL(const String& url)
902 { 902 {
903 DEFINE_STATIC_LOCAL(String, sourceMapHttpHeader, ("SourceMap")); 903 DEFINE_STATIC_LOCAL(const AtomicString, sourceMapHttpHeader, ("SourceMap"));
tkent 2013/12/04 01:01:00 Should have ConstructFromLiteral argument.
Inactive 2013/12/04 14:11:26 Done.
904 DEFINE_STATIC_LOCAL(String, deprecatedSourceMapHttpHeader, ("X-SourceMap")); 904 DEFINE_STATIC_LOCAL(const AtomicString, deprecatedSourceMapHttpHeader, ("X-S ourceMap"));
tkent 2013/12/04 01:01:00 Ditto.
Inactive 2013/12/04 14:11:26 Done.
905 if (url.isEmpty()) 905 if (url.isEmpty())
906 return String(); 906 return nullAtom;
907 Frame* frame = mainFrame(); 907 Frame* frame = mainFrame();
908 if (!frame) 908 if (!frame)
909 return String(); 909 return nullAtom;
910 Resource* resource = cachedResource(frame, KURL(ParsedURLString, url)); 910 Resource* resource = cachedResource(frame, KURL(ParsedURLString, url));
911 if (!resource) 911 if (!resource)
912 return String(); 912 return nullAtom;
913 String deprecatedHeaderSourceMapURL = resource->response().httpHeaderField(d eprecatedSourceMapHttpHeader); 913 const AtomicString& deprecatedHeaderSourceMapURL = resource->response().http HeaderField(deprecatedSourceMapHttpHeader);
914 if (!deprecatedHeaderSourceMapURL.isEmpty()) { 914 if (!deprecatedHeaderSourceMapURL.isEmpty()) {
915 // FIXME: add deprecated console message here. 915 // FIXME: add deprecated console message here.
916 return deprecatedHeaderSourceMapURL; 916 return deprecatedHeaderSourceMapURL;
917 } 917 }
918 return resource->response().httpHeaderField(sourceMapHttpHeader); 918 return resource->response().httpHeaderField(sourceMapHttpHeader);
919 } 919 }
920 920
921 bool InspectorPageAgent::deviceMetricsOverrideEnabled() 921 bool InspectorPageAgent::deviceMetricsOverrideEnabled()
922 { 922 {
923 return m_enabled && m_deviceMetricsOverridden; 923 return m_enabled && m_deviceMetricsOverridden;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 } 1248 }
1249 1249
1250 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1250 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1251 { 1251 {
1252 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1252 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1253 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1253 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1254 } 1254 }
1255 1255
1256 } // namespace WebCore 1256 } // namespace WebCore
1257 1257
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698