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

Side by Side Diff: bindings/v8/V8Utilities.cpp

Issue 160590: A patch for http://crbug.com/17400... (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: Created 11 years, 4 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
« no previous file with comments | « bindings/v8/V8LazyEventListener.h ('k') | bindings/v8/custom/V8CustomBinding.h » ('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 * 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 v8::Local<v8::Value> cache = object->GetInternalField(cacheIndex); 60 v8::Local<v8::Value> cache = object->GetInternalField(cacheIndex);
61 ASSERT(cache->IsArray()); 61 ASSERT(cache->IsArray());
62 v8::Local<v8::Array> cacheArray = v8::Local<v8::Array>::Cast(cache); 62 v8::Local<v8::Array> cacheArray = v8::Local<v8::Array>::Cast(cache);
63 for (int i = cacheArray->Length() - 1; i >= 0; --i) { 63 for (int i = cacheArray->Length() - 1; i >= 0; --i) {
64 v8::Local<v8::Value> cached = cacheArray->Get(v8::Integer::New(i)); 64 v8::Local<v8::Value> cached = cacheArray->Get(v8::Integer::New(i));
65 if (cached->StrictEquals(value)) { 65 if (cached->StrictEquals(value)) {
66 cacheArray->Delete(i); 66 cacheArray->Delete(i);
67 return; 67 return;
68 } 68 }
69 } 69 }
70
71 // We should only get here if we try to remove an event listener that was ne ver added.
72 ASSERT_NOT_REACHED();
73 } 70 }
74 71
75 bool processingUserGesture() 72 bool processingUserGesture()
76 { 73 {
77 Frame* frame = V8Proxy::retrieveFrameForEnteredContext(); 74 Frame* frame = V8Proxy::retrieveFrameForEnteredContext();
78 return frame && frame->script()->processingUserGesture(); 75 return frame && frame->script()->processingUserGesture();
79 } 76 }
80 77
81 bool shouldAllowNavigation(Frame* frame) 78 bool shouldAllowNavigation(Frame* frame)
82 { 79 {
(...skipping 14 matching lines...) Expand all
97 { 94 {
98 Frame* callingFrame = V8Proxy::retrieveFrameForCallingContext(); 95 Frame* callingFrame = V8Proxy::retrieveFrameForCallingContext();
99 if (!callingFrame) 96 if (!callingFrame)
100 return; 97 return;
101 98
102 if (!protocolIsJavaScript(url) || ScriptController::isSafeScript(frame)) 99 if (!protocolIsJavaScript(url) || ScriptController::isSafeScript(frame))
103 frame->loader()->scheduleLocationChange(url.string(), callingFrame->load er()->outgoingReferrer(), lockHistory, lockBackForwardList, processingUserGestur e()); 100 frame->loader()->scheduleLocationChange(url.string(), callingFrame->load er()->outgoingReferrer(), lockHistory, lockBackForwardList, processingUserGestur e());
104 } 101 }
105 102
106 } // namespace WebCore 103 } // namespace WebCore
OLDNEW
« no previous file with comments | « bindings/v8/V8LazyEventListener.h ('k') | bindings/v8/custom/V8CustomBinding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698