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

Side by Side Diff: third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 v8::Local<v8::Value> devtoolsHostObj = 79 v8::Local<v8::Value> devtoolsHostObj =
80 ToV8(m_devtoolsHost.get(), global, scriptState->isolate()); 80 ToV8(m_devtoolsHost.get(), global, scriptState->isolate());
81 DCHECK(!devtoolsHostObj.IsEmpty()); 81 DCHECK(!devtoolsHostObj.IsEmpty());
82 global->Set(v8AtomicString(isolate, "DevToolsHost"), devtoolsHostObj); 82 global->Set(v8AtomicString(isolate, "DevToolsHost"), devtoolsHostObj);
83 } 83 }
84 84
85 if (m_injectedScriptForOrigin.isEmpty()) 85 if (m_injectedScriptForOrigin.isEmpty())
86 return; 86 return;
87 87
88 String origin = frame->getSecurityOrigin().toString(); 88 String origin = frame->getSecurityOrigin().toString();
89 String script = m_injectedScriptForOrigin.get(origin); 89 String script = m_injectedScriptForOrigin.at(origin);
90 if (script.isEmpty()) 90 if (script.isEmpty())
91 return; 91 return;
92 static int s_lastScriptId = 0; 92 static int s_lastScriptId = 0;
93 StringBuilder scriptWithId; 93 StringBuilder scriptWithId;
94 scriptWithId.append(script); 94 scriptWithId.append(script);
95 scriptWithId.append('('); 95 scriptWithId.append('(');
96 scriptWithId.appendNumber(++s_lastScriptId); 96 scriptWithId.appendNumber(++s_lastScriptId);
97 scriptWithId.append(')'); 97 scriptWithId.append(')');
98 frame->frame()->script().executeScriptInMainWorld(scriptWithId.toString()); 98 frame->frame()->script().executeScriptInMainWorld(scriptWithId.toString());
99 } 99 }
(...skipping 16 matching lines...) Expand all
116 ->viewImpl() 116 ->viewImpl()
117 ->showContextMenuAtPoint(x, y, menuProvider); 117 ->showContextMenuAtPoint(x, y, menuProvider);
118 } 118 }
119 119
120 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin, 120 void WebDevToolsFrontendImpl::setInjectedScriptForOrigin(const String& origin,
121 const String& source) { 121 const String& source) {
122 m_injectedScriptForOrigin.set(origin, source); 122 m_injectedScriptForOrigin.set(origin, source);
123 } 123 }
124 124
125 } // namespace blink 125 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityPolicy.cpp ('k') | third_party/WebKit/Source/web/WebEntities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698