OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009 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 22 matching lines...) Expand all Loading... |
33 #include "bindings/core/v8/ScriptController.h" | 33 #include "bindings/core/v8/ScriptController.h" |
34 #include "bindings/core/v8/V8Binding.h" | 34 #include "bindings/core/v8/V8Binding.h" |
35 #include "bindings/core/v8/V8HTMLAllCollection.h" | 35 #include "bindings/core/v8/V8HTMLAllCollection.h" |
36 #include "bindings/core/v8/V8HTMLCollection.h" | 36 #include "bindings/core/v8/V8HTMLCollection.h" |
37 #include "bindings/core/v8/V8Node.h" | 37 #include "bindings/core/v8/V8Node.h" |
38 #include "bindings/core/v8/V8Window.h" | 38 #include "bindings/core/v8/V8Window.h" |
39 #include "core/HTMLNames.h" | 39 #include "core/HTMLNames.h" |
40 #include "core/dom/Document.h" | 40 #include "core/dom/Document.h" |
41 #include "core/frame/LocalDOMWindow.h" | 41 #include "core/frame/LocalDOMWindow.h" |
42 #include "core/frame/LocalFrame.h" | 42 #include "core/frame/LocalFrame.h" |
| 43 #include "core/frame/UseCounter.h" |
43 #include "core/html/HTMLAllCollection.h" | 44 #include "core/html/HTMLAllCollection.h" |
44 #include "core/html/HTMLCollection.h" | 45 #include "core/html/HTMLCollection.h" |
45 #include "core/html/HTMLIFrameElement.h" | 46 #include "core/html/HTMLIFrameElement.h" |
46 #include "wtf/PtrUtil.h" | 47 #include "wtf/PtrUtil.h" |
47 #include "wtf/RefPtr.h" | 48 #include "wtf/RefPtr.h" |
48 #include "wtf/StdLibExtras.h" | 49 #include "wtf/StdLibExtras.h" |
49 #include <memory> | 50 #include <memory> |
50 | 51 |
51 namespace blink { | 52 namespace blink { |
52 | 53 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 v8SetReturnValue(info, V8ScriptRunner::callFunction(v8::Local<v8::Functi
on>::Cast(function), frame->document(), global, info.Length(), params.get(), inf
o.GetIsolate())); | 85 v8SetReturnValue(info, V8ScriptRunner::callFunction(v8::Local<v8::Functi
on>::Cast(function), frame->document(), global, info.Length(), params.get(), inf
o.GetIsolate())); |
85 return; | 86 return; |
86 } | 87 } |
87 | 88 |
88 ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "Doc
ument", info.Holder(), info.GetIsolate()); | 89 ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "Doc
ument", info.Holder(), info.GetIsolate()); |
89 document->open(enteredDOMWindow(info.GetIsolate())->document(), exceptionSta
te); | 90 document->open(enteredDOMWindow(info.GetIsolate())->document(), exceptionSta
te); |
90 | 91 |
91 v8SetReturnValue(info, info.Holder()); | 92 v8SetReturnValue(info, info.Holder()); |
92 } | 93 } |
93 | 94 |
| 95 void V8Document::createTouchMethodPrologueCustom(const v8::FunctionCallbackInfo<
v8::Value>& info, Document*) |
| 96 { |
| 97 v8::Local<v8::Value> v8Window = info[0]; |
| 98 if (isUndefinedOrNull(v8Window)) { |
| 99 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionC
ontext(info.GetIsolate()), |
| 100 UseCounter::DocumentCreateTouchWindowNull); |
| 101 } else if (!toDOMWindow(info.GetIsolate(), v8Window)) { |
| 102 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionC
ontext(info.GetIsolate()), |
| 103 UseCounter::DocumentCreateTouchWindowWrongType); |
| 104 } |
| 105 |
| 106 v8::Local<v8::Value> v8Target = info[1]; |
| 107 if (isUndefinedOrNull(v8Target)) { |
| 108 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionC
ontext(info.GetIsolate()), |
| 109 UseCounter::DocumentCreateTouchTargetNull); |
| 110 } else if (!toEventTarget(info.GetIsolate(), v8Target)) { |
| 111 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionC
ontext(info.GetIsolate()), |
| 112 UseCounter::DocumentCreateTouchTargetWrongType); |
| 113 } |
| 114 |
| 115 if (info.Length() < 7) { |
| 116 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionC
ontext(info.GetIsolate()), |
| 117 UseCounter::DocumentCreateTouchLessThanSevenArguments); |
| 118 } |
| 119 } |
| 120 |
94 } // namespace blink | 121 } // namespace blink |
OLD | NEW |