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

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: Use AtomicString::ConstructFromLiteral 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/inspector/InspectorPageAgent.h ('k') | Source/core/loader/FrameLoader.cpp » ('j') | 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) 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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 } 892 }
893 893
894 Frame* InspectorPageAgent::assertFrame(ErrorString* errorString, const String& f rameId) 894 Frame* InspectorPageAgent::assertFrame(ErrorString* errorString, const String& f rameId)
895 { 895 {
896 Frame* frame = frameForId(frameId); 896 Frame* frame = frameForId(frameId);
897 if (!frame) 897 if (!frame)
898 *errorString = "No frame for given id found"; 898 *errorString = "No frame for given id found";
899 return frame; 899 return frame;
900 } 900 }
901 901
902 String InspectorPageAgent::resourceSourceMapURL(const String& url) 902 const AtomicString& InspectorPageAgent::resourceSourceMapURL(const String& url)
903 { 903 {
904 DEFINE_STATIC_LOCAL(String, sourceMapHttpHeader, ("SourceMap")); 904 DEFINE_STATIC_LOCAL(const AtomicString, sourceMapHttpHeader, ("SourceMap", A tomicString::ConstructFromLiteral));
905 DEFINE_STATIC_LOCAL(String, deprecatedSourceMapHttpHeader, ("X-SourceMap")); 905 DEFINE_STATIC_LOCAL(const AtomicString, deprecatedSourceMapHttpHeader, ("X-S ourceMap", AtomicString::ConstructFromLiteral));
906 if (url.isEmpty()) 906 if (url.isEmpty())
907 return String(); 907 return nullAtom;
908 Frame* frame = mainFrame(); 908 Frame* frame = mainFrame();
909 if (!frame) 909 if (!frame)
910 return String(); 910 return nullAtom;
911 Resource* resource = cachedResource(frame, KURL(ParsedURLString, url)); 911 Resource* resource = cachedResource(frame, KURL(ParsedURLString, url));
912 if (!resource) 912 if (!resource)
913 return String(); 913 return nullAtom;
914 String deprecatedHeaderSourceMapURL = resource->response().httpHeaderField(d eprecatedSourceMapHttpHeader); 914 const AtomicString& deprecatedHeaderSourceMapURL = resource->response().http HeaderField(deprecatedSourceMapHttpHeader);
915 if (!deprecatedHeaderSourceMapURL.isEmpty()) { 915 if (!deprecatedHeaderSourceMapURL.isEmpty()) {
916 // FIXME: add deprecated console message here. 916 // FIXME: add deprecated console message here.
917 return deprecatedHeaderSourceMapURL; 917 return deprecatedHeaderSourceMapURL;
918 } 918 }
919 return resource->response().httpHeaderField(sourceMapHttpHeader); 919 return resource->response().httpHeaderField(sourceMapHttpHeader);
920 } 920 }
921 921
922 bool InspectorPageAgent::deviceMetricsOverrideEnabled() 922 bool InspectorPageAgent::deviceMetricsOverrideEnabled()
923 { 923 {
924 return m_enabled && m_deviceMetricsOverridden; 924 return m_enabled && m_deviceMetricsOverridden;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 } 1249 }
1250 1250
1251 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1251 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1252 { 1252 {
1253 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1253 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1254 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1254 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1255 } 1255 }
1256 1256
1257 } // namespace WebCore 1257 } // namespace WebCore
1258 1258
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.h ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698