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

Side by Side Diff: Source/core/page/Chrome.cpp

Issue 898593002: DevTools: use per-LocalFrame instrumenting agents instead of per-Page ones. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed assertion Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.cpp ('k') | Source/core/page/Page.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) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2012, Samsung Electronics. All rights reserved. 4 * Copyright (C) 2012, Samsung Electronics. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 { 189 {
190 return m_client->canRunBeforeUnloadConfirmPanel(); 190 return m_client->canRunBeforeUnloadConfirmPanel();
191 } 191 }
192 192
193 bool Chrome::runBeforeUnloadConfirmPanel(const String& message, LocalFrame* fram e) 193 bool Chrome::runBeforeUnloadConfirmPanel(const String& message, LocalFrame* fram e)
194 { 194 {
195 // Defer loads in case the client method runs a new event loop that would 195 // Defer loads in case the client method runs a new event loop that would
196 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript. 196 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript.
197 ScopedPageLoadDeferrer deferrer; 197 ScopedPageLoadDeferrer deferrer;
198 198
199 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, message); 199 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(frame, message);
200 bool ok = m_client->runBeforeUnloadConfirmPanel(message, frame); 200 bool ok = m_client->runBeforeUnloadConfirmPanel(message, frame);
201 InspectorInstrumentation::didRunJavaScriptDialog(cookie); 201 InspectorInstrumentation::didRunJavaScriptDialog(cookie);
202 return ok; 202 return ok;
203 } 203 }
204 204
205 void Chrome::closeWindowSoon() 205 void Chrome::closeWindowSoon()
206 { 206 {
207 m_client->closeWindowSoon(); 207 m_client->closeWindowSoon();
208 } 208 }
209 209
210 void Chrome::runJavaScriptAlert(LocalFrame* frame, const String& message) 210 void Chrome::runJavaScriptAlert(LocalFrame* frame, const String& message)
211 { 211 {
212 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::AlertDialog, mes sage)) 212 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::AlertDialog, mes sage))
213 return; 213 return;
214 214
215 // Defer loads in case the client method runs a new event loop that would 215 // Defer loads in case the client method runs a new event loop that would
216 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript. 216 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript.
217 ScopedPageLoadDeferrer deferrer; 217 ScopedPageLoadDeferrer deferrer;
218 218
219 ASSERT(frame); 219 ASSERT(frame);
220 notifyPopupOpeningObservers(); 220 notifyPopupOpeningObservers();
221 221
222 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, message); 222 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(frame, message);
223 m_client->runJavaScriptAlert(frame, message); 223 m_client->runJavaScriptAlert(frame, message);
224 InspectorInstrumentation::didRunJavaScriptDialog(cookie); 224 InspectorInstrumentation::didRunJavaScriptDialog(cookie);
225 } 225 }
226 226
227 bool Chrome::runJavaScriptConfirm(LocalFrame* frame, const String& message) 227 bool Chrome::runJavaScriptConfirm(LocalFrame* frame, const String& message)
228 { 228 {
229 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::ConfirmDialog, m essage)) 229 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::ConfirmDialog, m essage))
230 return false; 230 return false;
231 231
232 // Defer loads in case the client method runs a new event loop that would 232 // Defer loads in case the client method runs a new event loop that would
233 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript. 233 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript.
234 ScopedPageLoadDeferrer deferrer; 234 ScopedPageLoadDeferrer deferrer;
235 235
236 ASSERT(frame); 236 ASSERT(frame);
237 notifyPopupOpeningObservers(); 237 notifyPopupOpeningObservers();
238 238
239 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, message); 239 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(frame, message);
240 bool ok = m_client->runJavaScriptConfirm(frame, message); 240 bool ok = m_client->runJavaScriptConfirm(frame, message);
241 InspectorInstrumentation::didRunJavaScriptDialog(cookie); 241 InspectorInstrumentation::didRunJavaScriptDialog(cookie);
242 return ok; 242 return ok;
243 } 243 }
244 244
245 bool Chrome::runJavaScriptPrompt(LocalFrame* frame, const String& prompt, const String& defaultValue, String& result) 245 bool Chrome::runJavaScriptPrompt(LocalFrame* frame, const String& prompt, const String& defaultValue, String& result)
246 { 246 {
247 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::PromptDialog, pr ompt)) 247 if (!canRunModalIfDuringPageDismissal(m_page, ChromeClient::PromptDialog, pr ompt))
248 return false; 248 return false;
249 249
250 // Defer loads in case the client method runs a new event loop that would 250 // Defer loads in case the client method runs a new event loop that would
251 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript. 251 // otherwise cause the load to continue while we're in the middle of executi ng JavaScript.
252 ScopedPageLoadDeferrer deferrer; 252 ScopedPageLoadDeferrer deferrer;
253 253
254 ASSERT(frame); 254 ASSERT(frame);
255 notifyPopupOpeningObservers(); 255 notifyPopupOpeningObservers();
256 256
257 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(m_page, prompt); 257 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJav aScriptDialog(frame, prompt);
258 bool ok = m_client->runJavaScriptPrompt(frame, prompt, defaultValue, result) ; 258 bool ok = m_client->runJavaScriptPrompt(frame, prompt, defaultValue, result) ;
259 InspectorInstrumentation::didRunJavaScriptDialog(cookie); 259 InspectorInstrumentation::didRunJavaScriptDialog(cookie);
260 260
261 return ok; 261 return ok;
262 } 262 }
263 263
264 void Chrome::setStatusbarText(LocalFrame* frame, const String& status) 264 void Chrome::setStatusbarText(LocalFrame* frame, const String& status)
265 { 265 {
266 ASSERT(frame); 266 ASSERT(frame);
267 m_client->setStatusbarText(status); 267 m_client->setStatusbarText(status);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 { 408 {
409 m_client->registerViewportLayers(); 409 m_client->registerViewportLayers();
410 } 410 }
411 411
412 void Chrome::willBeDestroyed() 412 void Chrome::willBeDestroyed()
413 { 413 {
414 m_client->chromeDestroyed(); 414 m_client->chromeDestroyed();
415 } 415 }
416 416
417 } // namespace blink 417 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.cpp ('k') | Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698