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

Side by Side Diff: Source/bindings/v8/ScriptController.cpp

Issue 334283004: Rename DOMWindow to LocalDOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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/bindings/v8/NPV8Object.cpp ('k') | Source/bindings/v8/ScriptProfiler.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) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "bindings/v8/V8PerContextData.h" 46 #include "bindings/v8/V8PerContextData.h"
47 #include "bindings/v8/V8ScriptRunner.h" 47 #include "bindings/v8/V8ScriptRunner.h"
48 #include "bindings/v8/V8WindowShell.h" 48 #include "bindings/v8/V8WindowShell.h"
49 #include "bindings/v8/npruntime_impl.h" 49 #include "bindings/v8/npruntime_impl.h"
50 #include "bindings/v8/npruntime_priv.h" 50 #include "bindings/v8/npruntime_priv.h"
51 #include "core/dom/Document.h" 51 #include "core/dom/Document.h"
52 #include "core/dom/Node.h" 52 #include "core/dom/Node.h"
53 #include "core/dom/ScriptableDocumentParser.h" 53 #include "core/dom/ScriptableDocumentParser.h"
54 #include "core/events/Event.h" 54 #include "core/events/Event.h"
55 #include "core/events/EventListener.h" 55 #include "core/events/EventListener.h"
56 #include "core/frame/DOMWindow.h" 56 #include "core/frame/LocalDOMWindow.h"
57 #include "core/frame/LocalFrame.h" 57 #include "core/frame/LocalFrame.h"
58 #include "core/frame/Settings.h" 58 #include "core/frame/Settings.h"
59 #include "core/frame/csp/ContentSecurityPolicy.h" 59 #include "core/frame/csp/ContentSecurityPolicy.h"
60 #include "core/html/HTMLPlugInElement.h" 60 #include "core/html/HTMLPlugInElement.h"
61 #include "core/inspector/InspectorInstrumentation.h" 61 #include "core/inspector/InspectorInstrumentation.h"
62 #include "core/inspector/InspectorTraceEvents.h" 62 #include "core/inspector/InspectorTraceEvents.h"
63 #include "core/inspector/ScriptCallStack.h" 63 #include "core/inspector/ScriptCallStack.h"
64 #include "core/loader/DocumentLoader.h" 64 #include "core/loader/DocumentLoader.h"
65 #include "core/loader/FrameLoader.h" 65 #include "core/loader/FrameLoader.h"
66 #include "core/loader/FrameLoaderClient.h" 66 #include "core/loader/FrameLoaderClient.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 return 0; 357 return 0;
358 } 358 }
359 359
360 static NPObject* createScriptObject(LocalFrame* frame, v8::Isolate* isolate) 360 static NPObject* createScriptObject(LocalFrame* frame, v8::Isolate* isolate)
361 { 361 {
362 ScriptState* scriptState = ScriptState::forMainWorld(frame); 362 ScriptState* scriptState = ScriptState::forMainWorld(frame);
363 if (scriptState->contextIsEmpty()) 363 if (scriptState->contextIsEmpty())
364 return createNoScriptObject(); 364 return createNoScriptObject();
365 365
366 ScriptState::Scope scope(scriptState); 366 ScriptState::Scope scope(scriptState);
367 DOMWindow* window = frame->domWindow(); 367 LocalDOMWindow* window = frame->domWindow();
368 v8::Handle<v8::Value> global = toV8(window, scriptState->context()->Global() , scriptState->isolate()); 368 v8::Handle<v8::Value> global = toV8(window, scriptState->context()->Global() , scriptState->isolate());
369 ASSERT(global->IsObject()); 369 ASSERT(global->IsObject());
370 return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(global), windo w, isolate); 370 return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(global), windo w, isolate);
371 } 371 }
372 372
373 NPObject* ScriptController::windowScriptNPObject() 373 NPObject* ScriptController::windowScriptNPObject()
374 { 374 {
375 if (m_windowScriptNPObject) 375 if (m_windowScriptNPObject)
376 return m_windowScriptNPObject; 376 return m_windowScriptNPObject;
377 377
(...skipping 15 matching lines...) Expand all
393 { 393 {
394 // Can't create NPObjects when JavaScript is disabled. 394 // Can't create NPObjects when JavaScript is disabled.
395 if (!canExecuteScripts(NotAboutToExecuteScript)) 395 if (!canExecuteScripts(NotAboutToExecuteScript))
396 return createNoScriptObject(); 396 return createNoScriptObject();
397 397
398 ScriptState* scriptState = ScriptState::forMainWorld(m_frame); 398 ScriptState* scriptState = ScriptState::forMainWorld(m_frame);
399 if (scriptState->contextIsEmpty()) 399 if (scriptState->contextIsEmpty())
400 return createNoScriptObject(); 400 return createNoScriptObject();
401 401
402 ScriptState::Scope scope(scriptState); 402 ScriptState::Scope scope(scriptState);
403 DOMWindow* window = m_frame->domWindow(); 403 LocalDOMWindow* window = m_frame->domWindow();
404 v8::Handle<v8::Value> v8plugin = toV8(plugin, scriptState->context()->Global (), scriptState->isolate()); 404 v8::Handle<v8::Value> v8plugin = toV8(plugin, scriptState->context()->Global (), scriptState->isolate());
405 if (!v8plugin->IsObject()) 405 if (!v8plugin->IsObject())
406 return createNoScriptObject(); 406 return createNoScriptObject();
407 407
408 return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(v8plugin), win dow, scriptState->isolate()); 408 return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(v8plugin), win dow, scriptState->isolate());
409 } 409 }
410 410
411 void ScriptController::clearWindowShell() 411 void ScriptController::clearWindowShell()
412 { 412 {
413 double start = currentTime(); 413 double start = currentTime();
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 resultArray->Set(i, evaluationResult); 609 resultArray->Set(i, evaluationResult);
610 } 610 }
611 611
612 if (results) { 612 if (results) {
613 for (size_t i = 0; i < resultArray->Length(); ++i) 613 for (size_t i = 0; i < resultArray->Length(); ++i)
614 results->append(handleScope.Escape(resultArray->Get(i))); 614 results->append(handleScope.Escape(resultArray->Get(i)));
615 } 615 }
616 } 616 }
617 617
618 } // namespace WebCore 618 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/NPV8Object.cpp ('k') | Source/bindings/v8/ScriptProfiler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698